Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polygon doesn't implement PointDistance (but LineString does) #1267

Open
lnicola opened this issue Nov 10, 2024 · 2 comments
Open

Polygon doesn't implement PointDistance (but LineString does) #1267

lnicola opened this issue Nov 10, 2024 · 2 comments

Comments

@lnicola
Copy link
Member

lnicola commented Nov 10, 2024

I guess this explains why I never understood how to use rstar...

@urschrei
Copy link
Member

This needs point-in-polygon. See #984 (comment) for why this isn't easy: in short, a robust point-in-polygon implementation requires quite a lot of supporting code. We (obviously) have all of that in geo, and can't use it for geo-types because that would create a circular dependency. The alternative is copy-and-pasting everything that's required into private_utils.rs, which is not maintainable.

In short: #984 (comment) is still the most sensible approach, except that it causes a lot of other problems.

@lnicola
Copy link
Member Author

lnicola commented Nov 11, 2024

I guess a future rewrite of geo based on geo-traits will solve this?

That said, maybe geo should lose the geo-types dependency? I think it's used in a couple of different ways:

  • trait definitions (CoordNum)
  • complex types returned by some algorithms (minimum_rotated_rect returns Polygon)
  • "primitive" types used by some algorithms (Line, Point, Triangle)
  • tests
  • PreparedGeometry construction
  • anything else?

So should geo even use Polygon or expose Polygon in its implementation or public API?

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

No branches or pull requests

2 participants