forked from radiantearth/stac-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeojson.json
353 lines (325 loc) · 13.4 KB
/
geojson.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "geojson.json#",
"title": "GeoJSON Object",
"type": "object",
"description":
"This object represents a geometry, feature, or collection of features.",
"additionalProperties": true,
"required": ["type"],
"properties": {
"type": {
"title": "Type",
"type": "string",
"description": "The type of GeoJSON object.",
"enum": [
"Point",
"MultiPoint",
"LineString",
"MultiLineString",
"Polygon",
"MultiPolygon",
"GeometryCollection",
"Feature",
"FeatureCollection"
]
},
"crs": {
"title": "Coordinate Reference System (CRS)",
"description":
"The coordinate reference system (CRS) of a GeoJSON object is determined by its `crs` member (referred to as the CRS object below). If an object has no crs member, then its parent or grandparent object's crs member may be acquired. If no crs member can be so acquired, the default CRS shall apply to the GeoJSON object.\n\n* The default CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees.\n\n* The value of a member named `crs` must be a JSON object (referred to as the CRS object below) or JSON null. If the value of CRS is null, no CRS can be assumed.\n\n* The crs member should be on the top-level GeoJSON object in a hierarchy (in feature collection, feature, geometry order) and should not be repeated or overridden on children or grandchildren of the object.\n\n* A non-null CRS object has two mandatory members: `type` and `properties`.\n\n* The value of the type member must be a string, indicating the type of CRS object.\n\n* The value of the properties member must be an object.\n\n* CRS shall not change coordinate ordering.",
"oneOf": [
{ "type": "null" },
{
"type": "object",
"required": ["type", "properties"],
"properties": {
"type": {
"title": "CRS Type",
"type": "string",
"description":
"The value of the type member must be a string, indicating the type of CRS object.",
"minLength": 1
},
"properties": {
"title": "CRS Properties",
"type": "object"
}
}
}
],
"not": {
"anyOf": [
{
"properties": {
"type": { "enum": ["name"] },
"properties": {
"not": {
"required": ["name"],
"properties": {
"name": {
"type": "string",
"minLength": 1
}
}
}
}
}
},
{
"properties": {
"type": { "enum": ["link"] },
"properties": {
"not": {
"title": "Link Object",
"type": "object",
"required": ["href"],
"properties": {
"href": {
"title": "href",
"type": "string",
"description":
"The value of the required `href` member must be a dereferenceable URI.",
"format": "uri"
},
"type": {
"title": "Link Object Type",
"type": "string",
"description":
"The value of the optional `type` member must be a string that hints at the format used to represent CRS parameters at the provided URI. Suggested values are: `proj4`, `ogcwkt`, `esriwkt`, but others can be used."
}
}
}
}
}
}
]
}
},
"bbox": {
"title": "Bounding Box",
"type": "array",
"description":
"To include information on the coordinate range for geometries, features, or feature collections, a GeoJSON object may have a member named `bbox`. The value of the bbox member must be a 2*n array where n is the number of dimensions represented in the contained geometries, with the lowest values for all axes followed by the highest values. The axes order of a bbox follows the axes order of geometries. In addition, the coordinate reference system for the bbox is assumed to match the coordinate reference system of the GeoJSON object of which it is a member.",
"minItems": 4,
"items": {
"type": "number"
}
}
},
"oneOf": [
{
"title": "Point",
"description":
"For type `Point`, the `coordinates` member must be a single position.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["Point"] },
"coordinates": {
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{ "$ref": "#/definitions/position" }
]
}
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "Multi Point Geometry",
"description":
"For type `MultiPoint`, the `coordinates` member must be an array of positions.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["MultiPoint"] },
"coordinates": {
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{
"items": { "$ref": "#/definitions/position" }
}
]
}
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "Line String",
"description":
"For type `LineString`, the `coordinates` member must be an array of two or more positions.\n\nA LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["LineString"] },
"coordinates": { "$ref": "#/definitions/lineStringCoordinates" }
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "MultiLineString",
"description":
"For type `MultiLineString`, the `coordinates` member must be an array of LineString coordinate arrays.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["MultiLineString"] },
"coordinates": {
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{
"items": { "$ref": "#/definitions/lineStringCoordinates" }
}
]
}
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "Polygon",
"description":
"For type `Polygon`, the `coordinates` member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["Polygon"] },
"coordinates": { "$ref": "#/definitions/polygonCoordinates" }
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "Multi-Polygon Geometry",
"description":
"For type `MultiPolygon`, the `coordinates` member must be an array of Polygon coordinate arrays.",
"required": ["coordinates"],
"properties": {
"type": { "enum": ["MultiPolygon"] },
"coordinates": {
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{
"items": { "$ref": "#/definitions/polygonCoordinates" }
}
]
}
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{
"title": "Geometry Collection",
"description":
"A GeoJSON object with type `GeometryCollection` is a geometry object which represents a collection of geometry objects.\n\nA geometry collection must have a member with the name `geometries`. The value corresponding to `geometries` is an array. Each element in this array is a GeoJSON geometry object.",
"required": ["geometries"],
"properties": {
"type": { "enum": ["GeometryCollection"] },
"geometries": {
"title": "Geometries",
"type": "array",
"items": { "$ref": "#/definitions/geometry" }
}
},
"allOf": [{ "$ref": "#/definitions/geometry" }]
},
{ "$ref": "#/definitions/feature" },
{ "$ref": "#/definitions/featurecollection" }
],
"definitions": {
"coordinates": {
"title": "Coordinates",
"type": "array",
"items": {
"oneOf": [{ "type": "array" }, { "type": "number" }]
}
},
"geometry": {
"title": "Geometry",
"description":
"A geometry is a GeoJSON object where the type member's value is one of the following strings: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, or `GeometryCollection`.",
"properties": {
"type": {
"enum": [
"Point",
"MultiPoint",
"LineString",
"MultiLineString",
"Polygon",
"MultiPolygon",
"GeometryCollection"
]
}
}
},
"feature": {
"title": "Feature",
"description":
"A GeoJSON object with the type `Feature` is a feature object.\n\n* A feature object must have a member with the name `geometry`. The value of the geometry member is a geometry object as defined above or a JSON null value.\n\n* A feature object must have a member with the name `properties`. The value of the properties member is an object (any JSON object or a JSON null value).\n\n* If a feature has a commonly used identifier, that identifier should be included as a member of the feature object with the name `id`.",
"required": ["geometry", "properties"],
"properties": {
"type": { "enum": ["Feature"] },
"geometry": {
"title": "Geometry",
"oneOf": [{ "$ref": "#/definitions/geometry" }, { "type": "null" }]
},
"properties": {
"title": "Properties",
"oneOf": [{ "type": "object" }, { "type": "null" }]
},
"id": {}
}
},
"featurecollection": {
"title": "Feature Collection",
"description":
"A GeoJSON object with the type `FeatureCollection` is a feature collection object.\n\nAn object of type `FeatureCollection` must have a member with the name `features`. The value corresponding to `features` is an array. Each element in the array is a feature object as defined above.",
"required": ["features"],
"properties": {
"type": { "enum": ["FeatureCollection"] },
"features": {
"title": "Features",
"type": "array",
"items": { "$ref": "#/definitions/feature" }
}
}
},
"linearRingCoordinates": {
"title": "Linear Ring Coordinates",
"description":
"A LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.",
"allOf": [
{ "$ref": "#/definitions/lineStringCoordinates" },
{
"minItems": 4
}
]
},
"lineStringCoordinates": {
"title": "Line String Coordinates",
"description":
"For type `LineString`, the `coordinates` member must be an array of two or more positions.",
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{
"minLength": 2,
"items": { "$ref": "#/definitions/position" }
}
]
},
"polygonCoordinates": {
"title": "Polygon Coordinates",
"description":
"For type `Polygon`, the `coordinates` member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.",
"allOf": [
{ "$ref": "#/definitions/coordinates" },
{
"items": { "$ref": "#/definitions/linearRingCoordinates" }
}
]
},
"position": {
"title": "Position",
"type": "array",
"description":
"A position is the fundamental geometry construct. The `coordinates` member of a geometry object is composed of one position (in the case of a Point geometry), an array of positions (LineString or MultiPoint geometries), an array of arrays of positions (Polygons, MultiLineStrings), or a multidimensional array of positions (MultiPolygon).\n\nA position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Any number of additional elements are allowed -- interpretation and meaning of additional elements is beyond the scope of this specification.",
"minItems": 2,
"additionalItems": true,
"items": {
"type": "number"
}
}
}
}