yeesian / ArchGDAL.jl

A high level API for GDAL - Geospatial Data Abstraction Library
https://yeesian.github.io/ArchGDAL.jl/stable/
Other
142 stars 26 forks source link

Clarify geometry equality #306

Closed rafaqz closed 2 years ago

rafaqz commented 2 years ago

This should return true?

julia> ArchGDAL.createpoint(1.0, 2.0) == ArchGDAL.createpoint(1.0, 2.0)
false

And === should be false ?

Currently Base is just comparing if the pointers to the gdal points are the same:

julia> @which ArchGDAL.createpoint(1.0, 2.0) == ArchGDAL.createpoint(1.0, 2.0)
==(x, y) in Base at Base.jl:119

We could add a == method to compare the contents of the pointers.

visr commented 2 years ago

I think it would indeed be nice if == would return true there. It looks like we could just forward Base.== to the ArchGDAL.equals method (ogr_g_equals)? GeoInterface.equals also forwards there.