-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMR-7333 - support for DMR++ and DMR++ MISSING DATA URLs in UMM-G
* while testing, the revision_format_map.clj test was failing, it apparently is not stable for local builds. This change will more consistenly pass * updating some comments to make it clear which document type the function is used for * adding two enums to related URL for granules * CMR-7333 - API documentation cleanup to render properly in markdown editors
- Loading branch information
Showing
20 changed files
with
1,752 additions
and
78 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1266,6 +1266,7 @@ __Example Query__ | |
curl "%CMR-ENDPOINT%/autocomplete?q=ice&type[]=platform&type[]=project" | ||
|
||
__Example Result with Type Filter__ | ||
|
||
``` | ||
HTTP/1.1 200 OK | ||
Content-Type: application/json; charset=UTF-8 | ||
|
@@ -1832,17 +1833,17 @@ Shapefile upload is only supported using POST with `multipart/form-data` and the | |
|
||
Examples: | ||
|
||
**ESRI Shapefile** | ||
**ESRI Shapefile** | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "shapefile=@box.zip;type=application/shapefile+zip" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "[email protected];type=application/shapefile+zip" -F "provider=PROV1" | ||
|
||
**GeoJSON** | ||
**GeoJSON** | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "shapefile=@box.geojson;type=application/geo+json" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "[email protected];type=application/geo+json" -F "provider=PROV1" | ||
|
||
**KML** | ||
**KML** | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "shapefile=@box.kml;type=application/vnd.google-earth.kml+xml" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "[email protected];type=application/vnd.google-earth.kml+xml" -F "provider=PROV1" | ||
|
||
Internally a WGS 84 Coordinate Reference System (CRS) is used. The system will attempt to transform shapefile geometry that uses a different CRS, but this is not guaranteed to work and the request will be rejected if a suitable transformation is not found. | ||
|
||
|
@@ -1853,7 +1854,7 @@ Shapefiles are limited to 5000 points by default. A user using a shapefile with | |
|
||
Example: | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "simplify-shapefile=true" -F "shapefile=@africa.zip;type=application/shapefile+zip" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/collections" -F "simplify-shapefile=true" -F "[email protected];type=application/shapefile+zip" -F "provider=PROV1" | ||
|
||
Note that the simplification process attempts to preserve topology, i.e., the relationship between polygon outer boundaries and holes. The process uses the [Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm) and as such may result in geometries with less coverage than the original shapefile and potentially a loss of matching results. | ||
|
||
|
@@ -2106,15 +2107,15 @@ The parameters used for searching granules by spatial are the same as the spatia | |
|
||
As with collections, a shapefile can be uploaded to find granules that overlap the shapefile's geometry. See [Find collections by shapefile](#c-shapefile) for more details. | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/granules" -F "shapefile=@box.zip;type=application/shapefile+zip" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/granules" -F "[email protected];type=application/shapefile+zip" -F "provider=PROV1" | ||
|
||
**NOTE**: This is an experimental feature and may not be enabled in all environments. | ||
|
||
#### <a name="g-shapefile-simplification"></a> Simplifying shapefiles during granule search | ||
|
||
As with collections, an uplodaed shapefile can be simplified by setting the `simplfiy-shapefile` parameter to `true`. See [Simplifying shapefiles during collection search](#c-shapefile-simplification) for more details. | ||
|
||
curl -XPOST "%CMR-ENDPOINT%/granules" -F "simplify-shapefile=true" -F "shapefile=@africa.zip;type=application/shapefile+zip" -F "provider=PROV1" | ||
curl -XPOST "%CMR-ENDPOINT%/granules" -F "simplify-shapefile=true" -F "[email protected];type=application/shapefile+zip" -F "provider=PROV1" | ||
|
||
#### <a name="g-orbit-number"></a> Find granules by orbit number | ||
|
||
|
@@ -2169,7 +2170,7 @@ Find granules which have revision date within the ranges of datetimes. The datet | |
|
||
Find granules which were created within the ranges of datetimes. The datetime has to be in yyyy-MM-ddTHH:mm:ssZ format. The default is inclusive on the range boundaries. | ||
|
||
curl "%CMR-ENDPOINT%/granules?collection_concept_id=%CMR-EXAMPLE-COLLECTION-ID%&created_at\[\]=2000-01-01T10:00:00Z,2010-03-10T12:00:00Z&created_at\[\]=2015-01-01T10:00:00Z," | ||
curl "%CMR-ENDPOINT%/granules?collection_concept_id=%CMR-EXAMPLE-COLLECTION-ID%&created_at\[\]=2000-01-01T10:00:00Z,2010-03-10T12:00:00Z&created_at\[\]=2015-01-01T10:00:00Z," | ||
|
||
#### <a name="g-production-date"></a> Find granules by production_date | ||
|
||
|
@@ -2986,9 +2987,7 @@ Content-Type: application/json; charset=UTF-8 | |
|
||
The humanizers report provides a list of fields that have been humanized in CSV format. The report format is: provider, concept id, product short name, product version, original field value, humanized field value. | ||
|
||
``` | ||
curl "%CMR-ENDPOINT%/humanizers/report" | ||
``` | ||
curl "%CMR-ENDPOINT%/humanizers/report" | ||
|
||
Note that this report is currently generated every 24 hours with the expectation that this more than satisfies weekly usage needs. | ||
|
||
|
@@ -3567,7 +3566,10 @@ These parameters will match fields within a variable. They are case insensitive | |
* options: ignore_case, or | ||
measurement_identifiers parameter is a nested parameter with subfields: contextmedium, object and quantity. Multiple measurement_identifiers can be specified via different indexes to search variables. The following example searches for variables that have at least one measurement_identifier with contextmedium of Med1, object of Object1 and quantity of Q1, and another measurement_identifier with contextmedium of Med2 and object of Obj2. | ||
|
||
curl -g "%CMR-ENDPOINT%/variables?measurement_identifiers\[0\]\[contextmedium\]=Med1&measurement_identifiers\[0\]\[object\]=Object1&measurement_identifiers\[0\]\[quantity\]=Q1&measurement_identifiers\[1\]\[contextmedium\]=med2&measurement_identifiers\[2\]\[object\]=Obj2" | ||
|
||
```` | ||
curl -g "%CMR-ENDPOINT%/variables?measurement_identifiers\[0\]\[contextmedium\]=Med1&measurement_identifiers\[0\]\[object\]=Object1&measurement_identifiers\[0\]\[quantity\]=Q1&measurement_identifiers\[1\]\[contextmedium\]=med2&measurement_identifiers\[2\]\[object\]=Obj2" | ||
```` | ||
|
||
The multiple measurement_identifiers are ANDed by default. User can specify `options[measurement-identifiers][or]=true` to make the measurement_identifiers ORed together. | ||
|
||
|
@@ -3603,6 +3605,7 @@ The `references` field may contain multiple `reference` entries, each consisting | |
| revision-id | the internal CMR version number for the result | | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -i "%CMR-ENDPOINT%/variables?pretty=true&name=Variable1" | ||
|
@@ -3638,6 +3641,7 @@ The JSON response includes the following fields. | |
* long_name | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/variables.json?pretty=true&name=Var*&options[name][pattern]=true" | ||
|
@@ -3669,6 +3673,7 @@ Content-Length: 292 | |
The UMM JSON response contains meta-metadata of the variable, the UMM fields and the associations field if applicable. The associations field only applies when there are collections associated with the variable and will list the collections that are associated with the variable. | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/variables.umm_json?name=Variable1234&pretty=true" | ||
HTTP/1.1 200 OK | ||
|
@@ -3853,6 +3858,7 @@ The `references` field may contain multiple `reference` entries, each consisting | |
| revision-id | the internal CMR version number for the result | | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -i "%CMR-ENDPOINT%/services?name=Service1&pretty=true" | ||
|
@@ -3888,6 +3894,7 @@ The JSON response includes the following fields. | |
* long_name | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/services.json?pretty=true" | ||
|
@@ -3933,6 +3940,7 @@ Content-Length: 944 | |
The UMM JSON response contains meta-metadata of the service and the UMM fields. | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/services.umm_json?name=NSIDC_AtlasNorth&pretty=true" | ||
HTTP/1.1 200 OK | ||
|
@@ -4207,6 +4215,7 @@ The `references` field may contain multiple `reference` entries, each consisting | |
| revision-id | the internal CMR version number for the result | | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -i "%CMR-ENDPOINT%/tools?name=someTool1&pretty=true" | ||
|
@@ -4242,6 +4251,7 @@ The JSON response includes the following fields. | |
* long_name | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/tools.json?pretty=true" | ||
|
@@ -4273,6 +4283,7 @@ Content-Length: 944 | |
The UMM JSON response contains meta-metadata of the tool and the UMM fields. | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/tools.umm_json?name=NSIDC_AtlasNorth&pretty=true" | ||
HTTP/1.1 200 OK | ||
|
@@ -4558,6 +4569,7 @@ The `references` field may contain multiple `reference` entries, each consisting | |
| revision-id | the internal CMR version number for the result | | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -i "%CMR-ENDPOINT%/subscriptions?name=someSub1&pretty=true" | ||
|
@@ -4594,6 +4606,7 @@ The JSON response includes the following fields. | |
* collection_concept_id | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/subscriptions.json?pretty=true" | ||
|
@@ -4627,6 +4640,7 @@ Content-Length: 944 | |
The UMM JSON response contains meta-metadata of the subscription and the UMM fields. | ||
|
||
__Example__ | ||
|
||
``` | ||
curl -g -i "%CMR-ENDPOINT%/subscriptions.umm_json?name=NSIDC_AtlasNorth&pretty=true" | ||
HTTP/1.1 200 OK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(ns cmr.umm.test.echo10.related-url | ||
"Tests functions for granule related urls" | ||
(:require | ||
[clojure.test :refer :all] | ||
[cmr.common.util :as util :refer [are3]] | ||
[cmr.umm.echo10.related-url :as rurl])) | ||
|
||
(deftest validate-xml | ||
(testing | ||
"Validate that the related-url->online-resource function correctly returns | ||
subtypes for the DMR use cases" | ||
(are3 [expected actual-type actual-subtype] | ||
(is (= expected | ||
(#'rurl/related-url->online-resource {:type actual-type | ||
:sub-type actual-subtype}))) | ||
"Extended metadata with DMR++" | ||
"EXTENDED METADATA : DMR++" | ||
"EXTENDED METADATA" | ||
"DMR++" | ||
|
||
"Extended metadata with DMR++ Missing Data" | ||
"EXTENDED METADATA : DMR++ MISSING DATA" | ||
"EXTENDED METADATA" | ||
"DMR++ MISSING DATA" | ||
|
||
"A future case of extended metadata which should not be changed" | ||
"USER SUPPORT" | ||
"EXTENDED METADATA" | ||
"Future Kathryn Janeway" | ||
|
||
"User support case for existing types" | ||
"USER SUPPORT" | ||
"DOWNLOAD SOFTWARE" | ||
"APP" | ||
|
||
"User support should be assumed for a nil" | ||
"USER SUPPORT" | ||
"type" | ||
nil | ||
|
||
"User support should be assumed for a nil" | ||
"USER SUPPORT" | ||
nil | ||
"sub" | ||
|
||
"User support should be assumed for a nil" | ||
"USER SUPPORT" | ||
nil | ||
nil))) |
Oops, something went wrong.