Liking cljdoc? Tell your friends :D

geo.io

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).
raw docstring

feature-listclj

(feature-list features)
source

GeoJSONFeaturescljprotocol

to-featuresclj

(to-features this)
source

GeoJSONGeometrycljprotocol

read-geometryclj

(read-geometry this)
source

parse-geojsonclj

(parse-geojson geojson)

Parse a geojson using GeoJSONFactory's create

Parse a geojson using GeoJSONFactory's create
sourceraw docstring

propertiesclj

(properties feature)
source

read-geojsonclj

(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(...)]}]
sourceraw docstring

read-geojson-geometryclj

(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.
sourceraw docstring

read-wkbclj

(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
sourceraw docstring

read-wkb-hexclj

(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
sourceraw docstring

read-wktclj

(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
sourceraw docstring

to-ewkbclj

(to-ewkb shapelike)
source

to-ewkb-hexclj

(to-ewkb-hex shapelike)

Write an EWKB as a hex string, including any SRID

Write an EWKB as a hex string, including any SRID
sourceraw docstring

to-geojsonclj

(to-geojson shapelike)
source

to-geojson-featureclj

(to-geojson-feature feature-map)
source

to-geojson-feature-collectionclj

(to-geojson-feature-collection feature-maps)
source

to-wkbclj

(to-wkb shapelike)

Write a WKB, excluding any SRID

Write a WKB, excluding any SRID
sourceraw docstring

to-wkb-hexclj

(to-wkb-hex shapelike)

Write a WKB as a hex string, excluding any SRID

Write a WKB as a hex string, excluding any SRID
sourceraw docstring

to-wktclj

(to-wkt shapelike)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close