Skip to content

Libraries and utilities for using GeoJSON in Clojure.

Notifications You must be signed in to change notification settings

geographist/geojson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoJSON

Clojure utilities for using GeoJSON.

Installation

Add the following dependency to your project.clj:

[com.farmlogs/geojson "1.1.0"]

Usage

This library's utilities act on clojure maps structured as GeoJSON.

The validation namespace verifies that a given GeoJSON is valid, following the details of the geojson spec.

(require '[geojson.validate :as gv])

(gv/valid? {:type "Point" :coordinates [0 0]})
(gv/valid? {:type "Feature"
            :properties {:name "Null Island"}
            :geometry {:type "Point" :coordinates [0 0]}})
(gv/valid? {:type "GeometryCollection"
            :geometries [{:type "Point" :coordinates [0 0]}
                         {:type "Polygon" :coordinates [[[0 0] [0 1] [1 1] [1 0] [0 0]]]}
                         {:type "LineString" :coordinates [[0 0] [1 1] [1 2]]}]})

About

Libraries and utilities for using GeoJSON in Clojure.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 100.0%