GeoData in Elixir?

I had a search whether Elixir is able to work with geodata? I currently think, it does not work.

I think mainly about three topics:

  • DB: spartiallite for sqlite, postgis for postgresql
  • vector data: as shape, geopackage, geojson
  • raster data: as geotiff

Perhaps also interesting is whether someone is using web services as wfs, or wms, etc.

Regards.

There’s the geo and geo_postgis libraries, which cover many of the things you mentioned. They were recently taken over by the team behind felt, which I guess should be a great showcase for what you can do with elixir and geodata. Never heared of spartiallite before though. Not sure if there’s existing tooling around that.

3 Likes

Okay, geo seams to be able to decode. The felt website also shows, the usecase of working with shape files.

But I haven’t found the the function to open shape files. The geo package shows encoding, decoding of geojson. But it seams to be possible, or does felt use another stack/programming language? Normally I use geopandas in python, or QGIS for watching the files.
Is there a blog or combined reference/resource for geodata projects?

I have successfully read some shape files using ExShape. It doesn’t work for all shapefiles. For shapefiles where it doesn’t work, I use mapshaper.org to convert the shapefile to geojson, then parse it with Geo.JSON

Usually I load Shapefiles into PostGIS orchestrated by my Elixir app by running shp2pgsql using System.cmd to load the data into PostgreSQL then use it from there. If I need to access the data later in Elixir I would use geo_postgis and Ecto. Or you can use QGIS or hook up a wms/wfs/tile server directly to PostGIS… PostGIS in Action, 3rd ed is a great book on those topics.

Or if you don’t want to store the data in PostGIS you can use ogr2ogr to convert your Shapefiles into GeoJSON then load into Elixir. Or use it to convert to dozens of other formats you mentioned such as Spatialite, GeoPackage, etc. If dealing with rasters I would use the GDAL tools.