diff --git a/__init__.py b/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/static-catalog/__init__.py b/static-catalog/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/static-catalog/implementations/DigitalGlobe/__init__.py b/static-catalog/implementations/DigitalGlobe/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/static-catalog/implementations/DigitalGlobe/example_validator/__init__.py b/static-catalog/implementations/DigitalGlobe/example_validator/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/static-catalog/implementations/DigitalGlobe/example_validator/validate_examples.py b/static-catalog/implementations/DigitalGlobe/example_validator/validate_examples.py new file mode 100644 index 000000000..dcb82c24b --- /dev/null +++ b/static-catalog/implementations/DigitalGlobe/example_validator/validate_examples.py @@ -0,0 +1,25 @@ +import os +import json +from jsonschema import validate, RefResolver + +# find our schema root folder +schema_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", "json-schema")) +schema_root_url = "file:///{}/".format(schema_folder.replace('\\', '/')) + +# get the schema and the reference resolver +with open(os.path.join(schema_folder, 'spatiotemporal_feature.json')) as schema_file: + schema = json.load(schema_file) + resolver = RefResolver(schema_root_url, schema) + +# for each example file in the folder validate against the schema +example_directory = os.path.join(os.path.dirname(__file__), '..', 'examples') +for filename in os.listdir(example_directory): + with open(os.path.join(example_directory, filename)) as example_file: + example = json.load(example_file) + + # validate against the schema + validate(example, schema, resolver=resolver) + print('validated {}'.format(filename)) + + + diff --git a/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobeAcquisition.json b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobeAcquisition.json new file mode 100644 index 000000000..9cd26c4a7 --- /dev/null +++ b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobeAcquisition.json @@ -0,0 +1,320 @@ +{ + "id": "103001004B316600", + "type": "Feature", + "schema": "DigitalGlobeAcquisition", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -104.9506689, + 38.96469654 + ], + [ + -105.1608127, + 38.95840828 + ], + [ + -105.1610212, + 39.00241359 + ], + [ + -105.1609342, + 39.04661305 + ], + [ + -105.1605798, + 39.09107845 + ], + [ + -105.1603734, + 39.13571925 + ], + [ + -105.1606414, + 39.18033946 + ], + [ + -105.160482, + 39.22534091 + ], + [ + -105.1617257, + 39.26986031 + ], + [ + -105.1614253, + 39.31538951 + ], + [ + -105.1608883, + 39.3612619 + ], + [ + -105.1613922, + 39.40685628 + ], + [ + -105.163213, + 39.45187733 + ], + [ + -105.1635238, + 39.4980186 + ], + [ + -105.1622525, + 39.54545705 + ], + [ + -105.1624777, + 39.59229898 + ], + [ + -105.1624785, + 39.63959411 + ], + [ + -105.1636219, + 39.68637975 + ], + [ + -105.1634848, + 39.73439091 + ], + [ + -105.1637438, + 39.78249578 + ], + [ + -105.1642909, + 39.83069735 + ], + [ + -105.1649241, + 39.87919405 + ], + [ + -105.165344, + 39.92821627 + ], + [ + -105.1659454, + 39.97750376 + ], + [ + -105.1659608, + 40.02059078 + ], + [ + -104.9357658, + 40.04463773 + ], + [ + -104.9362418, + 40.00097208 + ], + [ + -104.9371883, + 39.95044437 + ], + [ + -104.9376547, + 39.90071155 + ], + [ + -104.9380541, + 39.85136537 + ], + [ + -104.9387179, + 39.80218228 + ], + [ + -104.9394349, + 39.75327832 + ], + [ + -104.9400211, + 39.70483598 + ], + [ + -104.9406978, + 39.65662621 + ], + [ + -104.9412063, + 39.60882697 + ], + [ + -104.94199, + 39.56114115 + ], + [ + -104.9429155, + 39.51371447 + ], + [ + -104.9433825, + 39.46682092 + ], + [ + -104.9436075, + 39.42030036 + ], + [ + -104.9441694, + 39.37382041 + ], + [ + -104.9450015, + 39.32748833 + ], + [ + -104.9454518, + 39.28152803 + ], + [ + -104.9459165, + 39.23581207 + ], + [ + -104.9476415, + 39.18976879 + ], + [ + -104.9485045, + 39.14430328 + ], + [ + -104.9491347, + 39.09911019 + ], + [ + -104.9500794, + 39.05402796 + ], + [ + -104.9507337, + 39.00920829 + ], + [ + -104.9506689, + 38.96469654 + ] + ] + ] + ] + }, + "properties": { + "bands": [ + { + "common_name": "COASTAL", + "gsd": 2.047, + "center_wavelength": 427.0, + "effective_bandwidth": 62.0 + }, + { + "common_name": "Blue", + "gsd": 2.047, + "center_wavelength": 478.0, + "effective_bandwidth": 73.0 + }, + { + "common_name": "Green", + "gsd": 2.047, + "center_wavelength": 546.0, + "effective_bandwidth": 80.0 + }, + { + "common_name": "Yellow", + "gsd": 2.047, + "center_wavelength": 608.0, + "effective_bandwidth": 48.0 + }, + { + "common_name": "Red", + "gsd": 2.047, + "center_wavelength": 659.0, + "effective_bandwidth": 70.0 + }, + { + "common_name": "RedEdge", + "gsd": 2.047, + "center_wavelength": 724.0, + "effective_bandwidth": 50.0 + }, + { + "common_name": "NIR", + "gsd": 2.047, + "center_wavelength": 833.0, + "effective_bandwidth": 136.0 + }, + { + "common_name": "NIR", + "gsd": 2.047, + "center_wavelength": 949.0, + "effective_bandwidth": 187.0 + }, + { + "common_name": "PAN", + "gsd": 0.512, + "center_wavelength": 627.0, + "effective_bandwidth": 361.0 + } + ], + "startDateTime": "2015-11-09T18:04:44.203Z", + "endDateTime": "2015-11-09T18:04:44.203Z", + "links": [ + { + "rel": "self", + "href": "uri of self" + } + ], + "feature_type": [ + "GBDXCatalogRecord", + "Acquisition", + "DigitalGlobeAcquisition", + "WV02" + ], + "offNadirAngle_min": 17.4232692718506, + "offNadirAngle_start": 17.4232692718506, + "targetAzimuth_min": 39.8670921325684, + "multiResolution_min": 2.01992535591125, + "cloudCover": 8, + "sunAzimuth_max": 168.897964477539, + "targetAzimuth": 52.0153427124023, + "multiResolution": 2.11924600601196, + "catalogID": "103001004B316600", + "panResolution_max": 0.562737643718719, + "timestamp": "2015-11-09T18:04:44.203Z", + "sunAzimuth_min": 168.697967529297, + "targetAzimuth_max": 68.5699844360352, + "sunAzimuth": 168.800811767578, + "sunElevation_min": 32.4971733093262, + "offNadirAngle": 21.3762378692627, + "stereoPair": null, + "platformName": "WORLDVIEW02", + "multiResolution_start": 2.01992535591125, + "sunElevation": 33.0273399353027, + "scanDirection": "Reverse", + "panResolution_end": 0.562737643718719, + "panResolution_start": 0.505126416683197, + "targetAzimuth_end": 39.8670921325684, + "panResolution_min": 0.505126416683197, + "offNadirAngle_max": 25.6806030273438, + "multiResolution_end": 2.24830341339111, + "multiResolution_max": 2.24830341339111, + "sunElevation_max": 33.5694541931152, + "offNadirAngle_end": 25.6806030273438, + "panResolution": 0.530210316181183, + "footprintWkt": "MULTIPOLYGON(((-104.9506689 38.96469654, -105.1608127 38.95840828, -105.1610212 39.00241359, -105.1609342 39.04661305, -105.1605798 39.09107845, -105.1603734 39.13571925, -105.1606414 39.18033946, -105.160482 39.22534091, -105.1617257 39.26986031, -105.1614253 39.31538951, -105.1608883 39.3612619, -105.1613922 39.40685628, -105.163213 39.45187733, -105.1635238 39.4980186, -105.1622525 39.54545705, -105.1624777 39.59229898, -105.1624785 39.63959411, -105.1636219 39.68637975, -105.1634848 39.73439091, -105.1637438 39.78249578, -105.1642909 39.83069735, -105.1649241 39.87919405, -105.165344 39.92821627, -105.1659454 39.97750376, -105.1659608 40.02059078, -104.9357658 40.04463773, -104.9362418 40.00097208, -104.9371883 39.95044437, -104.9376547 39.90071155, -104.9380541 39.85136537, -104.9387179 39.80218228, -104.9394349 39.75327832, -104.9400211 39.70483598, -104.9406978 39.65662621, -104.9412063 39.60882697, -104.94199 39.56114115, -104.9429155 39.51371447, -104.9433825 39.46682092, -104.9436075 39.42030036, -104.9441694 39.37382041, -104.9450015 39.32748833, -104.9454518 39.28152803, -104.9459165 39.23581207, -104.9476415 39.18976879, -104.9485045 39.14430328, -104.9491347 39.09911019, -104.9500794 39.05402796, -104.9507337 39.00920829, -104.9506689 38.96469654)))", + "targetAzimuth_start": 68.5699844360352, + "sensorPlatformName": "WORLDVIEW02", + "plaform": "WV02", + "instrument": "VNIR", + "provider": "DigitalGlobe", + "license": "(C) COPYRIGHT 2016 DigitalGlobe, Inc., Longmont CO USA 80503" + } +} \ No newline at end of file diff --git a/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_mul.json b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_mul.json new file mode 100644 index 000000000..87375b272 --- /dev/null +++ b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_mul.json @@ -0,0 +1,198 @@ +{ + "id": "103001004B316600_P002_MUL", + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -105.160846396, + 39.1656009422 + ], + [ + -104.947574355, + 39.1750024943 + ], + [ + -104.949890373, + 39.0512153242 + ], + [ + -105.161151214, + 39.0436821016 + ], + [ + -105.160846396, + 39.1656009422 + ] + ] + ] + ] + }, + "assets": [ + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.TIF", + "metadata": { + "filetype": "geotif", + "content": "image", + "processing": { + "RadiometricallyCorrected": true + } + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.IMD", + "metadata": { + "filetype": "imd", + "content": "image metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.XML", + "metadata": { + "filetype": "xml", + "content": "image metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.TIL", + "metadata": { + "filetype": "til", + "content": "virtual raster image" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.ATT", + "metadata": { + "filetype": "att", + "content": "attitude metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.EPH", + "metadata": { + "filetype": "eph", + "content": "ephemeral metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.GEO", + "metadata": { + "filetype": "geo", + "content": "geospatial metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.RPB", + "metadata": { + "filetype": "rpb", + "content": "rational polynomial metadata" + } + }, + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.JPG", + "metadata": { + "filetype": "jpeg", + "content": "thumbnail" + } + } + ], + "properties": { + "bands": [ + { + "common_name": "COASTAL", + "gsd": 2.047, + "center_wavelength": 427.0, + "effective_bandwidth": 62.0, + "image_band_index": 0 + }, + { + "common_name": "Blue", + "gsd": 2.047, + "center_wavelength": 478.0, + "effective_bandwidth": 73.0, + "image_band_index": 1 + }, + { + "common_name": "Green", + "gsd": 2.047, + "center_wavelength": 546.0, + "effective_bandwidth": 80.0, + "image_band_index": 2 + }, + { + "common_name": "Yellow", + "gsd": 2.047, + "center_wavelength": 608.0, + "effective_bandwidth": 48.0, + "image_band_index": 3 + }, + { + "common_name": "Red", + "gsd": 2.047, + "center_wavelength": 659.0, + "effective_bandwidth": 70.0, + "image_band_index": 4 + }, + { + "common_name": "RedEdge", + "gsd": 2.047, + "center_wavelength": 724.0, + "effective_bandwidth": 50.0, + "image_band_index": 5 + }, + { + "common_name": "NIR", + "gsd": 2.047, + "center_wavelength": 833.0, + "effective_bandwidth": 136.0, + "image_band_index": 6 + }, + { + "common_name": "NIR", + "gsd": 2.047, + "center_wavelength": 949.0, + "effective_bandwidth": 187.0, + "image_band_index": 7 + } + ], + "feature_type": [ + "GBDXCatalogRecord", + "WV02", + "DigitalGlobeProduct", + "1BProduct" + ], + "sunAzimuth": 168.7, + "cloudCover": 0, + "catalogID": "103001004B316600", + "offNadirAngle": 18.4, + "platformName": "WORLDVIEW02", + "sunElevation": 33.4, + "soli": "056823192", + "part": 2, + "resolution": 2.047, + "footprintWkt": "MULTIPOLYGON(((-105.160846396 39.1656009422, -104.947574355 39.1750024943, -104.949890373 39.0512153242, -105.161151214 39.0436821016, -105.160846396 39.1656009422)))", + "sensorPlatformName": "WORLDVIEW02", + "productLevel": "LV1B", + "product": "WORLDVIEW02_LV1B", + "startDateTime": "2015-11-09T18:04:46.000Z", + "endDateTime": "2015-11-09T18:04:46.000Z", + "links": [ + { + "rel": "self", + "href": "my url" + }, + { + "rel": "thumbnail", + "href": "https://15NOV09180446-M1BS-056823192010_01_P002.JPG" + }, + { + "rel": "acquisition", + "href": "uri of acquisition" + } + ], + "provider": "DigitalGlobe", + "license": "(C) COPYRIGHT 2016 DigitalGlobe, Inc., Longmont CO USA 80503" + } +} \ No newline at end of file diff --git a/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_pan.json b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_pan.json new file mode 100644 index 000000000..d0dca30e7 --- /dev/null +++ b/static-catalog/implementations/DigitalGlobe/examples/DigitalGlobe_1B_product_pan.json @@ -0,0 +1,151 @@ +{ + "id": "103001004B316600_P002_MUL", + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -105.160846396, + 39.1656009422 + ], + [ + -104.947574355, + 39.1750024943 + ], + [ + -104.949890373, + 39.0512153242 + ], + [ + -105.161151214, + 39.0436821016 + ], + [ + -105.160846396, + 39.1656009422 + ] + ] + ] + ] + }, + "assets": [ + { + "uri": "https://15NOV09180446-M1BS-056823192010_01_P002.TIF", + "metadata": { + "filetype": "geotif", + "content": "image", + "processing": { + "RadiometricallyCorrected": true + } + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.IMD", + "metadata": { + "filetype": "imd", + "content": "image metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.XML", + "metadata": { + "filetype": "xml", + "content": "image metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.TIL", + "metadata": { + "filetype": "til", + "content": "virtual raster image" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.ATT", + "metadata": { + "filetype": "att", + "content": "attitude metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.EPH", + "metadata": { + "filetype": "eph", + "content": "ephemeral metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.GEO", + "metadata": { + "filetype": "geo", + "content": "geospatial metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.RPB", + "metadata": { + "filetype": "rpb", + "content": "rational polynomial metadata" + } + }, + { + "uri": "https://15NOV09180446-P1BS-056823192010_01_P002.JPG", + "metadata": { + "filetype": "jpeg", + "content": "thumbnail" + } + } + ], + "properties": { + "bands": [ + { + "common_name": "PAN", + "gsd": 0.512, + "center_wavelength": 627.0, + "effective_bandwidth": 361.0, + "image_band_index": 0 + } + ], + "schema": "DigitalGlobeProduct", + "type": [ + "GBDXCatalogRecord", + "WV02", + "DigitalGlobeProduct", + "1BProduct" + ], + "sunAzimuth": 168.7, + "cloudCover": 0, + "catalogID": "103001004B316600", + "offNadirAngle": 18.4, + "platformName": "WORLDVIEW02", + "sunElevation": 33.4, + "vendor": "DigitalGlobe", + "soli": "056823192", + "part": 2, + "resolution": 0.512, + "footprintWkt": "MULTIPOLYGON(((-105.160592519 39.1656280221, -104.947914192 39.175001527, -104.950215937 39.0512085534, -105.16088661 39.0436989637, -105.160592519 39.1656280221)))", + "sensorPlatformName": "WORLDVIEW02", + "productLevel": "LV1B", + "product": "WORLDVIEW02_LV1B", + "startDateTime": "2015-11-09T18:04:46.000Z", + "endDateTime": "2015-11-09T18:04:46.000Z", + "links": [ + { + "rel": "self", + "href": "my url" + }, + { + "rel": "thumbnail", + "href": "https://15NOV09180446-P1BS-056823192010_01_P002.JPG" + }, + { + "rel": "acquisition", + "href": "uri of acquisition" + } + ], + "provider": "DigitalGlobe", + "license": "(C) COPYRIGHT 2016 DigitalGlobe, Inc., Longmont CO USA 80503" + } +} \ No newline at end of file diff --git a/static-catalog/implementations/__init__.py b/static-catalog/implementations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/static-catalog/json-schema/geojson.json b/static-catalog/json-schema/geojson.json new file mode 100644 index 000000000..1a33a21d4 --- /dev/null +++ b/static-catalog/json-schema/geojson.json @@ -0,0 +1,353 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "geojson.json#", + "title": "GeoJSON Object", + "type": "object", + "description": + "This object represents a geometry, feature, or collection of features.", + "additionalProperties": true, + "required": ["type"], + + "properties": { + "type": { + "title": "Type", + "type": "string", + "description": "The type of GeoJSON object.", + "enum": [ + "Point", + "MultiPoint", + "LineString", + "MultiLineString", + "Polygon", + "MultiPolygon", + "GeometryCollection", + "Feature", + "FeatureCollection" + ] + }, + + "crs": { + "title": "Coordinate Reference System (CRS)", + "description": + "The coordinate reference system (CRS) of a GeoJSON object is determined by its `crs` member (referred to as the CRS object below). If an object has no crs member, then its parent or grandparent object's crs member may be acquired. If no crs member can be so acquired, the default CRS shall apply to the GeoJSON object.\n\n* The default CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees.\n\n* The value of a member named `crs` must be a JSON object (referred to as the CRS object below) or JSON null. If the value of CRS is null, no CRS can be assumed.\n\n* The crs member should be on the top-level GeoJSON object in a hierarchy (in feature collection, feature, geometry order) and should not be repeated or overridden on children or grandchildren of the object.\n\n* A non-null CRS object has two mandatory members: `type` and `properties`.\n\n* The value of the type member must be a string, indicating the type of CRS object.\n\n* The value of the properties member must be an object.\n\n* CRS shall not change coordinate ordering.", + + "oneOf": [ + { "type": "null" }, + { + "type": "object", + "required": ["type", "properties"], + "properties": { + "type": { + "title": "CRS Type", + "type": "string", + "description": + "The value of the type member must be a string, indicating the type of CRS object.", + "minLength": 1 + }, + "properties": { + "title": "CRS Properties", + "type": "object" + } + } + } + ], + + "not": { + "anyOf": [ + { + "properties": { + "type": { "enum": ["name"] }, + "properties": { + "not": { + "required": ["name"], + "properties": { + "name": { + "type": "string", + "minLength": 1 + } + } + } + } + } + }, + + { + "properties": { + "type": { "enum": ["link"] }, + "properties": { + "not": { + "title": "Link Object", + "type": "object", + "required": ["href"], + "properties": { + "href": { + "title": "href", + "type": "string", + "description": + "The value of the required `href` member must be a dereferenceable URI.", + "format": "uri" + }, + + "type": { + "title": "Link Object Type", + "type": "string", + "description": + "The value of the optional `type` member must be a string that hints at the format used to represent CRS parameters at the provided URI. Suggested values are: `proj4`, `ogcwkt`, `esriwkt`, but others can be used." + } + } + } + } + } + } + ] + } + }, + + "bbox": { + "title": "Bounding Box", + "type": "array", + "description": + "To include information on the coordinate range for geometries, features, or feature collections, a GeoJSON object may have a member named `bbox`. The value of the bbox member must be a 2*n array where n is the number of dimensions represented in the contained geometries, with the lowest values for all axes followed by the highest values. The axes order of a bbox follows the axes order of geometries. In addition, the coordinate reference system for the bbox is assumed to match the coordinate reference system of the GeoJSON object of which it is a member.", + "minItems": 4, + "items": { + "type": "number" + } + } + }, + + "oneOf": [ + { + "title": "Point", + "description": + "For type `Point`, the `coordinates` member must be a single position.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["Point"] }, + "coordinates": { + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { "$ref": "#/definitions/position" } + ] + } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "Multi Point Geometry", + "description": + "For type `MultiPoint`, the `coordinates` member must be an array of positions.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["MultiPoint"] }, + "coordinates": { + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { + "items": { "$ref": "#/definitions/position" } + } + ] + } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "Line String", + "description": + "For type `LineString`, the `coordinates` member must be an array of two or more positions.\n\nA LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["LineString"] }, + "coordinates": { "$ref": "#/definitions/lineStringCoordinates" } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "MultiLineString", + "description": + "For type `MultiLineString`, the `coordinates` member must be an array of LineString coordinate arrays.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["MultiLineString"] }, + "coordinates": { + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { + "items": { "$ref": "#/definitions/lineStringCoordinates" } + } + ] + } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "Polygon", + "description": + "For type `Polygon`, the `coordinates` member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["Polygon"] }, + "coordinates": { "$ref": "#/definitions/polygonCoordinates" } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "Multi-Polygon Geometry", + "description": + "For type `MultiPolygon`, the `coordinates` member must be an array of Polygon coordinate arrays.", + "required": ["coordinates"], + "properties": { + "type": { "enum": ["MultiPolygon"] }, + "coordinates": { + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { + "items": { "$ref": "#/definitions/polygonCoordinates" } + } + ] + } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { + "title": "Geometry Collection", + "description": + "A GeoJSON object with type `GeometryCollection` is a geometry object which represents a collection of geometry objects.\n\nA geometry collection must have a member with the name `geometries`. The value corresponding to `geometries` is an array. Each element in this array is a GeoJSON geometry object.", + "required": ["geometries"], + "properties": { + "type": { "enum": ["GeometryCollection"] }, + "geometries": { + "title": "Geometries", + "type": "array", + "items": { "$ref": "#/definitions/geometry" } + } + }, + "allOf": [{ "$ref": "#/definitions/geometry" }] + }, + + { "$ref": "#/definitions/feature" }, + + { "$ref": "#/definitions/featurecollection" } + ], + + "definitions": { + "coordinates": { + "title": "Coordinates", + "type": "array", + "items": { + "oneOf": [{ "type": "array" }, { "type": "number" }] + } + }, + + "geometry": { + "title": "Geometry", + "description": + "A geometry is a GeoJSON object where the type member's value is one of the following strings: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, or `GeometryCollection`.", + "properties": { + "type": { + "enum": [ + "Point", + "MultiPoint", + "LineString", + "MultiLineString", + "Polygon", + "MultiPolygon", + "GeometryCollection" + ] + } + } + }, + + "feature": { + "title": "Feature", + "description": + "A GeoJSON object with the type `Feature` is a feature object.\n\n* A feature object must have a member with the name `geometry`. The value of the geometry member is a geometry object as defined above or a JSON null value.\n\n* A feature object must have a member with the name `properties`. The value of the properties member is an object (any JSON object or a JSON null value).\n\n* If a feature has a commonly used identifier, that identifier should be included as a member of the feature object with the name `id`.", + "required": ["geometry", "properties"], + + "properties": { + "type": { "enum": ["Feature"] }, + + "geometry": { + "title": "Geometry", + "oneOf": [{ "$ref": "#/definitions/geometry" }, { "type": "null" }] + }, + + "properties": { + "title": "Properties", + "oneOf": [{ "type": "object" }, { "type": "null" }] + }, + + "id": {} + } + }, + + "featurecollection": { + "title": "Feature Collection", + "description": + "A GeoJSON object with the type `FeatureCollection` is a feature collection object.\n\nAn object of type `FeatureCollection` must have a member with the name `features`. The value corresponding to `features` is an array. Each element in the array is a feature object as defined above.", + "required": ["features"], + "properties": { + "type": { "enum": ["FeatureCollection"] }, + "features": { + "title": "Features", + "type": "array", + "items": { "$ref": "#/definitions/feature" } + } + } + }, + + "linearRingCoordinates": { + "title": "Linear Ring Coordinates", + "description": + "A LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition.", + "allOf": [ + { "$ref": "#/definitions/lineStringCoordinates" }, + { + "minItems": 4 + } + ] + }, + + "lineStringCoordinates": { + "title": "Line String Coordinates", + "description": + "For type `LineString`, the `coordinates` member must be an array of two or more positions.", + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { + "minLength": 2, + "items": { "$ref": "#/definitions/position" } + } + ] + }, + + "polygonCoordinates": { + "title": "Polygon Coordinates", + "description": + "For type `Polygon`, the `coordinates` member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.", + "allOf": [ + { "$ref": "#/definitions/coordinates" }, + { + "items": { "$ref": "#/definitions/linearRingCoordinates" } + } + ] + }, + + "position": { + "title": "Position", + "type": "array", + "description": + "A position is the fundamental geometry construct. The `coordinates` member of a geometry object is composed of one position (in the case of a Point geometry), an array of positions (LineString or MultiPoint geometries), an array of arrays of positions (Polygons, MultiLineStrings), or a multidimensional array of positions (MultiPolygon).\n\nA position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Any number of additional elements are allowed -- interpretation and meaning of additional elements is beyond the scope of this specification.", + "minItems": 2, + "additionalItems": true, + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/static-catalog/json-schema/spatiotemporal_feature.json b/static-catalog/json-schema/spatiotemporal_feature.json new file mode 100644 index 000000000..718d700c8 --- /dev/null +++ b/static-catalog/json-schema/spatiotemporal_feature.json @@ -0,0 +1,121 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "id": "spatiotemporal_feature.json#", + "title": "STAC static catalog Feature", + "type": "object", + "description": "This object represents the metadata associated with a feature.", + "additionalProperties": true, + "allOf": [ + { + "$ref": "#/definitions/core" + }, + { + "properties": { + "properties": { + "required": [ + "startDateTime", + "endDateTime", + "links", + "provider", + "license" + ] + } + }, + "required": [ + "id", + "type", + "geometry" + ] + } + ], + "definitions": { + "core": { + "allOf": [ + { + "oneOf": [ + { + "$ref": "geojson.json#/definitions/feature" + } + ] + }, + { + "type": "object", + "properties": { + "geometry": { + "properties": { + "type": { + "enum": [ + "Polygon", + "MultiPolygon" + ] + } + } + }, + "id": { + "title": "Provider ID", + "description": "Provider item ID", + "type": "string" + }, + "properties": { + "type": "object", + "properties": { + "startDateTime": { + "title": "Date Start", + "description": "First date/time", + "type": "string", + "format": "date-time" + }, + "endDateTime": { + "title": "Date End", + "description": "Last date/time", + "type": "string", + "format": "date-time" + }, + "provider": { + "title": "Provider", + "description": "Provider name and contact", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/entity" + } + ] + }, + "license": { + "title": "Data license", + "description": "Data license name based on SPDX License List" + }, + "links": { + "title": "Resource links", + "description": "Links to resources, could be download or other URLs", + "type": "array" + } + } + } + } + } + ] + }, + "entity": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "phone": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/static-catalog/readme.md b/static-catalog/readme.md new file mode 100644 index 000000000..62059a727 --- /dev/null +++ b/static-catalog/readme.md @@ -0,0 +1,6 @@ +# Static Catalog + +A static catalog is an implementation of the STAC specification that is simply a set of files on a web server. The main purpose of the static catalog is to be crawled by various clients. + +* The files of the static catalog will be JSON representations of a [STAC catalog feature](https://github.com/radiantearth/stac-spec/blob/dev/spec/spec.yaml#/definitions/Feature). +These JSON features will conform to are GEOJSON features that further conform to the [spatiotemporial_feature](https://github.com/TDG-Platform/stac-spec/blob/proposed_static_spec/static-catalog/json-schema/spatiotemporal_feature.json) JSON schema