Skip to content

Conversation

shaungehring-RV
Copy link

Added the ability to iterate through shape records and only return records where a lat/lon point is in the polygon. This can be used to pinpoint a block someone is in just from their current point

@JamesParrott
Copy link
Collaborator

JamesParrott commented Jul 25, 2025

Hi Shaun, sorry nobody's replied to your PR in 3 years!

This is a nice feature, but it needs shapely, where as currently PyShp is a pure Python library. Is it possible to find a pure Python implementation for this test:? if pnt is not None and not (Polygon(record.points).contains(Point(pnt))):

It's great you've added a test too, but the condition inside it is the same as above: if Polygon(shape.points).contains(Point(pnt)):
Is there an alternative source of truth to test the implementation against (i.e. instead of essentially running the same code twice)?

I'll think about adding an optional dependency on Shapely if there's (still) interest.

Thanks,

James.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants