diff --git a/packages/turf-points-within-polygon/README.md b/packages/turf-points-within-polygon/README.md index dbefbb8cc8..eb5c5eb1d3 100644 --- a/packages/turf-points-within-polygon/README.md +++ b/packages/turf-points-within-polygon/README.md @@ -4,12 +4,12 @@ ## pointsWithinPolygon -Takes a set of [points](http://geojson.org/geojson-spec.html#point) and a set of [polygons](http://geojson.org/geojson-spec.html#polygon) and returns the points that fall within the polygons. +Takes a set of [points](http://geojson.org/geojson-spec.html#point) and a set of [polygons](http://geojson.org/geojson-spec.html#polygon) or [multi polygons](http://geojson.org/geojson-spec.html#multipolygon) and returns the points that fall within the polygons. **Parameters** - `points` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** input points -- `polygons` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Polygon](http://geojson.org/geojson-spec.html#polygon)>** input polygons +- `polygons` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<([Polygon](http://geojson.org/geojson-spec.html#polygon) \| [MultiPolygon](http://geojson.org/geojson-spec.html#multipolygon))>** input polygons **Examples** diff --git a/packages/turf-points-within-polygon/index.d.ts b/packages/turf-points-within-polygon/index.d.ts index 87bda4cbad..929e242656 100644 --- a/packages/turf-points-within-polygon/index.d.ts +++ b/packages/turf-points-within-polygon/index.d.ts @@ -1,9 +1,9 @@ -import { FeatureCollection, Polygon, Point } from '@turf/helpers' +import { FeatureCollection, Polygon, MultiPolygon, Point } from '@turf/helpers' /** * http://turfjs.org/docs/#pointswithinpolygon */ export default function pointsWithinPolygon( points: FeatureCollection, - polygons: FeatureCollection + polygons: FeatureCollection ): FeatureCollection; diff --git a/packages/turf-points-within-polygon/index.js b/packages/turf-points-within-polygon/index.js index 41f2ceb35a..49fefc1fa2 100644 --- a/packages/turf-points-within-polygon/index.js +++ b/packages/turf-points-within-polygon/index.js @@ -2,11 +2,11 @@ import booleanPointInPolygon from '@turf/boolean-point-in-polygon'; import { featureCollection } from '@turf/helpers'; /** - * Takes a set of {@link Point|points} and a set of {@link Polygon|polygons} and returns the points that fall within the polygons. + * Takes a set of {@link Points} and a set of {@link (Multi)Polygons} and returns the points that fall within the polygons. * * @name pointsWithinPolygon * @param {FeatureCollection} points input points - * @param {FeatureCollection} polygons input polygons + * @param {FeatureCollection} polygons input polygons * @returns {FeatureCollection} points that land within at least one polygon * @example * var searchWithin = turf.featureCollection([ diff --git a/scripts/generate-readmes b/scripts/generate-readmes index 20af201d13..32809a8924 100755 --- a/scripts/generate-readmes +++ b/scripts/generate-readmes @@ -13,11 +13,23 @@ const paths = { GeoJSON: 'http://geojson.org/geojson-spec.html#geojson-objects', GeometryCollection: 'http://geojson.org/geojson-spec.html#geometrycollection', Point: 'http://geojson.org/geojson-spec.html#point', + Points: 'http://geojson.org/geojson-spec.html#point', + '(Multi)Point': 'http://geojson.org/geojson-spec.html#point', + '(Multi)Points': 'http://geojson.org/geojson-spec.html#point', MultiPoint: 'http://geojson.org/geojson-spec.html#multipoint', + MultiPoints: 'http://geojson.org/geojson-spec.html#multipoint', LineString: 'http://geojson.org/geojson-spec.html#linestring', + LineStrings: 'http://geojson.org/geojson-spec.html#linestring', + '(Multi)LineString': 'http://geojson.org/geojson-spec.html#linestring', + '(Multi)LineStrings': 'http://geojson.org/geojson-spec.html#linestring', MultiLineString: 'http://geojson.org/geojson-spec.html#multilinestring', + MultiLineStrings: 'http://geojson.org/geojson-spec.html#multilinestring', Polygon: 'http://geojson.org/geojson-spec.html#polygon', + Polygons: 'http://geojson.org/geojson-spec.html#polygon', + '(Multi)Polygon': 'http://geojson.org/geojson-spec.html#polygon', + '(Multi)Polygons': 'http://geojson.org/geojson-spec.html#polygon', MultiPolygon: 'http://geojson.org/geojson-spec.html#multipolygon', + MultiPolygons: 'http://geojson.org/geojson-spec.html#multipolygon', Geometry: 'http://geojson.org/geojson-spec.html#geometry', Feature: 'http://geojson.org/geojson-spec.html#feature-objects', FeatureCollection: 'http://geojson.org/geojson-spec.html#feature-collection-objects'