From 076e62a9357e819a0c13b3fb1915c29a2b3c98d5 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Jul 2019 17:06:41 +0200 Subject: Add data/crsjson.schema.json --- data/Makefile.am | 4 +- data/crsjson.schema.json | 294 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 data/crsjson.schema.json (limited to 'data') diff --git a/data/Makefile.am b/data/Makefile.am index 1bf95cd2..096ba7c3 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -2,7 +2,8 @@ DATAPATH = $(top_srcdir)/data pkgdata_DATA = GL27 nad.lst nad27 nad83 world other.extra \ CH null \ - ITRF2000 ITRF2008 ITRF2014 proj.db + ITRF2000 ITRF2008 ITRF2014 proj.db \ + crsjson.schema.json SQL_ORDERED_LIST = sql/begin.sql \ sql/proj_db_table_defs.sql \ @@ -40,6 +41,7 @@ EXTRA_DIST = GL27 nad.lst nad27 nad83 \ world other.extra \ CH \ ITRF2000 ITRF2008 ITRF2014 \ + crsjson.schema.json \ CMakeLists.txt tests/test_nodata.gtx null \ generate_all_sql_in.cmake sql_filelist.cmake \ $(SQL_ORDERED_LIST) diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json new file mode 100644 index 00000000..5ceeaa1e --- /dev/null +++ b/data/crsjson.schema.json @@ -0,0 +1,294 @@ +{ + "$id": "https://proj.org/crsjson.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Schema for CRS JSON", + + "oneOf": [ + { "$ref": "#/definitions/crs" }, + { "$ref": "#/definitions/datum" }, + { "$ref": "#/definitions/ellipsoid" }, + { "$ref": "#/definitions/prime_meridian" }, + { "$ref": "#/definitions/conversion" } + ], + + "definitions": { + + "axis": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["Axis"] }, + "name": { "type": "string" }, + "abbreviation": { "type": "string" }, + "direction": { "type": "string" }, + "unit": { "$ref": "#/definitions/unit" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name" ], + "additionalProperties": false + }, + + "bbox": { + "type": "object", + "properties": { + "east_longitude": { "type": "number" }, + "west_longitude": { "type": "number" }, + "south_latitude": { "type": "number" }, + "north_latitude": { "type": "number" } + }, + "required" : [ "east_longitude", "west_longitude", + "south_latitude", "north_latitude" ], + "additionalProperties": false + }, + + "conversion": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["Conversion"] }, + "name": { "type": "string" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "method", "parameters" ], + "additionalProperties": false + }, + + "coordinate_system": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["CoordinateSystem"] }, + "name": { "type": "string" }, + "subtype": { "type": "string" }, + "axis": { + "type": "array", + "items": { "$ref": "#/definitions/axis" } + }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "subtype", "axis" ], + "additionalProperties": false + }, + + "crs": { + "oneOf": [ + { "$ref": "#/definitions/geodetic_crs" }, + { "$ref": "#/definitions/derived_crs" } + ] + }, + + "datum": { + "oneOf": [ { "$ref": "#/definitions/geodetic_reference_frame" } ] + }, + + "derived_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["ProjectedCRS", "DerivedGeodeticCRS", + "DerivedGeographicCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "ellipsoid": { + "type": "object", + "oneOf":[ + { + "properties": { + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "semi_major_axis": { "$ref": "#/definitions/value_and_unit" }, + "semi_minor_axis": { "$ref": "#/definitions/value_and_unit" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "semi_major_axis", "semi_minor_axis" ], + "additionalProperties": false + }, + { + "properties": { + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "semi_major_axis": { "$ref": "#/definitions/value_and_unit" }, + "inverse_flattening": { "type": "number" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "semi_major_axis", "inverse_flattening" ], + "additionalProperties": false + }, + { + "properties": { + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "radius": { "$ref": "#/definitions/value_and_unit" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "radius" ], + "additionalProperties": false + } + ] + }, + + "geodetic_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["GeodeticCRS", "GeographicCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "geodetic_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["GeodeticReferenceFrame"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, + "prime_meridian": { "$ref": "#/definitions/prime_meridian" }, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "ellipsoid" ], + "additionalProperties": false + }, + + "id": { + "type": "object", + "properties": { + "authority": { "type": "string" }, + "code": { + "oneOf": [ { "type": "string" }, { "type": "integer" } ] + } + }, + "required" : [ "authority", "code" ], + "additionalProperties": false + }, + + "method": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["OperationMethod"]}, + "name": { "type": "string" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name" ], + "additionalProperties": false + }, + + "object_usage": { + "anyOf": [ + { + "type": "object", + "properties": { + "area": { "type": "string" }, + "bbox": { "$ref": "#/definitions/bbox" }, + "remarks": { "type": "string" }, + "id": { "$ref": "#/definitions/id" } + } + }, + { + "type": "object", + "properties": { + "usages": { "$ref": "#/definitions/usages" }, + "remarks": { "type": "string" }, + "id": { "$ref": "#/definitions/id" } + } + } + ] + }, + + "parameter_value": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["ParameterValue"] }, + "name": { "type": "string" }, + "value": { + "oneOf": [ + { "type": "string" }, + { "type": "number" } + ] + }, + "unit": { "$ref": "#/definitions/unit" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "value" ], + "additionalProperties": false + }, + + "prime_meridian": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["PrimeMeridian"] }, + "name": { "type": "string" }, + "longitude": { "$ref": "#/definitions/value_and_unit" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name" ], + "additionalProperties": false + }, + + "unit": { + "type": "object", + "properties": { + "type": { "type": "string", + "enum": ["LinearUnit", "AngularUnit", "ScaleUnit", + "TimeUnit", "ParametricUnit", "Unit"] }, + "name": { "type": "string" }, + "conversion_factor": { "type": "number" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "type", "name" ], + "additionalProperties": false + }, + + "usages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "area": { "type": "string" }, + "bbox": { "$ref": "#/definitions/bbox" } + }, + "additionalProperties": false + } + }, + + "value_and_unit": { + "type": "object", + "properties": { + "value": { "type": "number" }, + "unit": { "$ref": "#/definitions/unit" } + }, + "required" : [ "value", "unit" ], + "additionalProperties": false + } + + } +} -- cgit v1.2.3 From 89f2cc7ec4178a369e73e9cd115a2552a55d870a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Aug 2019 20:04:20 +0200 Subject: PROJJSON export: use more compact form --- data/crsjson.schema.json | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'data') diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json index 5ceeaa1e..86f1e13e 100644 --- a/data/crsjson.schema.json +++ b/data/crsjson.schema.json @@ -111,8 +111,8 @@ "properties": { "type": { "type": "string", "enum": ["Ellipsoid"] }, "name": { "type": "string" }, - "semi_major_axis": { "$ref": "#/definitions/value_and_unit" }, - "semi_minor_axis": { "$ref": "#/definitions/value_and_unit" }, + "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, + "semi_minor_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, "id": { "$ref": "#/definitions/id" } }, "required" : [ "name", "semi_major_axis", "semi_minor_axis" ], @@ -122,7 +122,7 @@ "properties": { "type": { "type": "string", "enum": ["Ellipsoid"] }, "name": { "type": "string" }, - "semi_major_axis": { "$ref": "#/definitions/value_and_unit" }, + "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, "inverse_flattening": { "type": "number" }, "id": { "$ref": "#/definitions/id" } }, @@ -133,7 +133,7 @@ "properties": { "type": { "type": "string", "enum": ["Ellipsoid"] }, "name": { "type": "string" }, - "radius": { "$ref": "#/definitions/value_and_unit" }, + "radius": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, "id": { "$ref": "#/definitions/id" } }, "required" : [ "name", "radius" ], @@ -255,17 +255,25 @@ }, "unit": { - "type": "object", - "properties": { - "type": { "type": "string", - "enum": ["LinearUnit", "AngularUnit", "ScaleUnit", - "TimeUnit", "ParametricUnit", "Unit"] }, - "name": { "type": "string" }, - "conversion_factor": { "type": "number" }, - "id": { "$ref": "#/definitions/id" } - }, - "required" : [ "type", "name" ], - "additionalProperties": false + "oneOf": [ + { + "type": "string", + "enum": ["metre", "degree", "unity"] + }, + { + "type": "object", + "properties": { + "type": { "type": "string", + "enum": ["LinearUnit", "AngularUnit", "ScaleUnit", + "TimeUnit", "ParametricUnit", "Unit"] }, + "name": { "type": "string" }, + "conversion_factor": { "type": "number" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "type", "name" ], + "additionalProperties": false + } + ] }, "usages": { @@ -288,6 +296,13 @@ }, "required" : [ "value", "unit" ], "additionalProperties": false + }, + + "value_in_metre_or_value_and_unit": { + "oneOf": [ + { "type": "number" }, + { "$ref": "#/definitions/value_and_unit" } + ] } } -- cgit v1.2.3 From f0d766e45640800412c08a7cb9ab4f8823d88d05 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 9 Aug 2019 17:10:20 +0200 Subject: PROJSJON: add import/export of VerticalCRS, CompoundCRS, BoundCRS, Transformation and ConcatenatedOperation --- data/crsjson.schema.json | 292 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 285 insertions(+), 7 deletions(-) (limited to 'data') diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json index 86f1e13e..5e2d41d0 100644 --- a/data/crsjson.schema.json +++ b/data/crsjson.schema.json @@ -8,11 +8,28 @@ { "$ref": "#/definitions/datum" }, { "$ref": "#/definitions/ellipsoid" }, { "$ref": "#/definitions/prime_meridian" }, - { "$ref": "#/definitions/conversion" } + { "$ref": "#/definitions/single_operation" }, + { "$ref": "#/definitions/concatenated_operation" } ], "definitions": { + "abridged_transformation": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["AbridgedTransformation"] }, + "name": { "type": "string" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "method", "parameters" ], + "additionalProperties": false + }, + "axis": { "type": "object", "properties": { @@ -40,6 +57,62 @@ "additionalProperties": false }, + "bound_crs": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["BoundCRS"] }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "transformation": { "$ref": "#/definitions/abridged_transformation" } + }, + "required" : [ "source_crs", "target_crs", "transformation" ], + "additionalProperties": false + }, + + "compound_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["CompoundCRS"] }, + "name": { "type": "string" }, + "components": { + "type": "array", + "items": { "$ref": "#/definitions/crs" } + }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "components" ], + "additionalProperties": false + }, + + "concatenated_operation": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ConcatenatedOperation"] }, + "name": { "type": "string" }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "steps": { + "type": "array", + "items": { "$ref": "#/definitions/single_operation" } + }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "source_crs", "target_crs", "steps" ], + "additionalProperties": false + }, + "conversion": { "type": "object", "properties": { @@ -52,7 +125,7 @@ }, "id": { "$ref": "#/definitions/id" } }, - "required" : [ "name", "method", "parameters" ], + "required" : [ "name", "method" ], "additionalProperties": false }, @@ -75,12 +148,24 @@ "crs": { "oneOf": [ { "$ref": "#/definitions/geodetic_crs" }, - { "$ref": "#/definitions/derived_crs" } + { "$ref": "#/definitions/derived_crs" }, + { "$ref": "#/definitions/vertical_crs" }, + { "$ref": "#/definitions/compound_crs" }, + { "$ref": "#/definitions/bound_crs" }, + { "$ref": "#/definitions/engineering_crs" }, + { "$ref": "#/definitions/parametric_crs" }, + { "$ref": "#/definitions/temporal_crs" } ] }, "datum": { - "oneOf": [ { "$ref": "#/definitions/geodetic_reference_frame" } ] + "oneOf": [ + { "$ref": "#/definitions/geodetic_reference_frame" }, + { "$ref": "#/definitions/vertical_reference_frame" }, + { "$ref": "#/definitions/temporal_datum" }, + { "$ref": "#/definitions/parametric_datum" }, + { "$ref": "#/definitions/engineering_datum" } + ] }, "derived_crs": { @@ -88,12 +173,19 @@ "allOf": [{ "$ref": "#/definitions/object_usage" }], "properties": { "type": { "type": "string", - "enum": ["ProjectedCRS", "DerivedGeodeticCRS", - "DerivedGeographicCRS"] }, + "enum": ["ProjectedCRS", + "DerivedGeodeticCRS", + "DerivedGeographicCRS", + "DerivedProjectedCRS", + "DerivedVerticalCRS", + "DerivedTemporalCRS", + "DerivedParametricCRS", + "DerivedEngineeringCRS"] }, "name": { "type": "string" }, "base_crs": { "$ref": "#/definitions/crs" }, "conversion": { "$ref": "#/definitions/conversion" }, "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, "area": {}, "bbox": {}, "usages": {}, @@ -142,14 +234,52 @@ ] }, + "engineering_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["EngineeringCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/engineering_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "engineering_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["EngineeringDatum"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name" ], + "additionalProperties": false + }, + "geodetic_crs": { "type": "object", "allOf": [{ "$ref": "#/definitions/object_usage" }], "properties": { "type": { "type": "string", "enum": ["GeodeticCRS", "GeographicCRS"] }, "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/datum" }, + "datum": { "$ref": "#/definitions/geodetic_reference_frame" }, "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, "area": {}, "bbox": {}, "usages": {}, @@ -169,6 +299,7 @@ "anchor": { "type": "string" }, "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, "prime_meridian": { "$ref": "#/definitions/prime_meridian" }, + "scope": {}, "area": {}, "bbox": {}, "usages": {}, @@ -207,6 +338,7 @@ { "type": "object", "properties": { + "scope": { "type": "string" }, "area": { "type": "string" }, "bbox": { "$ref": "#/definitions/bbox" }, "remarks": { "type": "string" }, @@ -242,6 +374,43 @@ "additionalProperties": false }, + "parametric_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ParametricCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/parametric_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "parametric_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ParametricDatum"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name" ], + "additionalProperties": false + }, + "prime_meridian": { "type": "object", "properties": { @@ -254,6 +423,77 @@ "additionalProperties": false }, + "single_operation": { + "oneOf": [ + { "$ref": "#/definitions/conversion" }, + { "$ref": "#/definitions/transformation" } + ] + }, + + "temporal_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["TemporalCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/temporal_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "temporal_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["TemporalDatum"] }, + "name": { "type": "string" }, + "calendar": { "type": "string" }, + "time_origin": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "calendar" ], + "additionalProperties": false + }, + + "transformation": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["Transformation"] }, + "name": { "type": "string" }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "interpolation_crs": { "$ref": "#/definitions/crs" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "accuracy": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "source_crs", "target_crs", "method", "parameters" ], + "additionalProperties": false + }, + "unit": { "oneOf": [ { @@ -281,6 +521,7 @@ "items": { "type": "object", "properties": { + "scope": { "type": "string" }, "area": { "type": "string" }, "bbox": { "$ref": "#/definitions/bbox" } }, @@ -303,6 +544,43 @@ { "type": "number" }, { "$ref": "#/definitions/value_and_unit" } ] + }, + + "vertical_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["VerticalCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/vertical_reference_frame" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "vertical_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["VerticalReferenceFrame"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name" ], + "additionalProperties": false } } -- cgit v1.2.3 From 63981af418d84749cd4d70752f83fd551100389f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 10 Aug 2019 15:15:44 +0200 Subject: PROJJSON: add support for DatumEnsemble and Dynamic[Geodetic|Vertical]ReferenceFrame --- data/crsjson.schema.json | 275 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 254 insertions(+), 21 deletions(-) (limited to 'data') diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json index 5e2d41d0..e38f3038 100644 --- a/data/crsjson.schema.json +++ b/data/crsjson.schema.json @@ -6,6 +6,7 @@ "oneOf": [ { "$ref": "#/definitions/crs" }, { "$ref": "#/definitions/datum" }, + { "$ref": "#/definitions/datum_ensemble" }, { "$ref": "#/definitions/ellipsoid" }, { "$ref": "#/definitions/prime_meridian" }, { "$ref": "#/definitions/single_operation" }, @@ -147,14 +148,20 @@ "crs": { "oneOf": [ - { "$ref": "#/definitions/geodetic_crs" }, - { "$ref": "#/definitions/derived_crs" }, - { "$ref": "#/definitions/vertical_crs" }, - { "$ref": "#/definitions/compound_crs" }, { "$ref": "#/definitions/bound_crs" }, + { "$ref": "#/definitions/compound_crs" }, + { "$ref": "#/definitions/derived_engineering_crs" }, + { "$ref": "#/definitions/derived_geodetic_crs" }, + { "$ref": "#/definitions/derived_parametric_crs" }, + { "$ref": "#/definitions/derived_projected_crs" }, + { "$ref": "#/definitions/derived_temporal_crs" }, + { "$ref": "#/definitions/derived_vertical_crs" }, { "$ref": "#/definitions/engineering_crs" }, + { "$ref": "#/definitions/geodetic_crs" }, { "$ref": "#/definitions/parametric_crs" }, - { "$ref": "#/definitions/temporal_crs" } + { "$ref": "#/definitions/projected_crs" }, + { "$ref": "#/definitions/temporal_crs" }, + { "$ref": "#/definitions/vertical_crs" } ] }, @@ -162,27 +169,132 @@ "oneOf": [ { "$ref": "#/definitions/geodetic_reference_frame" }, { "$ref": "#/definitions/vertical_reference_frame" }, + { "$ref": "#/definitions/dynamic_geodetic_reference_frame" }, + { "$ref": "#/definitions/dynamic_vertical_reference_frame" }, { "$ref": "#/definitions/temporal_datum" }, { "$ref": "#/definitions/parametric_datum" }, { "$ref": "#/definitions/engineering_datum" } ] }, - "derived_crs": { + "datum_ensemble": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["DatumEnsemble"] }, + "name": { "type": "string" }, + "members": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name" ], + "additionalProperties": false + } + }, + "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, + "accuracy": { "type": "string" }, + "id": { "$ref": "#/definitions/id" } + }, + "required" : [ "name", "members", "accuracy" ], + "additionalProperties": false + }, + + "derived_engineering_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedEngineeringCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/engineering_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_geodetic_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedGeodeticCRS", + "DerivedGeographicCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/geodetic_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_parametric_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedParametricCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/parametric_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_projected_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedProjectedCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/projected_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_temporal_crs": { "type": "object", "allOf": [{ "$ref": "#/definitions/object_usage" }], "properties": { "type": { "type": "string", - "enum": ["ProjectedCRS", - "DerivedGeodeticCRS", - "DerivedGeographicCRS", - "DerivedProjectedCRS", - "DerivedVerticalCRS", - "DerivedTemporalCRS", - "DerivedParametricCRS", - "DerivedEngineeringCRS"] }, + "enum": ["DerivedTemporalCRS"] }, "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/crs" }, + "base_crs": { "$ref": "#/definitions/temporal_crs" }, "conversion": { "$ref": "#/definitions/conversion" }, "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, "scope": {}, @@ -196,6 +308,69 @@ "additionalProperties": false }, + "derived_vertical_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedVerticalCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/vertical_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "dynamic_geodetic_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/geodetic_reference_frame" }], + "properties": { + "type": { "type": "string", "enum": ["DynamicGeodeticReferenceFrame"] }, + "name": {}, + "anchor": {}, + "ellipsoid": {}, + "prime_meridian": {}, + "frame_reference_epoch": { "type": "number" }, + "deformation_model": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "ellipsoid", "frame_reference_epoch" ], + "additionalProperties": false + }, + + "dynamic_vertical_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/vertical_reference_frame" }], + "properties": { + "type": { "type": "string", "enum": ["DynamicVerticalReferenceFrame"] }, + "name": {}, + "anchor": {}, + "frame_reference_epoch": { "type": "number" }, + "deformation_model": { "type": "string" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "frame_reference_epoch" ], + "additionalProperties": false + }, + "ellipsoid": { "type": "object", "oneOf":[ @@ -273,11 +448,16 @@ "geodetic_crs": { "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], "properties": { "type": { "type": "string", "enum": ["GeodeticCRS", "GeographicCRS"] }, "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/geodetic_reference_frame" }, + "datum": { + "oneOf": [ + { "$ref": "#/definitions/geodetic_reference_frame" }, + { "$ref": "#/definitions/dynamic_geodetic_reference_frame" } + ] + }, + "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, "scope": {}, "area": {}, @@ -286,7 +466,12 @@ "remarks": {}, "id": {} }, - "required" : [ "name", "datum" ], + "required" : [ "name" ], + "description": "One and only one of datum and datum_ensemble must be provided", + "allOf": [ + { "$ref": "#/definitions/object_usage" }, + { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } + ], "additionalProperties": false }, @@ -333,6 +518,23 @@ "additionalProperties": false }, + "one_and_only_one_of_datum_or_datum_ensemble": { + "allOf": [ + { + "not": { + "type": "object", + "required": [ "datum", "datum_ensemble" ] + } + }, + { + "oneOf": [ + { "type": "object", "required": ["datum"] }, + { "type": "object", "required": ["datum_ensemble"] } + ] + } + ] + }, + "object_usage": { "anyOf": [ { @@ -430,6 +632,27 @@ ] }, + "projected_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["ProjectedCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/geodetic_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + "temporal_crs": { "type": "object", "allOf": [{ "$ref": "#/definitions/object_usage" }], @@ -548,11 +771,16 @@ "vertical_crs": { "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], "properties": { "type": { "type": "string", "enum": ["VerticalCRS"] }, "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/vertical_reference_frame" }, + "datum": { + "oneOf": [ + { "$ref": "#/definitions/vertical_reference_frame" }, + { "$ref": "#/definitions/dynamic_vertical_reference_frame" } + ] + }, + "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, "scope": {}, "area": {}, @@ -561,7 +789,12 @@ "remarks": {}, "id": {} }, - "required" : [ "name", "datum" ], + "required" : [ "name"], + "description": "One and only one of datum and datum_ensemble must be provided", + "allOf": [ + { "$ref": "#/definitions/object_usage" }, + { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } + ], "additionalProperties": false }, -- cgit v1.2.3 From 0a1261781de96d2bb8c76fbd905ebf8b0121d3a6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 10 Aug 2019 17:44:53 +0200 Subject: PROJJSON: a few fixes, and add import of DerivedCRS, EngineeringCRS, ParametricCRS and TemporalCRS --- data/crsjson.schema.json | 55 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'data') diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json index e38f3038..10b17caa 100644 --- a/data/crsjson.schema.json +++ b/data/crsjson.schema.json @@ -37,11 +37,51 @@ "type": { "type": "string", "enum": ["Axis"] }, "name": { "type": "string" }, "abbreviation": { "type": "string" }, - "direction": { "type": "string" }, + "direction": { "type": "string", + "enum": [ "north", + "northNorthEast", + "northEast", + "eastNorthEast", + "east", + "eastSouthEast", + "southEast", + "southSouthEast", + "south", + "southSouthWest", + "southWest", + "westSouthWest", + "west", + "westNorthWest", + "northWest", + "northNorthWest", + "up", + "down", + "geocentricX", + "geocentricY", + "geocentricZ", + "columnPositive", + "columnNegative", + "rowPositive", + "rowNegative", + "displayRight", + "displayLeft", + "displayUp", + "displayDown", + "forward", + "aft", + "port", + "starboard", + "clockwise", + "counterClockwise", + "towards", + "awayFrom", + "future", + "past", + "unspecified" ] }, "unit": { "$ref": "#/definitions/unit" }, "id": { "$ref": "#/definitions/id" } }, - "required" : [ "name" ], + "required" : [ "name", "abbreviation", "direction" ], "additionalProperties": false }, @@ -135,7 +175,16 @@ "properties": { "type": { "type": "string", "enum": ["CoordinateSystem"] }, "name": { "type": "string" }, - "subtype": { "type": "string" }, + "subtype": { "type": "string", + "enum": ["Cartesian", + "spherical", + "ellipsoidal", + "vertical", + "ordinal", + "parametric", + "TemporalDateTime", + "TemporalCount", + "TemporalMeasure"] }, "axis": { "type": "array", "items": { "$ref": "#/definitions/axis" } -- cgit v1.2.3 From 8d0500b325d12b047797a60e3c13d4b473fae987 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 12 Aug 2019 13:45:17 +0200 Subject: PROJJSON: add support for importing 'ids' --- data/crsjson.schema.json | 144 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 105 insertions(+), 39 deletions(-) (limited to 'data') diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json index 10b17caa..726d8ece 100644 --- a/data/crsjson.schema.json +++ b/data/crsjson.schema.json @@ -25,9 +25,13 @@ "type": "array", "items": { "$ref": "#/definitions/parameter_value" } }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "method", "parameters" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -79,9 +83,13 @@ "past", "unspecified" ] }, "unit": { "$ref": "#/definitions/unit" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "abbreviation", "direction" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -125,7 +133,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "components" ], "additionalProperties": false @@ -148,7 +156,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "source_crs", "target_crs", "steps" ], "additionalProperties": false @@ -164,9 +172,13 @@ "type": "array", "items": { "$ref": "#/definitions/parameter_value" } }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "method" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -189,9 +201,13 @@ "type": "array", "items": { "$ref": "#/definitions/axis" } }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "subtype", "axis" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -237,17 +253,25 @@ "type": "object", "properties": { "name": { "type": "string" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false } }, "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, "accuracy": { "type": "string" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "members", "accuracy" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -266,7 +290,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -288,7 +312,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -309,7 +333,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -330,7 +354,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -351,7 +375,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -372,7 +396,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -394,7 +418,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "ellipsoid", "frame_reference_epoch" ], "additionalProperties": false @@ -414,7 +438,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "frame_reference_epoch" ], "additionalProperties": false @@ -429,7 +453,8 @@ "name": { "type": "string" }, "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, "semi_minor_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "semi_major_axis", "semi_minor_axis" ], "additionalProperties": false @@ -440,7 +465,8 @@ "name": { "type": "string" }, "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, "inverse_flattening": { "type": "number" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "semi_major_axis", "inverse_flattening" ], "additionalProperties": false @@ -450,11 +476,15 @@ "type": { "type": "string", "enum": ["Ellipsoid"] }, "name": { "type": "string" }, "radius": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "radius" ], "additionalProperties": false } + ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } ] }, @@ -471,7 +501,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "datum" ], "additionalProperties": false @@ -489,7 +519,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name" ], "additionalProperties": false @@ -513,7 +543,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name" ], "description": "One and only one of datum and datum_ensemble must be provided", @@ -538,7 +568,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "ellipsoid" ], "additionalProperties": false @@ -556,17 +586,33 @@ "additionalProperties": false }, + "ids": { + "type": "array", + "items": { "$ref": "#/definitions/id" } + }, + "method": { "type": "object", "properties": { "type": { "type": "string", "enum": ["OperationMethod"]}, "name": { "type": "string" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, + "id_ids_mutually_exclusive": { + "not": { + "type": "object", + "required": [ "id", "ids" ] + } + }, + "one_and_only_one_of_datum_or_datum_ensemble": { "allOf": [ { @@ -593,16 +639,24 @@ "area": { "type": "string" }, "bbox": { "$ref": "#/definitions/bbox" }, "remarks": { "type": "string" }, - "id": { "$ref": "#/definitions/id" } - } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ] }, { "type": "object", "properties": { "usages": { "$ref": "#/definitions/usages" }, "remarks": { "type": "string" }, - "id": { "$ref": "#/definitions/id" } - } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ] } ] }, @@ -619,9 +673,13 @@ ] }, "unit": { "$ref": "#/definitions/unit" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name", "value" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -638,7 +696,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "datum" ], "additionalProperties": false @@ -656,7 +714,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name" ], "additionalProperties": false @@ -668,9 +726,13 @@ "type": { "type": "string", "enum": ["PrimeMeridian"] }, "name": { "type": "string" }, "longitude": { "$ref": "#/definitions/value_and_unit" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false }, @@ -696,7 +758,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], "additionalProperties": false @@ -715,7 +777,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "datum" ], "additionalProperties": false @@ -734,7 +796,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "calendar" ], "additionalProperties": false @@ -760,7 +822,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name", "source_crs", "target_crs", "method", "parameters" ], "additionalProperties": false @@ -780,9 +842,13 @@ "TimeUnit", "ParametricUnit", "Unit"] }, "name": { "type": "string" }, "conversion_factor": { "type": "number" }, - "id": { "$ref": "#/definitions/id" } + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } }, "required" : [ "type", "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], "additionalProperties": false } ] @@ -836,7 +902,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name"], "description": "One and only one of datum and datum_ensemble must be provided", @@ -859,7 +925,7 @@ "bbox": {}, "usages": {}, "remarks": {}, - "id": {} + "id": {}, "ids": {} }, "required" : [ "name" ], "additionalProperties": false -- cgit v1.2.3 From cad1c5cf61fc00759bf4ad17b0b34f57f4945de6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 17 Aug 2019 10:58:08 +0200 Subject: PROJJSON: rename file as projjson.schema.json, and add versionning to it and to exported PROJJSON strings --- data/Makefile.am | 4 +- data/crsjson.schema.json | 935 -------------------------------------------- data/projjson.schema.json | 972 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 974 insertions(+), 937 deletions(-) delete mode 100644 data/crsjson.schema.json create mode 100644 data/projjson.schema.json (limited to 'data') diff --git a/data/Makefile.am b/data/Makefile.am index 096ba7c3..d686270d 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,7 +3,7 @@ DATAPATH = $(top_srcdir)/data pkgdata_DATA = GL27 nad.lst nad27 nad83 world other.extra \ CH null \ ITRF2000 ITRF2008 ITRF2014 proj.db \ - crsjson.schema.json + projjson.schema.json SQL_ORDERED_LIST = sql/begin.sql \ sql/proj_db_table_defs.sql \ @@ -41,7 +41,7 @@ EXTRA_DIST = GL27 nad.lst nad27 nad83 \ world other.extra \ CH \ ITRF2000 ITRF2008 ITRF2014 \ - crsjson.schema.json \ + projjson.schema.json \ CMakeLists.txt tests/test_nodata.gtx null \ generate_all_sql_in.cmake sql_filelist.cmake \ $(SQL_ORDERED_LIST) diff --git a/data/crsjson.schema.json b/data/crsjson.schema.json deleted file mode 100644 index 726d8ece..00000000 --- a/data/crsjson.schema.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "$id": "https://proj.org/crsjson.schema.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "description": "Schema for CRS JSON", - - "oneOf": [ - { "$ref": "#/definitions/crs" }, - { "$ref": "#/definitions/datum" }, - { "$ref": "#/definitions/datum_ensemble" }, - { "$ref": "#/definitions/ellipsoid" }, - { "$ref": "#/definitions/prime_meridian" }, - { "$ref": "#/definitions/single_operation" }, - { "$ref": "#/definitions/concatenated_operation" } - ], - - "definitions": { - - "abridged_transformation": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["AbridgedTransformation"] }, - "name": { "type": "string" }, - "method": { "$ref": "#/definitions/method" }, - "parameters": { - "type": "array", - "items": { "$ref": "#/definitions/parameter_value" } - }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "method", "parameters" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "axis": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["Axis"] }, - "name": { "type": "string" }, - "abbreviation": { "type": "string" }, - "direction": { "type": "string", - "enum": [ "north", - "northNorthEast", - "northEast", - "eastNorthEast", - "east", - "eastSouthEast", - "southEast", - "southSouthEast", - "south", - "southSouthWest", - "southWest", - "westSouthWest", - "west", - "westNorthWest", - "northWest", - "northNorthWest", - "up", - "down", - "geocentricX", - "geocentricY", - "geocentricZ", - "columnPositive", - "columnNegative", - "rowPositive", - "rowNegative", - "displayRight", - "displayLeft", - "displayUp", - "displayDown", - "forward", - "aft", - "port", - "starboard", - "clockwise", - "counterClockwise", - "towards", - "awayFrom", - "future", - "past", - "unspecified" ] }, - "unit": { "$ref": "#/definitions/unit" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "abbreviation", "direction" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "bbox": { - "type": "object", - "properties": { - "east_longitude": { "type": "number" }, - "west_longitude": { "type": "number" }, - "south_latitude": { "type": "number" }, - "north_latitude": { "type": "number" } - }, - "required" : [ "east_longitude", "west_longitude", - "south_latitude", "north_latitude" ], - "additionalProperties": false - }, - - "bound_crs": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["BoundCRS"] }, - "source_crs": { "$ref": "#/definitions/crs" }, - "target_crs": { "$ref": "#/definitions/crs" }, - "transformation": { "$ref": "#/definitions/abridged_transformation" } - }, - "required" : [ "source_crs", "target_crs", "transformation" ], - "additionalProperties": false - }, - - "compound_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["CompoundCRS"] }, - "name": { "type": "string" }, - "components": { - "type": "array", - "items": { "$ref": "#/definitions/crs" } - }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "components" ], - "additionalProperties": false - }, - - "concatenated_operation": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["ConcatenatedOperation"] }, - "name": { "type": "string" }, - "source_crs": { "$ref": "#/definitions/crs" }, - "target_crs": { "$ref": "#/definitions/crs" }, - "steps": { - "type": "array", - "items": { "$ref": "#/definitions/single_operation" } - }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "source_crs", "target_crs", "steps" ], - "additionalProperties": false - }, - - "conversion": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["Conversion"] }, - "name": { "type": "string" }, - "method": { "$ref": "#/definitions/method" }, - "parameters": { - "type": "array", - "items": { "$ref": "#/definitions/parameter_value" } - }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "method" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "coordinate_system": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["CoordinateSystem"] }, - "name": { "type": "string" }, - "subtype": { "type": "string", - "enum": ["Cartesian", - "spherical", - "ellipsoidal", - "vertical", - "ordinal", - "parametric", - "TemporalDateTime", - "TemporalCount", - "TemporalMeasure"] }, - "axis": { - "type": "array", - "items": { "$ref": "#/definitions/axis" } - }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "subtype", "axis" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "crs": { - "oneOf": [ - { "$ref": "#/definitions/bound_crs" }, - { "$ref": "#/definitions/compound_crs" }, - { "$ref": "#/definitions/derived_engineering_crs" }, - { "$ref": "#/definitions/derived_geodetic_crs" }, - { "$ref": "#/definitions/derived_parametric_crs" }, - { "$ref": "#/definitions/derived_projected_crs" }, - { "$ref": "#/definitions/derived_temporal_crs" }, - { "$ref": "#/definitions/derived_vertical_crs" }, - { "$ref": "#/definitions/engineering_crs" }, - { "$ref": "#/definitions/geodetic_crs" }, - { "$ref": "#/definitions/parametric_crs" }, - { "$ref": "#/definitions/projected_crs" }, - { "$ref": "#/definitions/temporal_crs" }, - { "$ref": "#/definitions/vertical_crs" } - ] - }, - - "datum": { - "oneOf": [ - { "$ref": "#/definitions/geodetic_reference_frame" }, - { "$ref": "#/definitions/vertical_reference_frame" }, - { "$ref": "#/definitions/dynamic_geodetic_reference_frame" }, - { "$ref": "#/definitions/dynamic_vertical_reference_frame" }, - { "$ref": "#/definitions/temporal_datum" }, - { "$ref": "#/definitions/parametric_datum" }, - { "$ref": "#/definitions/engineering_datum" } - ] - }, - - "datum_ensemble": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["DatumEnsemble"] }, - "name": { "type": "string" }, - "members": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { "type": "string" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - } - }, - "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, - "accuracy": { "type": "string" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "members", "accuracy" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "derived_engineering_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedEngineeringCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/engineering_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "derived_geodetic_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedGeodeticCRS", - "DerivedGeographicCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/geodetic_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "derived_parametric_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedParametricCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/parametric_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "derived_projected_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedProjectedCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/projected_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "derived_temporal_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedTemporalCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/temporal_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "derived_vertical_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["DerivedVerticalCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/vertical_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "dynamic_geodetic_reference_frame": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/geodetic_reference_frame" }], - "properties": { - "type": { "type": "string", "enum": ["DynamicGeodeticReferenceFrame"] }, - "name": {}, - "anchor": {}, - "ellipsoid": {}, - "prime_meridian": {}, - "frame_reference_epoch": { "type": "number" }, - "deformation_model": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "ellipsoid", "frame_reference_epoch" ], - "additionalProperties": false - }, - - "dynamic_vertical_reference_frame": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/vertical_reference_frame" }], - "properties": { - "type": { "type": "string", "enum": ["DynamicVerticalReferenceFrame"] }, - "name": {}, - "anchor": {}, - "frame_reference_epoch": { "type": "number" }, - "deformation_model": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "frame_reference_epoch" ], - "additionalProperties": false - }, - - "ellipsoid": { - "type": "object", - "oneOf":[ - { - "properties": { - "type": { "type": "string", "enum": ["Ellipsoid"] }, - "name": { "type": "string" }, - "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "semi_minor_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "semi_major_axis", "semi_minor_axis" ], - "additionalProperties": false - }, - { - "properties": { - "type": { "type": "string", "enum": ["Ellipsoid"] }, - "name": { "type": "string" }, - "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "inverse_flattening": { "type": "number" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "semi_major_axis", "inverse_flattening" ], - "additionalProperties": false - }, - { - "properties": { - "type": { "type": "string", "enum": ["Ellipsoid"] }, - "name": { "type": "string" }, - "radius": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "radius" ], - "additionalProperties": false - } - ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ] - }, - - "engineering_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["EngineeringCRS"] }, - "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/engineering_datum" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "datum" ], - "additionalProperties": false - }, - - "engineering_datum": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["EngineeringDatum"] }, - "name": { "type": "string" }, - "anchor": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name" ], - "additionalProperties": false - }, - - "geodetic_crs": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["GeodeticCRS", "GeographicCRS"] }, - "name": { "type": "string" }, - "datum": { - "oneOf": [ - { "$ref": "#/definitions/geodetic_reference_frame" }, - { "$ref": "#/definitions/dynamic_geodetic_reference_frame" } - ] - }, - "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name" ], - "description": "One and only one of datum and datum_ensemble must be provided", - "allOf": [ - { "$ref": "#/definitions/object_usage" }, - { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } - ], - "additionalProperties": false - }, - - "geodetic_reference_frame": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["GeodeticReferenceFrame"] }, - "name": { "type": "string" }, - "anchor": { "type": "string" }, - "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, - "prime_meridian": { "$ref": "#/definitions/prime_meridian" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "ellipsoid" ], - "additionalProperties": false - }, - - "id": { - "type": "object", - "properties": { - "authority": { "type": "string" }, - "code": { - "oneOf": [ { "type": "string" }, { "type": "integer" } ] - } - }, - "required" : [ "authority", "code" ], - "additionalProperties": false - }, - - "ids": { - "type": "array", - "items": { "$ref": "#/definitions/id" } - }, - - "method": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["OperationMethod"]}, - "name": { "type": "string" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "id_ids_mutually_exclusive": { - "not": { - "type": "object", - "required": [ "id", "ids" ] - } - }, - - "one_and_only_one_of_datum_or_datum_ensemble": { - "allOf": [ - { - "not": { - "type": "object", - "required": [ "datum", "datum_ensemble" ] - } - }, - { - "oneOf": [ - { "type": "object", "required": ["datum"] }, - { "type": "object", "required": ["datum_ensemble"] } - ] - } - ] - }, - - "object_usage": { - "anyOf": [ - { - "type": "object", - "properties": { - "scope": { "type": "string" }, - "area": { "type": "string" }, - "bbox": { "$ref": "#/definitions/bbox" }, - "remarks": { "type": "string" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ] - }, - { - "type": "object", - "properties": { - "usages": { "$ref": "#/definitions/usages" }, - "remarks": { "type": "string" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ] - } - ] - }, - - "parameter_value": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["ParameterValue"] }, - "name": { "type": "string" }, - "value": { - "oneOf": [ - { "type": "string" }, - { "type": "number" } - ] - }, - "unit": { "$ref": "#/definitions/unit" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name", "value" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "parametric_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["ParametricCRS"] }, - "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/parametric_datum" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "datum" ], - "additionalProperties": false - }, - - "parametric_datum": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["ParametricDatum"] }, - "name": { "type": "string" }, - "anchor": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name" ], - "additionalProperties": false - }, - - "prime_meridian": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["PrimeMeridian"] }, - "name": { "type": "string" }, - "longitude": { "$ref": "#/definitions/value_and_unit" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "name" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - }, - - "single_operation": { - "oneOf": [ - { "$ref": "#/definitions/conversion" }, - { "$ref": "#/definitions/transformation" } - ] - }, - - "projected_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", - "enum": ["ProjectedCRS"] }, - "name": { "type": "string" }, - "base_crs": { "$ref": "#/definitions/geodetic_crs" }, - "conversion": { "$ref": "#/definitions/conversion" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], - "additionalProperties": false - }, - - "temporal_crs": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["TemporalCRS"] }, - "name": { "type": "string" }, - "datum": { "$ref": "#/definitions/temporal_datum" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "datum" ], - "additionalProperties": false - }, - - "temporal_datum": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["TemporalDatum"] }, - "name": { "type": "string" }, - "calendar": { "type": "string" }, - "time_origin": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "calendar" ], - "additionalProperties": false - }, - - "transformation": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["Transformation"] }, - "name": { "type": "string" }, - "source_crs": { "$ref": "#/definitions/crs" }, - "target_crs": { "$ref": "#/definitions/crs" }, - "interpolation_crs": { "$ref": "#/definitions/crs" }, - "method": { "$ref": "#/definitions/method" }, - "parameters": { - "type": "array", - "items": { "$ref": "#/definitions/parameter_value" } - }, - "accuracy": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name", "source_crs", "target_crs", "method", "parameters" ], - "additionalProperties": false - }, - - "unit": { - "oneOf": [ - { - "type": "string", - "enum": ["metre", "degree", "unity"] - }, - { - "type": "object", - "properties": { - "type": { "type": "string", - "enum": ["LinearUnit", "AngularUnit", "ScaleUnit", - "TimeUnit", "ParametricUnit", "Unit"] }, - "name": { "type": "string" }, - "conversion_factor": { "type": "number" }, - "id": { "$ref": "#/definitions/id" }, - "ids": { "$ref": "#/definitions/ids" } - }, - "required" : [ "type", "name" ], - "allOf": [ - { "$ref": "#/definitions/id_ids_mutually_exclusive" } - ], - "additionalProperties": false - } - ] - }, - - "usages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "scope": { "type": "string" }, - "area": { "type": "string" }, - "bbox": { "$ref": "#/definitions/bbox" } - }, - "additionalProperties": false - } - }, - - "value_and_unit": { - "type": "object", - "properties": { - "value": { "type": "number" }, - "unit": { "$ref": "#/definitions/unit" } - }, - "required" : [ "value", "unit" ], - "additionalProperties": false - }, - - "value_in_metre_or_value_and_unit": { - "oneOf": [ - { "type": "number" }, - { "$ref": "#/definitions/value_and_unit" } - ] - }, - - "vertical_crs": { - "type": "object", - "properties": { - "type": { "type": "string", "enum": ["VerticalCRS"] }, - "name": { "type": "string" }, - "datum": { - "oneOf": [ - { "$ref": "#/definitions/vertical_reference_frame" }, - { "$ref": "#/definitions/dynamic_vertical_reference_frame" } - ] - }, - "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, - "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name"], - "description": "One and only one of datum and datum_ensemble must be provided", - "allOf": [ - { "$ref": "#/definitions/object_usage" }, - { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } - ], - "additionalProperties": false - }, - - "vertical_reference_frame": { - "type": "object", - "allOf": [{ "$ref": "#/definitions/object_usage" }], - "properties": { - "type": { "type": "string", "enum": ["VerticalReferenceFrame"] }, - "name": { "type": "string" }, - "anchor": { "type": "string" }, - "scope": {}, - "area": {}, - "bbox": {}, - "usages": {}, - "remarks": {}, - "id": {}, "ids": {} - }, - "required" : [ "name" ], - "additionalProperties": false - } - - } -} diff --git a/data/projjson.schema.json b/data/projjson.schema.json new file mode 100644 index 00000000..60fca6df --- /dev/null +++ b/data/projjson.schema.json @@ -0,0 +1,972 @@ +{ + "$id": "https://proj.org/schemas/v0.1/projjson.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Schema for PROJJSON", + "$comment": "This file exists both in data/ and in schemas/vXXX/. Keep both in sync. And if changing the value of $id, change PROJJSON_CURRENT_VERSION accordingly in io.cpp", + + "oneOf": [ + { "$ref": "#/definitions/crs" }, + { "$ref": "#/definitions/datum" }, + { "$ref": "#/definitions/datum_ensemble" }, + { "$ref": "#/definitions/ellipsoid" }, + { "$ref": "#/definitions/prime_meridian" }, + { "$ref": "#/definitions/single_operation" }, + { "$ref": "#/definitions/concatenated_operation" } + ], + + "definitions": { + + "abridged_transformation": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["AbridgedTransformation"] }, + "name": { "type": "string" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "method", "parameters" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "axis": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["Axis"] }, + "name": { "type": "string" }, + "abbreviation": { "type": "string" }, + "direction": { "type": "string", + "enum": [ "north", + "northNorthEast", + "northEast", + "eastNorthEast", + "east", + "eastSouthEast", + "southEast", + "southSouthEast", + "south", + "southSouthWest", + "southWest", + "westSouthWest", + "west", + "westNorthWest", + "northWest", + "northNorthWest", + "up", + "down", + "geocentricX", + "geocentricY", + "geocentricZ", + "columnPositive", + "columnNegative", + "rowPositive", + "rowNegative", + "displayRight", + "displayLeft", + "displayUp", + "displayDown", + "forward", + "aft", + "port", + "starboard", + "clockwise", + "counterClockwise", + "towards", + "awayFrom", + "future", + "past", + "unspecified" ] }, + "unit": { "$ref": "#/definitions/unit" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "abbreviation", "direction" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "bbox": { + "type": "object", + "properties": { + "east_longitude": { "type": "number" }, + "west_longitude": { "type": "number" }, + "south_latitude": { "type": "number" }, + "north_latitude": { "type": "number" } + }, + "required" : [ "east_longitude", "west_longitude", + "south_latitude", "north_latitude" ], + "additionalProperties": false + }, + + "bound_crs": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["BoundCRS"] }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "transformation": { "$ref": "#/definitions/abridged_transformation" } + }, + "required" : [ "source_crs", "target_crs", "transformation" ], + "additionalProperties": false + }, + + "compound_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["CompoundCRS"] }, + "name": { "type": "string" }, + "components": { + "type": "array", + "items": { "$ref": "#/definitions/crs" } + }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "components" ], + "additionalProperties": false + }, + + "concatenated_operation": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ConcatenatedOperation"] }, + "name": { "type": "string" }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "steps": { + "type": "array", + "items": { "$ref": "#/definitions/single_operation" } + }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "source_crs", "target_crs", "steps" ], + "additionalProperties": false + }, + + "conversion": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["Conversion"] }, + "name": { "type": "string" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "method" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "coordinate_system": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["CoordinateSystem"] }, + "name": { "type": "string" }, + "subtype": { "type": "string", + "enum": ["Cartesian", + "spherical", + "ellipsoidal", + "vertical", + "ordinal", + "parametric", + "TemporalDateTime", + "TemporalCount", + "TemporalMeasure"] }, + "axis": { + "type": "array", + "items": { "$ref": "#/definitions/axis" } + }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "subtype", "axis" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "crs": { + "oneOf": [ + { "$ref": "#/definitions/bound_crs" }, + { "$ref": "#/definitions/compound_crs" }, + { "$ref": "#/definitions/derived_engineering_crs" }, + { "$ref": "#/definitions/derived_geodetic_crs" }, + { "$ref": "#/definitions/derived_parametric_crs" }, + { "$ref": "#/definitions/derived_projected_crs" }, + { "$ref": "#/definitions/derived_temporal_crs" }, + { "$ref": "#/definitions/derived_vertical_crs" }, + { "$ref": "#/definitions/engineering_crs" }, + { "$ref": "#/definitions/geodetic_crs" }, + { "$ref": "#/definitions/parametric_crs" }, + { "$ref": "#/definitions/projected_crs" }, + { "$ref": "#/definitions/temporal_crs" }, + { "$ref": "#/definitions/vertical_crs" } + ] + }, + + "datum": { + "oneOf": [ + { "$ref": "#/definitions/geodetic_reference_frame" }, + { "$ref": "#/definitions/vertical_reference_frame" }, + { "$ref": "#/definitions/dynamic_geodetic_reference_frame" }, + { "$ref": "#/definitions/dynamic_vertical_reference_frame" }, + { "$ref": "#/definitions/temporal_datum" }, + { "$ref": "#/definitions/parametric_datum" }, + { "$ref": "#/definitions/engineering_datum" } + ] + }, + + "datum_ensemble": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["DatumEnsemble"] }, + "name": { "type": "string" }, + "members": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + } + }, + "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, + "accuracy": { "type": "string" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "members", "accuracy" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "derived_engineering_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedEngineeringCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/engineering_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_geodetic_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedGeodeticCRS", + "DerivedGeographicCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/geodetic_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_parametric_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedParametricCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/parametric_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_projected_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedProjectedCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/projected_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_temporal_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedTemporalCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/temporal_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "derived_vertical_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["DerivedVerticalCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/vertical_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "dynamic_geodetic_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/geodetic_reference_frame" }], + "properties": { + "type": { "type": "string", "enum": ["DynamicGeodeticReferenceFrame"] }, + "name": {}, + "anchor": {}, + "ellipsoid": {}, + "prime_meridian": {}, + "frame_reference_epoch": { "type": "number" }, + "deformation_model": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "ellipsoid", "frame_reference_epoch" ], + "additionalProperties": false + }, + + "dynamic_vertical_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/vertical_reference_frame" }], + "properties": { + "type": { "type": "string", "enum": ["DynamicVerticalReferenceFrame"] }, + "name": {}, + "anchor": {}, + "frame_reference_epoch": { "type": "number" }, + "deformation_model": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "frame_reference_epoch" ], + "additionalProperties": false + }, + + "ellipsoid": { + "type": "object", + "oneOf":[ + { + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, + "semi_minor_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "semi_major_axis", "semi_minor_axis" ], + "additionalProperties": false + }, + { + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "semi_major_axis": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, + "inverse_flattening": { "type": "number" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "semi_major_axis", "inverse_flattening" ], + "additionalProperties": false + }, + { + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["Ellipsoid"] }, + "name": { "type": "string" }, + "radius": { "$ref": "#/definitions/value_in_metre_or_value_and_unit" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "radius" ], + "additionalProperties": false + } + ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ] + }, + + "engineering_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["EngineeringCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/engineering_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "engineering_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["EngineeringDatum"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name" ], + "additionalProperties": false + }, + + "geodetic_crs": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["GeodeticCRS", "GeographicCRS"] }, + "name": { "type": "string" }, + "datum": { + "oneOf": [ + { "$ref": "#/definitions/geodetic_reference_frame" }, + { "$ref": "#/definitions/dynamic_geodetic_reference_frame" } + ] + }, + "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name" ], + "description": "One and only one of datum and datum_ensemble must be provided", + "allOf": [ + { "$ref": "#/definitions/object_usage" }, + { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } + ], + "additionalProperties": false + }, + + "geodetic_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["GeodeticReferenceFrame"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "ellipsoid": { "$ref": "#/definitions/ellipsoid" }, + "prime_meridian": { "$ref": "#/definitions/prime_meridian" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "ellipsoid" ], + "additionalProperties": false + }, + + "id": { + "type": "object", + "properties": { + "authority": { "type": "string" }, + "code": { + "oneOf": [ { "type": "string" }, { "type": "integer" } ] + } + }, + "required" : [ "authority", "code" ], + "additionalProperties": false + }, + + "ids": { + "type": "array", + "items": { "$ref": "#/definitions/id" } + }, + + "method": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["OperationMethod"]}, + "name": { "type": "string" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "id_ids_mutually_exclusive": { + "not": { + "type": "object", + "required": [ "id", "ids" ] + } + }, + + "one_and_only_one_of_datum_or_datum_ensemble": { + "allOf": [ + { + "not": { + "type": "object", + "required": [ "datum", "datum_ensemble" ] + } + }, + { + "oneOf": [ + { "type": "object", "required": ["datum"] }, + { "type": "object", "required": ["datum_ensemble"] } + ] + } + ] + }, + + "object_usage": { + "anyOf": [ + { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "scope": { "type": "string" }, + "area": { "type": "string" }, + "bbox": { "$ref": "#/definitions/bbox" }, + "remarks": { "type": "string" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ] + }, + { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "usages": { "$ref": "#/definitions/usages" }, + "remarks": { "type": "string" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ] + } + ] + }, + + "parameter_value": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["ParameterValue"] }, + "name": { "type": "string" }, + "value": { + "oneOf": [ + { "type": "string" }, + { "type": "number" } + ] + }, + "unit": { "$ref": "#/definitions/unit" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name", "value" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "parametric_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ParametricCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/parametric_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "parametric_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["ParametricDatum"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name" ], + "additionalProperties": false + }, + + "prime_meridian": { + "type": "object", + "properties": { + "$schema" : { "type": "string" }, + "type": { "type": "string", "enum": ["PrimeMeridian"] }, + "name": { "type": "string" }, + "longitude": { "$ref": "#/definitions/value_and_unit" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + }, + + "single_operation": { + "oneOf": [ + { "$ref": "#/definitions/conversion" }, + { "$ref": "#/definitions/transformation" } + ] + }, + + "projected_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", + "enum": ["ProjectedCRS"] }, + "name": { "type": "string" }, + "base_crs": { "$ref": "#/definitions/geodetic_crs" }, + "conversion": { "$ref": "#/definitions/conversion" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "base_crs", "conversion", "coordinate_system" ], + "additionalProperties": false + }, + + "temporal_crs": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["TemporalCRS"] }, + "name": { "type": "string" }, + "datum": { "$ref": "#/definitions/temporal_datum" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "datum" ], + "additionalProperties": false + }, + + "temporal_datum": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["TemporalDatum"] }, + "name": { "type": "string" }, + "calendar": { "type": "string" }, + "time_origin": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "calendar" ], + "additionalProperties": false + }, + + "transformation": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["Transformation"] }, + "name": { "type": "string" }, + "source_crs": { "$ref": "#/definitions/crs" }, + "target_crs": { "$ref": "#/definitions/crs" }, + "interpolation_crs": { "$ref": "#/definitions/crs" }, + "method": { "$ref": "#/definitions/method" }, + "parameters": { + "type": "array", + "items": { "$ref": "#/definitions/parameter_value" } + }, + "accuracy": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name", "source_crs", "target_crs", "method", "parameters" ], + "additionalProperties": false + }, + + "unit": { + "oneOf": [ + { + "type": "string", + "enum": ["metre", "degree", "unity"] + }, + { + "type": "object", + "properties": { + "type": { "type": "string", + "enum": ["LinearUnit", "AngularUnit", "ScaleUnit", + "TimeUnit", "ParametricUnit", "Unit"] }, + "name": { "type": "string" }, + "conversion_factor": { "type": "number" }, + "id": { "$ref": "#/definitions/id" }, + "ids": { "$ref": "#/definitions/ids" } + }, + "required" : [ "type", "name" ], + "allOf": [ + { "$ref": "#/definitions/id_ids_mutually_exclusive" } + ], + "additionalProperties": false + } + ] + }, + + "usages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "scope": { "type": "string" }, + "area": { "type": "string" }, + "bbox": { "$ref": "#/definitions/bbox" } + }, + "additionalProperties": false + } + }, + + "value_and_unit": { + "type": "object", + "properties": { + "value": { "type": "number" }, + "unit": { "$ref": "#/definitions/unit" } + }, + "required" : [ "value", "unit" ], + "additionalProperties": false + }, + + "value_in_metre_or_value_and_unit": { + "oneOf": [ + { "type": "number" }, + { "$ref": "#/definitions/value_and_unit" } + ] + }, + + "vertical_crs": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["VerticalCRS"] }, + "name": { "type": "string" }, + "datum": { + "oneOf": [ + { "$ref": "#/definitions/vertical_reference_frame" }, + { "$ref": "#/definitions/dynamic_vertical_reference_frame" } + ] + }, + "datum_ensemble": { "$ref": "#/definitions/datum_ensemble" }, + "coordinate_system": { "$ref": "#/definitions/coordinate_system" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name"], + "description": "One and only one of datum and datum_ensemble must be provided", + "allOf": [ + { "$ref": "#/definitions/object_usage" }, + { "$ref": "#/definitions/one_and_only_one_of_datum_or_datum_ensemble" } + ], + "additionalProperties": false + }, + + "vertical_reference_frame": { + "type": "object", + "allOf": [{ "$ref": "#/definitions/object_usage" }], + "properties": { + "type": { "type": "string", "enum": ["VerticalReferenceFrame"] }, + "name": { "type": "string" }, + "anchor": { "type": "string" }, + "$schema" : {}, + "scope": {}, + "area": {}, + "bbox": {}, + "usages": {}, + "remarks": {}, + "id": {}, "ids": {} + }, + "required" : [ "name" ], + "additionalProperties": false + } + + } +} -- cgit v1.2.3