Skip to content

Instantly share code, notes, and snippets.

@hc2p
Last active August 8, 2017 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hc2p/fa9bbd632bcd0de818f99b8a8b3c4183 to your computer and use it in GitHub Desktop.
Save hc2p/fa9bbd632bcd0de818f99b8a8b3c4183 to your computer and use it in GitHub Desktop.
Schema for a Geo JSON feature object
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://json-schema.org/geojson/geojson.json#",
"title": "Geo JSON Feature object",
"description": "Schema for a Geo JSON feature object",
"required": [
"geometry",
"properties"
],
"properties": {
"type": {
"enum": [
"Feature"
]
},
"geometry": {
"$ref": "#/definitions/point.json#"
},
"properties": {
"type": "object",
"oneOf": [
{ "$ref": "http://json-schema.org/geojson/car_service" },
{ "$ref": "http://json-schema.org/geojson/filling_station" },
{ "$ref": "http://json-schema.org/geojson/parking_facility" }
]
},
"id": {
"type": "string"
}
},
"definitions": {
"point": {
"type": "object",
"required": [
"type",
"coordinates"
],
"properties": {
"type": {
"enum": [
"Point"
]
},
"coordinates": {
"$ref": "#/definitions/position"
}
}
},
"position": {
"description": "A single position",
"type": "array",
"minItems": 2,
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment