Geo.JSON

Converts to and from GeoJSON

json = "{ "type": "Point", "coordinates": [100.0, 0.0] }"
geom = Geo.JSON.decode(json)
Geo.Geometry[type: :point, coordinates: [100.0, 0.0], srid: nil]

Geo.JSON.encode(geom)
"{ "type": "Point", "coordinates": [100.0, 0.0] }"
Source

Summary

decode(geo_json)

Takes a GeoJSON string and returns a Geo.Geometry struct or list of Geo.Geometry

encode(geom)

Takes a Geo.Geometry struct or a list of Geo.Geometry and returns a geoJSON string

Functions

decode(geo_json)

Takes a GeoJSON string and returns a Geo.Geometry struct or list of Geo.Geometry

Source
encode(geom)

Takes a Geo.Geometry struct or a list of Geo.Geometry and returns a geoJSON string

Source