geojson.json 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "http://json-schema.org/geojson/geojson.json#",
  4. "title": "Geo JSON object",
  5. "description": "Schema for a Geo JSON object",
  6. "type": "object",
  7. "required": [ "type" ],
  8. "properties": {
  9. "crs": { "$ref": "http://json-schema.org/geojson/crs.json#" },
  10. "bbox": { "$ref": "http://json-schema.org/geojson/bbox.json#" }
  11. },
  12. "oneOf": [
  13. { "$ref": "http://json-schema.org/geojson/geometry.json#" },
  14. { "$ref": "#/definitions/geometryCollection" },
  15. { "$ref": "#/definitions/feature" },
  16. { "$ref": "#/definitions/featureCollection" }
  17. ],
  18. "definitions": {
  19. "geometryCollection": {
  20. "title": "GeometryCollection",
  21. "description": "A collection of geometry objects",
  22. "required": [ "geometries" ],
  23. "properties": {
  24. "type": { "enum": [ "GeometryCollection" ] },
  25. "geometries": {
  26. "type": "array",
  27. "items": { "$ref": "http://json-schema.org/geojson/geometry.json#" }
  28. }
  29. }
  30. },
  31. "feature": {
  32. "title": "Feature",
  33. "description": "A Geo JSON feature object",
  34. "required": [ "geometry", "properties" ],
  35. "properties": {
  36. "type": { "enum": [ "Feature" ] },
  37. "geometry": {
  38. "oneOf": [
  39. { "type": "null" },
  40. { "$ref": "http://json-schema.org/geojson/geometry.json#" }
  41. ]
  42. },
  43. "properties": { "type": [ "object", "null" ] },
  44. "id": { "FIXME": "may be there, type not known (string? number?)" }
  45. }
  46. },
  47. "featureCollection": {
  48. "title": "FeatureCollection",
  49. "description": "A Geo JSON feature collection",
  50. "required": [ "features" ],
  51. "properties": {
  52. "type": { "enum": [ "FeatureCollection" ] },
  53. "features": {
  54. "type": "array",
  55. "items": { "$ref": "#/definitions/feature" }
  56. }
  57. }
  58. }
  59. }
  60. }