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

equals gotcha #152

Open
jw3126 opened this issue Dec 21, 2022 · 2 comments
Open

equals gotcha #152

jw3126 opened this issue Dec 21, 2022 · 2 comments

Comments

@jw3126
Copy link
Member

jw3126 commented Dec 21, 2022

It seems that equals checks if two geometries are equal in the 2D case. In the 3D case it seems that it just ignores the third coordinate and only checks if the 2D projections are equal.

julia> using LibGEOS

julia> equals(Point(1,2), Point(1,10000))
false

julia> equals(Point(1,2,3), Point(1,2,10000))
true
@visr
Copy link
Member

visr commented Dec 22, 2022

Yeah this can be confusing for sure. It is clearly intended however. The GEOS docs say:

True if geometries cover the same space on the place.

Though I think "place" should be "plane" there. (PR)

I think the best we can really do here is to document it properly.

@yeesian
Copy link
Member

yeesian commented Dec 23, 2022

I think the best we can really do here is to document it properly.

It might help to add that users looking to represent 3D-space in a geospatial setting should consider the use of https://github.com/JuliaGeo/Geodesy.jl or https://github.com/JuliaGeo/Proj.jl to project it into a locally euclidean space before using LibGEOS.jl for 2D spatial operations.

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

No branches or pull requests

3 participants