Helper functions for converting JTS geometries to and from various geospatial IO formats (geojson, wkt, wkb).
Helper functions for converting JTS geometries to and from various geospatial IO formats (geojson, wkt, wkb).
(parse-geojson geojson)
Parse a geojson using GeoJSONFactory's create
Parse a geojson using GeoJSONFactory's create
(read-geojson geojson)
(read-geojson geojson srid)
Parse a GeoJSON string into a sequence of maps representing GeoJSON "Features".
These will contain a :geometry key containing a JTS geometry and a :features key containing a (possibly empty) map of features.
(read-geojson "{"type":"Polygon","coordinates":[[[-70.0024,30.0019],[-70.0024,30.0016],[-70.0017,30.0016],[-70.0017,30.0019],[-70.0024,30.0019]]]}") => [{:properties {}, :geometry #object[org.locationtech.jts.geom.Polygon(...)]}]
(read-geojson "{"type":"Feature","geometry":{"type":"Point","coordinates":[0.0,0.0]},"properties":{"name":"null island"}}") => [{:properties {:name "null island"} :geometry #object[org.locationtech.jts.geom.Point(...)]}]
(read-geojson "{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[0.0,0.0]},"properties":{"name":"null island"}}]}") => [{:properties {:name "null island"}, :geometry #object[org.locationtech.jts.geom.Point(...)]}]
Parse a GeoJSON string into a sequence of maps representing GeoJSON "Features". These will contain a :geometry key containing a JTS geometry and a :features key containing a (possibly empty) map of features. (read-geojson "{\"type\":\"Polygon\",\"coordinates\":[[[-70.0024,30.0019],[-70.0024,30.0016],[-70.0017,30.0016],[-70.0017,30.0019],[-70.0024,30.0019]]]}") => [{:properties {}, :geometry #object[org.locationtech.jts.geom.Polygon(...)]}] (read-geojson "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[0.0,0.0]},\"properties\":{\"name\":\"null island\"}}") => [{:properties {:name "null island"} :geometry #object[org.locationtech.jts.geom.Point(...)]}] (read-geojson "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[0.0,0.0]},\"properties\":{\"name\":\"null island\"}}]}") => [{:properties {:name "null island"}, :geometry #object[org.locationtech.jts.geom.Point(...)]}]
(read-geojson-geometry geojson)
(read-geojson-geometry geojson srid)
Parse a GeoJSON string representing a single Geometry into a JTS Geometry.
Parse a GeoJSON string representing a single Geometry into a JTS Geometry.
(read-wkb bytes)
(read-wkb bytes srid)
Read a WKB byte array and convert to a Geometry. Can optionally pass in SRID. Defaults to WGS84
Read a WKB byte array and convert to a Geometry. Can optionally pass in SRID. Defaults to WGS84
(read-wkb-hex s)
(read-wkb-hex s srid)
Read a WKB hex string and convert to a Geometry
Read a WKB hex string and convert to a Geometry
(read-wkt wkt)
(read-wkt wkt srid)
Read a WKT string and convert to a Geometry. Can optionally pass in SRID. Defaults to WGS84
Read a WKT string and convert to a Geometry. Can optionally pass in SRID. Defaults to WGS84
(to-ewkb-hex shapelike)
Write an EWKB as a hex string, excluding any SRID
Write an EWKB as a hex string, excluding any SRID
(to-wkb shapelike)
Write a WKB, excluding any SRID
Write a WKB, excluding any SRID
(to-wkb-hex shapelike)
Write a WKB as a hex string, excluding any SRID
Write a WKB as a hex string, excluding any SRID
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close