You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMR-10210: Fix 502 gateway error on cmr-stac index.html/documentation & CMR-10208: Add content type in stac response to match service-desc (#384)
* CMR-10210: Try regenerating documentation with redocly
* CMR-10210: Clean up more markdown linter warnings; add documentation on using the stac validator
* CMR-10210: Add note about using the stac-validator
* CMR-10210: Update the type field for the rootcatalog service-desc response
* CMR-10208: Update mimetype for documentation endpoint with the correct Iana spec
* EDSC-10210: Update media type for `service-desc` to `application/yaml`
-[CMR-STAC](https://cmr.earthdata.nasa.gov/stac): The entire catalog of NASA CMR data, organized by provider.
29
+
25
30
-[CMR-CLOUDSTAC](https://cmr.earthdata.nasa.gov/cloudstac): Also organized by provider, this API only contains STAC Collections where the Item Assets are available "in the cloud" (i.e., on S3).
26
31
27
32
### Navigating
33
+
28
34
CMR-STAC can be navigated manually using the endpoints provided above, or you can utilize available STAC software to browse and use the API.
29
35
30
36
A common STAC utility is Radiant Earth's `stac-browser` to use this tool against your development server navigate to
@@ -33,13 +39,17 @@ A common STAC utility is Radiant Earth's `stac-browser` to use this tool against
33
39
See the [Usage Documentation](docs/usage/usage.md) for examples of how to interact with the API and search for data.
34
40
35
41
### Limitations
42
+
36
43
While CMR-STAC provides some advantages over the CMR, there are some limitations that you should be aware of:
44
+
37
45
- Limited search functionality: CMR-STAC does not support all of the search capabilities that CMR provides. For example, with CMR, you can search for data based on temporal and spatial criteria, as well as specific parameters such as platform, instrument, and granule size. However, with CMR-STAC, you can only search based on the STAC standard.
38
46
- Limited metadata availability: CMR-STAC only provides metadata that follows the STAC specification. While this metadata is very rich and comprehensive, it may not provide all of the information that you need for your specific use case.
Copy file name to clipboardExpand all lines: docs/README.md
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
##CMR-STAC Development
1
+
# CMR-STAC Development
2
2
3
3
CMR-STAC is a Node.js application built on the [Express.js framework](https://expressjs.com/) and deployed as an AWS serverless application using API Gateway + Lambda. This README is intended for developers who want to contribute to CMR-STAC, or set up a development environment for it.
4
4
5
5
The remainder of this README is documentation for developing, testing, and deploying CMR-STAC. See the [Usage documentation](../docs/usage/usage.md) if you are interested in using the CMR-STAC API.
6
6
7
-
###Repository Structure
7
+
## Repository Structure
8
8
9
9
| Directory | Description |
10
10
| -------------------- | ------------ |
@@ -14,6 +14,7 @@ The remainder of this README is documentation for developing, testing, and deplo
14
14
|[usage](../docs/usage/usage.md)| Documentation on usage of the CMR-STAC endpoint(s) |
15
15
16
16
## Getting Started
17
+
17
18
### Setup
18
19
19
20
Set the correct NodeJS version (specified in [.nvmrc](../.nvmrc) required
@@ -49,11 +50,38 @@ npm run dev
49
50
50
51
This will run the process in the current terminal session, the local server will be available at:
51
52
52
-
```
53
+
```bash
53
54
http://localhost:3000/stac
54
55
http://localhost:3000/cloudstac
55
56
```
56
57
58
+
### Creating index.html from Swagger.json
59
+
60
+
To Create the index.html located in docs/index we can use the `redocly` service
61
+
the most straightforward way to do this is to use the cli tool against our `swagger.json` file
62
+
63
+
```bash
64
+
npx @redocly/cli build-docs swagger.json
65
+
```
66
+
67
+
### Testing STAC validation
68
+
69
+
We can test our API both locally and on deployed instance against the on a stac-validation service using the <https://github.com/stac-utils/stac-api-validator> tool
70
+
71
+
The tool can be installed using pip and requires a Python runtime
72
+
73
+
```bash
74
+
pip install stac-api-validator
75
+
```
76
+
77
+
```bash
78
+
stac-api-validator\
79
+
--root-url http://localhost:3000/stac/CMR_ONLY \
80
+
--conformance core
81
+
```
82
+
83
+
this can be extended to validate against additional conformance APIs
84
+
57
85
### Deploying
58
86
59
87
The deployment is handled via the [Serverless Framework](https://serverless.com). Each service has a
@@ -85,4 +113,4 @@ npm run deploy:docs -- --stage <sit|uat|prod>
| /{provider-id}/collections | Returns a Catalog of all Collections that belong to the indicated provider |
59
-
| /{provider-id}/collections/{collection-id} | Returns the individual Collection indicated in the path |
60
-
| /{provider-id}/collections/{collection-id}/items | Returns an ItemCollection of all Items contained in the indicated Collection |
61
-
| /{provider-id}/collections/{collection-id}/items/{item-id} | Returns the individual Item indicated in the path |
58
+
| /{provider-id}/collections | Returns a Catalog of all Collections that belong to the indicated provider |
59
+
| /{provider-id}/collections/{collection-id} | Returns the individual Collection indicated in the path |
60
+
| /{provider-id}/collections/{collection-id}/items | Returns an ItemCollection of all Items contained in the indicated Collection |
61
+
| /{provider-id}/collections/{collection-id}/items/{item-id} | Returns the individual Item indicated in the path |
62
62
63
63
For example, if a user wanted to get all the collections under the ASF provider, the user would hit:
64
64
@@ -88,7 +88,8 @@ Each Item returned from CMR-STAC includes a series of links as well:
88
88
| via | The original CMR metadata used to generate the STAC metadata returned |
89
89
90
90
## Browsing
91
-
The first thing to do when getting familiar with CMR-STAC is to browse through the catalog and get a sense for its structure, and what types of data (Collections and Items) are available.
91
+
92
+
The first thing to do when getting familiar with CMR-STAC is to browse through the catalog and get a sense for its structure, and what types of data (Collections and Items) are available.
92
93
The easiest way to browse is to install a JSON extension for your browser of choice (e.g., [JSON Formatter](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa/related) for Chrome).
Similar to searching for Items, CMR-STAC provides endpoints to search for Collections. Both GET and POST requests are supported for collection searches.
143
145
144
146
| Parameter | Type | Description |
@@ -152,7 +154,6 @@ Similar to searching for Items, CMR-STAC provides endpoints to search for Collec
0 commit comments