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

Is there a need to standardize geom and geometry across ecosystem #164

Open
alex-s-gardner opened this issue Sep 25, 2024 · 6 comments
Open

Comments

@alex-s-gardner
Copy link
Contributor

I'm finding geom and geometry used interchangeably but this creates some conflicts across package. It seems like some guidance might be needed:

Documenting some of what I've noticed:

@evetion uses geom in GeoDataFrames which then can not be passed directly to @rafaqz Raster.rasterize

@asinghvi17 also uses geom in GeometryOps

GeoInterface has a GeometryCollection but a function call that is getgeom

Shapefile creates a geometry column

@rafaqz
Copy link
Member

rafaqz commented Sep 25, 2024

We have GI.geometrycolumns to clarify these in many cases. GeometryOps should use it everywhere, we don't use :geom ? except in one tutorial because GADM.jl did.

:geometry is the standard fallback for GI.geometrycolumns

@evetion I noticed this the other day too, is there a reason to still use :geom in GeoDataFrames?

Also GADM.jl recently fixed their :geom column to :geometry: JuliaGeo/GADM.jl#69

@asinghvi17
Copy link
Member

Using :geom for geometry columns started because that was how ArchGDAL returned it, I think. Users might expect it now though? I'm not sure how that should be handled.

@rafaqz
Copy link
Member

rafaqz commented Sep 25, 2024

We should as much as possible standardise table columns, it's worth the long term simplicity

@alex-s-gardner
Copy link
Contributor Author

alex-s-gardner commented Sep 25, 2024

Understanding that GI.geometrycolumns is being implemented making this less of an issue:

e.g.
which one if I'm package blind?

GeometryOps.intersects.(geomA[:, :geometry], geomB[:, :geom])
GeometryOps.intersects.(geomA[:, :geo], geomB[:, :geometry])
GeometryOps.intersects.(geomA[:, :geometry], geomB[:, :geometry])
GeometryOps.intersects.(geomA[:, :geom], geomB[:, :geom])

or just

GeometryOps.intersects.(geomA[:, :geometry], geomB[:, :geometry])

@asinghvi17
Copy link
Member

asinghvi17 commented Sep 25, 2024

GeometryOps.intersects.(geomA[:, first(GI.geometrycolumns(geomA))], geomB[:, first(GI.geometrycolumns(geomB))]) is the "correct" solution at this point but it's a mouthful. If you aren't using GeoDataFrames/ArchGDAL at all for vector features, then :geometry is your best bet.

@rafaqz
Copy link
Member

rafaqz commented Sep 25, 2024

Yeah... good demonstratiion that first(GI.geometrycolumns(geomA)) is waay too long to actually use

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

3 participants