Clip a geometry with another geometry.

Use case
Create a new set of geometries for analysis (e.g. displaying buffer zones around abandoned coal mine shafts in an area of planned urban development) by clipping intersecting geometries.
How to use the sample
Tap the button to clip the blue graphic with the dotted red envelopes.
How it works
- Use the
static GeometryEngine.clip(_:to:)method to generate a clippedGeometry, specifying an existingGeometryand anEnvelopeas parameters. The existing geometry will be clipped where it intersects an envelope. - Create a
Graphicinstance from the clipped geometry and add it to aGraphicsOverlay.
Relevant API
- Envelope
- Geometry
- GeometryEngine
- Graphic
- GraphicsOverlay
- static GeometryEngine.clip(_:to:)
Additional information
Note: the resulting geometry may be null if the envelope does not intersect the geometry being clipped.
Tags
analysis, clip, geometry