Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
stevage committed Jan 29, 2025
1 parent 52a08d8 commit 001a56e
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions packages/turf-bbox-clip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

## bboxClip

Takes a [Feature][1], [Geometry][2] or [FeatureCollection][3] and a bbox and clips the object to the bbox using
[lineclip][4].
Takes a [Feature][1], [Geometry][2] or [FeatureCollection][3] and a bbox and returns the part of the object within the bbox.
Lines and polygons are clipped using [lineclip][4].
If a Point or LineString geometry is entirely outside the bbox, a [MultiPoint][5] or [MultiLineString][6] with empty `coordinates` array is returned.
LineString and Polygon geometries may also become MultiLineString or [MultiPolygon][7] if the clipping process cuts them into several pieces.
LineString geometries may also become MultiLineString if the clipping process cuts them into several pieces.

### Parameters

* `feature` **[Feature][1]<([Point][8] | [MultiPoint][5] | [LineString][9] | [MultiLineString][6] | [Polygon][10] | [MultiPolygon][7])>** feature to clip to the bbox
* `bbox` **[BBox][11]** extent in \[minX, minY, maxX, maxY] order
* `feature` **([Geometry][2] | [Feature][1] | [FeatureCollection][3])** GeoJSON object to clip to the bbox
* `bbox` **[BBox][7]** extent in \[minX, minY, maxX, maxY] order

### Examples

Expand All @@ -26,7 +26,7 @@ var clipped = turf.bboxClip(poly, bbox);
var addToMap = [bbox, poly, clipped]
```

Returns **[Feature][1]<([Point][8] | [MultiPoint][5] | [LineString][9] | [MultiLineString][6] | [Polygon][10] | [MultiPolygon][7])>** clipped Feature
Returns **([Feature][1] | [FeatureCollection][3])** clipped GeoJSON object.

[1]: https://tools.ietf.org/html/rfc7946#section-3.2

Expand All @@ -40,15 +40,7 @@ Returns **[Feature][1]<([Point][8] | [MultiPoint][5] | [LineString][9] | [MultiL

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[11]: https://tools.ietf.org/html/rfc7946#section-5
[7]: https://tools.ietf.org/html/rfc7946#section-5

<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->

Expand Down

0 comments on commit 001a56e

Please sign in to comment.