Suggestion: Generalise bboxClip to support all GeoJSON object types

Open
#2,813 6 comments 0 reactions 1 assignee View on GitHub

@stevage is already working on this.

Since Jan 15, 2025.

Assessment

This issue has not been assessed yet.

Description

@turf/bbox-clip

There is not really an easy way to crop a featureCollection (or other geometry type) to a polygon or bbox.

There are times when I just want to do:

const newFC = turf.crop(oldFC, [xmin, ymin, xmax, ymax])

or

const newFC = turf.crop(oldFC, cropPolygon)

It's relatively easy to use intersect to crop Polygons, and booleanPointInPolygon to filter out Points, but I'm not even sure if there's a straightforward way to crop LineStrings currently.

Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Turfjs/turf

All issues in Turfjs/turf

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.