https://github.com/losinggeneration/geojson
Implementation of the GeoJSON spec for Go
https://github.com/losinggeneration/geojson
geojson go golang
Last synced: 12 months ago
JSON representation
Implementation of the GeoJSON spec for Go
- Host: GitHub
- URL: https://github.com/losinggeneration/geojson
- Owner: losinggeneration
- License: other
- Created: 2016-06-19T13:00:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-27T00:13:20.000Z (almost 10 years ago)
- Last Synced: 2025-01-17T02:08:45.803Z (over 1 year ago)
- Topics: geojson, go, golang
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
geojson
=======
[](https://app.wercker.com/project/bykey/f88b804269b197c17ad2ed5894e0c715)
[](https://coveralls.io/github/losinggeneration/geojson?branch=master)
[](https://godoc.org/github.com/losinggeneration/geojson)
[](https://github.com/losinggeneration/geojson/blob/master/COPYING)
GeoJSON is a Go library that implements the GeoJSON 1.0 spec.
### About
This library should make it straight forward to Marshal & Unmarshal GeoJSON
objects in Go. For example, this library will try to keep the Type properly
set for GeoJSON Objects as defined in the spec during JSON Marshalling. In
other words, a user doesn't need to explicitly set the Typet field.
### Example
GeoJSON{
Feature: &Feature{
ID: "MyFeature",
Geometry: &Geometry{
Point: &Point{
Coordinates: Positions{10, 10},
},
},
Properties: Properties{
"prop1": "A property",
"prop2": "A very palpable property",
},
},
}
would marshal into the following JSON:
{
"type": "Feature",
"id": "MyFeature",
"geometry": {
"type": "Point",
"coordinates": [10, 10]
},
"properties": {
"prop1": "A property",
"prop2": "A very palpable property"
}
}
### TODO
* Tests for all each struct's to marshal & unmarshal to the spec