Best way to define lat, lon -or- projected x,y points that play nicely with GeoInterface.jl

Is there a general standard for defining lat lon and projected points in the GeoJulia community such that they play nicely across packages? I looked through the GeoInterface.jl documentation but wasn’t able to locate that info. I’ve also seen how packages like Geodesy.jl but I’m wondering if there is a more formal standard (e.g. Type).

I think I found what I was looking for in ArchGDAL.jl createpoint(lon, lat)

A tuple(x, y) is an equally valid point to that ArchGDAL point, and much more efficient. X,Y,Z is the order of tuples. (X=x,Y=y) also works. GeometryBasics.Point2(x, y) is another.

1 Like

how does one then go about converting a list of points (e.g [(X=1,Y=-1), (X=2, Y=4)]) into a GeoInterface.jl type that will play nicely with libraries that use GeoInterface.jl (e.g. Leaflet.jl)… for whatever reason I’m finding this impossible to navigate.

Yes we are in the process of making this easier currently - using existing package types was the focus of our initial work.

Part of the problem is we havent fully fleshed out the Base objects that are designated geometries and features, like Vector{Tuple} is not MulitiPointTrait. Its not 100% clear that it should be.

Im currently writing a type wrappers addition to GeoInterface.jl to make this stuff easy, so this is good and timely feedback.

Another part is what packages accept. Leaflet.jl only accepts geometries, features and feature collections and doesnt know the Tables.jl interface yet. So a table with a :geometry column wont work either.

A hack that should work until there is something better is a Vector of NamedTuples with a :geometry field. Thats a valid GeoInterface.FeatureCollectionTrait object. You can also use the other NamedTuple fields as fearure properties for setting point properties.

1 Like