Clip¶
Description¶
The gs:Clip process will clip a feature collection by a given geometry, typically a polygon or multipolygon. Attributes names and values are not affected by this process, and will be passed to the output feature collection without modification.
All features that intersect with the clipping geometry will be returned with their geometries cropped in the output geometry. Any features that do not intersect with the clipping geometry will be eliminated from the output geometry.

gs:Clip
Inputs and outputs¶
gs:Clip accepts both Feature collection inputs and Geometry inputs, and returns Feature collection outputs.
Inputs¶
Name | Description | Type | Usage |
---|---|---|---|
features | Input feature collection | SimpleFeatureCollection | Required |
clip | Clipping geometry—Same CRS as input features | Geometry | Required |
Outputs¶
Name | Description | Type |
---|---|---|
result | Clipped feature collection | SimpleFeatureCollection |
Usage notes¶
- The clipping geometry must be in the same CRS as the feature collection.
- Although not a common requirement, the clipping geometry could also be a point or line.
Examples¶
Clipping by rectangle¶
The following example clips the world:borders feature collection to an rectangle that covers the continental part of the United States. The clipping geometry is manually entered as a WKT string.
Input parameters:
- features: world:borders
- clip: POLYGON((-125 25, -67 25, -67 50, -125 50, -125 25))

gs:Clip example 1 parameters

gs:Clip example 1 output
Clipping by feature¶
The geometry used for the clipping operation can be obtained from another feature collection, instead of entered explicitly. The following example clips the feature collection medford:streets by the polygon contained in the feature collection medford:citylimits. The result is a new feature collection that only contains street sections within the city limits.
Since the gs:Clip process takes a Geometry object as input and not a feature collection, the gs:CollectGeometries process is used to create a single geometry from the medford:citylimits feature collection.
Note
This is an example of a “chained” process, where the output of one process is used as the input of another process.
Input parameters for gs:CollectGeometries:
- features: medford:citylimits
Input parameters for gs:Clip:
- features: medford:streets
- clip: output from gs:CollectGeometries process
Download complete chained XML request

gs:Clip example 2 parameters (part 1)

gs:Clip example 2 parameters (part 2)

gs:Clip example output