Current File : /home/jvzmxxx/wiki1/extensions/Kartographer/schemas/geojson.json
{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"id": "http://json-schema.org/geojson/geojson.json#",
	"type": "array",
	"items": { "$ref": "#/definitions/root" },

	"definitions": {
		"root": {
			"title": "Geo JSON object",
			"description": "Schema for a Geo JSON object",
			"type": "object",
			"required": [ "type" ],
			"properties": {
				"crs": { "$ref": "#/definitions/crs" },
				"bbox": { "$ref": "#/definitions/bbox" }
			},
			"oneOf": [
				{ "$ref": "#/definitions/geometry" },
				{ "$ref": "#/definitions/feature" },
				{ "$ref": "#/definitions/featureCollection" },
				{ "$ref": "#/definitions/externalData" }
			]
		},

		"crs": {
			"title": "crs",
			"description": "a Coordinate Reference System object",
			"type": [ "object", "null" ],
			"required": [ "type", "properties" ],
			"properties": {
				"type": { "type": "string" },
				"properties": { "type": "object" }
			},
			"additionalProperties": false,
			"oneOf": [
				{ "$ref": "#/definitions/namedCrs" },
				{ "$ref": "#/definitions/linkedCrs" }
			]
		},

		"bbox": {
			"description": "A bounding box as defined by GeoJSON",
			"FIXME": "unenforceable constraint: even number of elements in array",
			"type": "array",
			"items": { "type": "number" }
		},

		"geometry": {
			"title": "geometry",
			"description": "One geometry as defined by GeoJSON",
			"type": "object",
			"required": [ "type" ],
			"oneOf": [
				{ "$ref": "#/definitions/primitiveGeometry" },
				{ "$ref": "#/definitions/geometryCollection" }
			]
		},
		"primitiveGeometry": {
			"title": "primitiveGeometry",
			"description": "All the non-collection Geometry types",
			"type": "object",
			"required": [ "coordinates" ],
			"oneOf": [
				{
					"title": "Point",
					"properties": {
						"type": { "enum": [ "Point" ] },
						"coordinates": { "$ref": "#/definitions/position" }
					}
				},
				{
					"title": "MultiPoint",
					"properties": {
						"type": { "enum": [ "MultiPoint" ] },
						"coordinates": { "$ref": "#/definitions/positionArray" }
					}
				},
				{
					"title": "LineString",
					"properties": {
						"type": { "enum": [ "LineString" ] },
						"coordinates": { "$ref": "#/definitions/lineString" }
					}
				},
				{
					"title": "MultiLineString",
					"properties": {
						"type": { "enum": [ "MultiLineString" ] },
						"coordinates": {
							"type": "array",
							"items": { "$ref": "#/definitions/lineString" }
						}
					}
				},
				{
					"title": "Polygon",
					"properties": {
						"type": { "enum": [ "Polygon" ] },
						"coordinates": { "$ref": "#/definitions/polygon" }
					}
				},
				{
					"title": "MultiPolygon",
					"properties": {
						"type": { "enum": [ "MultiPolygon" ] },
						"coordinates": {
							"type": "array",
							"items": { "$ref": "#/definitions/polygon" }
						}
					}
				}
			]
		},

		"geometryCollection": {
			"title": "GeometryCollection",
			"description": "A collection of geometry objects",
			"required": [ "geometries" ],
			"properties": {
				"type": { "enum": [ "GeometryCollection" ] },
				"geometries": {
					"type": "array",
					"items": { "$ref": "#/definitions/geometry" }
				}
			}
		},
		"feature": {
			"title": "Feature",
			"description": "A Geo JSON feature object",
			"required": [ "geometry" ],
			"properties": {
				"type": { "enum": [ "Feature" ] },
				"geometry": {
					"oneOf": [
						{ "type": "null" },
						{ "$ref": "#/definitions/geometry" }
					]
				},
				"properties": { "$ref": "#/definitions/simplestyle" },
				"id": {"type": [ "string", "number" ]}
			}
		},
		"featureCollection": {
			"title": "FeatureCollection",
			"description": "A Geo JSON feature collection",
			"required": [ "features" ],
			"properties": {
				"type": { "enum": [ "FeatureCollection" ] },
				"features": {
					"type": "array",
					"items": { "$ref": "#/definitions/feature" }
				}
			}
		},
		"externalData": {
			"title": "ExternalData",
			"description": "WMF extension - reference to external geometries",
			"required": [ "type", "service" ],

			"oneOf": [
				{
					"required": [ "title" ],
					"properties": {
						"service": { "enum": [ "page" ] },
						"title": { "type": "string" }
					}
				},
				{
					"anyOf": [
						{ "required": [ "query" ] },
						{ "required": [ "ids" ] }
					],
					"properties": {
						"service": { "enum": [ "geoshape", "geoline", "geomask" ] },
						"query": { "type": "string" },
						"ids": {
							"oneOf": [
								{
									"type": "array",
									"items": {
										"type": "string",
										"pattern": "^Q[1-9]\\d{0,19}$"
									}
								},
								{
									"type": "string",
									"pattern": "^Q[1-9]\\d{0,19}(\\s*,\\s*Q[1-9]\\d{0,19})*$"
								}
							]
						}
					}
				}
			],

			"properties": {
				"type": { "enum": [ "ExternalData" ] },
				"service": { "type": "string" },
				"properties": { "$ref": "#/definitions/simplestyle" }
			}
		},

		"position": {
			"description": "A single position",
			"type": "array",
			"minItems": 2,
			"items": { "type": "number" }
		},
		"positionArray": {
			"description": "An array of positions",
			"type": "array",
			"items": { "$ref": "#/definitions/position" }
		},
		"lineString": {
			"description": "An array of two or more positions",
			"allOf": [
				{ "$ref": "#/definitions/positionArray" },
				{ "minItems": 2 }
			]
		},
		"linearRing": {
			"description": "An array of four positions where the first equals the last",
			"allOf": [
				{ "$ref": "#/definitions/positionArray" },
				{ "minItems": 4 }
			]
		},
		"polygon": {
			"description": "An array of linear rings",
			"type": "array",
			"items": { "$ref": "#/definitions/linearRing" }
		},

		"namedCrs": {
			"properties": {
				"type": { "enum": [ "name" ] },
				"properties": {
					"required": [ "name" ],
					"additionalProperties": false,
					"properties": {
						"name": {
							"type": "string",
							"FIXME": "semantic validation necessary"
						}
					}
				}
			}
		},
		"linkedObject": {
			"type": "object",
			"required": [ "href" ],
			"properties": {
				"href": {
					"type": "string",
					"format": "uri",
					"FIXME": "spec says \"dereferenceable\", cannot enforce that"
				},
				"type": {
					"type": "string",
					"description": "Suggested values: proj4, ogjwkt, esriwkt"
				}
			}
		},
		"linkedCrs": {
			"properties": {
				"type": { "enum": [ "link" ] },
				"properties": { "$ref": "#/definitions/linkedObject" }
			}
		},

		"simplestyle": {
			"type": "object",
			"properties": {
				"title": { "type": "string" },
				"description": { "type": "string" },
				"marker-size": { "enum": ["small", "medium", "large"] },
				"marker-symbol": { "type": "string", "pattern": "^(|[0-9]|[a-z-]+)$" },
				"marker-color": { "$ref": "#/definitions/color" },
				"stroke": { "$ref": "#/definitions/color" },
				"stroke-opacity": { "$ref": "#/definitions/opacity" },
				"stroke-width": { "type": "number", "minimum": 0 },
				"fill": { "$ref": "#/definitions/color" },
				"fill-opacity": { "$ref": "#/definitions/opacity" }
			}
		},
		"color": {
			"type": "string",
			"pattern": "^#?([0-9a-fA-F]{3}){1,2}$"
		},
		"opacity": {
			"type": "number",
			"minimum": 0,
			"maximum": 1
		}
	}
}