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

Option available for geographic #820

Closed
mali151298 opened this issue Feb 10, 2023 · 5 comments
Closed

Option available for geographic #820

mali151298 opened this issue Feb 10, 2023 · 5 comments

Comments

@mali151298
Copy link

There are two type of geometry available.

  1. Cartesian
  2. Geographic

Geos all algorithm like buffer, union act as a Cartesian geometry, Any options available to convert cartesion to geographic geometry type likes(boost::geometry) into geos library?

@pramsey
Copy link
Member

pramsey commented Feb 10, 2023

Nope. See https://github.com/google/s2geometry

@pramsey pramsey closed this as completed Feb 10, 2023
@mali151298
Copy link
Author

Thanks for your reply.

@jorisvandenbossche
Copy link
Contributor

And if you would be interested in a GEOS-like C API on top of s2geometry, https://github.com/paleolimbot/s2geography/ might be interesting (it's extracted from the R s2 bindings, to be more generally usable outside of R)

@roya0045
Copy link

Nope. See https://github.com/google/s2geometry

I'm looking into this to scope things out and I was curious to know if https://github.com/libgeos/geos/blob/main/src/operation/buffer/OffsetSegmentGenerator.cpp could be modified to pass on a flag that would modify how the points are generated.

For instance using https://geographiclib.sourceforge.io/Python/doc/code.html#geographiclib.geodesic.Geodesic.Direct would require a conversion in lat long, which seems to be out of scope and would add more dependencies, but would provide the needed result. It might be easier to make a separate buffer generator from scratch than trying to fit that option in geos.

@pramsey
Copy link
Member

pramsey commented May 26, 2023

The simplest way to coerce the existing code into doing correct geographics it to push everything into Gnomonic before calculating new vertices. This will work fine for constrained areas but naturally fall apart for larger areas. You can try that yourself just by conditioning your inputs and see if you like the result.

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

4 participants