question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Support for FeatureCollection<MultiPoint> to first parameter of pointsWithinPolygon

See original GitHub issue
  • [version 5.1.6 and 6.3.0]
const geojson = turf.featureCollection([
  turf.multiPoint([
    [10, 10],
    [-10, -10]
  ])
]);

const polygon = turf.polygon([[
  [0, 0],
  [15, 0],
  [15, 15],
  [0, 15],
  [0,0]
]]);

turf.pointsWithinPolygon(geojson, polygon);

> "Error: coord must be GeoJSON Point or an Array of numbers"

Thanks for the awesome library.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
twelchcommented, Jul 7, 2021

This landed in master, not yet published

1reaction
justinbangertercommented, Jun 28, 2021

Great. Yeah, I think that, if option 2 were implemented, it would not help me accomplish what I wanted to accomplish, which is: find the count of points in the polygon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turf.js pointsWithinPolygon works for Polygon but not ...
I am trying to use Turf.js to find all points within a bounding box for a FeatureCollection. According to the documentation, you can...
Read more >
How To: Count the number of point features within a polygon ...
This workflow explains the steps to determine the number of earthquakes that have occurred in the polygon that represents Indonesia. Procedure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found