AshGeo: Tools for using Geo, Topo and PostGIS

\ ឵឵឵
2023-06-02

\ ឵឵឵:

I’ve noticed some chatter on here from folks working with geospatial, and decided to pull something out from under my umbrella: ash_geo .

It provides:

  • All the st_* functions that you would get with Geo.PostGIS for use with Ash expr , and more to come
  • An Ash.Type backed by each of Geo.JSON , Geo.WKB and Geo.WKT which may be used as argument types in your Ash actions, and will automatically cast input from GeoJSON, WKT and WKB encodings
  • An Ash.Type for Geo.PostGIS.Geometry , for use with resource attributes
  • All types may be overridden and narrowed with use , allowing you to add stricter constraints and storage types (e.g. geometry(Point,26918) ).
  • Validations for Geo types (such as is_point_zm(:arg) for checking that argument :arg is a instance of Geo.PointZM )
  • Validations backed by Topo , allowing checks of simple constraints such as contains? without needing to hit the database

v0.1.0 is released on Hex. Ideas and thoughts welcome! Feel free to open issues/PRs and to reply to this thread 🙂

Much love to the Ash community ♥️

Hoping it comes in handy.

https://github.com/bcksl/ash_geo

zachdaniel:

woah

zachdaniel:

This is awesome!

zachdaniel:

Going to show this to the team ❤️

zachdaniel:

Very excited about this, may get used on a project soon 😄

\ ឵឵឵:

Awesome, glad to hear it mate!

\ ឵឵឵:

The CI workflow might look a little bit familiar 😇