JuliaGeo / LibGEOS.jl

Julia package for manipulation and analysis of planar geometric objects
MIT License
72 stars 24 forks source link

equals gotcha #152

Open jw3126 opened 1 year ago

jw3126 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.