pelias / polygon-lookup

Fast point-in-polygon intersection for large numbers of polygons.
72 stars 17 forks source link

include feature id in results where MultiPolygon #50

Open andrewharvey opened 3 years ago

andrewharvey commented 3 years ago

:wave: I did some awesome work for the Pelias project and would love for everyone to have a look at it and provide feedback.


Here's the reason for this change :rocket:

lookup.search where the Feature was a Polygon, returns the GeoJSON exactly as supplied including an id field, however that was broken when the Feature was a MultiPolygon.


Here's what actually got changed :clap:

where the indexed feature had an id, then include it is the search result.


Here's how others can test the changes :eyes:

I first updated the unit test based on what should work, found it failed the test, then fixed the code, then found it passed.