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

**URL:** <https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795>\
**Category:** Geo\
**Created:** [November 4, 2022, 11:03pm UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795 "2022-11-04T23:03:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-s-gardner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alex-s-gardner/32/30210_2.png) [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Post date:** [November 4, 2022, 11:03pm UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795/1 "2022-11-04T23:03:49Z")

</div>

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](https://github.com/JuliaGeo/Geodesy.jl/blob/master/src/points.jl) but I’m wondering if there is a more formal standard (e.g. Type).

---

<div class="post-metadata">

**Author:** ![alex-s-gardner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alex-s-gardner/32/30210_2.png) [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Post date:** [November 4, 2022, 11:50pm UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795/2 "2022-11-04T23:50:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [November 5, 2022, 2:18am UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795/3 "2022-11-05T02:18:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alex-s-gardner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alex-s-gardner/32/30210_2.png) [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Post date:** [December 20, 2022, 5:17am UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795/4 "2022-12-20T05:17:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [December 20, 2022, 10:04am UTC](https://discourse.julialang.org/t/best-way-to-define-lat-lon-or-projected-x-y-points-that-play-nicely-with-geointerface-jl/89795/5 "2022-12-20T10:04:52Z")

</div>

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.
