Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4187315
Improve partial item editing / enabling of Transactions extensions
Apr 21, 2020
ac1bc0d
Change ENABLE_TRANSACTIONS_EXTENSION to false by default
Apr 21, 2020
4bc62c2
Change ENABLE_TRANSACTIONS_EXTENSION to false by default
Apr 21, 2020
0ec2e46
Merge pull request #37 from seanmurph/feature/edit-api-improvements
matthewhanson Apr 22, 2020
ac721b8
update naming to stac-server
matthewhanson Apr 28, 2020
229ca10
pass collection id to query by id
matthewhanson Apr 28, 2020
cb673f3
update elasticsearch client, resolves #33
matthewhanson Apr 29, 2020
9e25758
add changelog
matthewhanson Apr 29, 2020
96d8ee8
consolidate index creation functions
matthewhanson Apr 29, 2020
ad23dec
remove merging of collection properties with items on ingest
matthewhanson Apr 29, 2020
164d6fd
reorganize backend elasticsearch modules
matthewhanson Apr 29, 2020
a38a077
refactor to make each collection its own elasticsearch index
matthewhanson Apr 29, 2020
a9ab48b
more updaes to change stac-api -> stac-server
matthewhanson Apr 30, 2020
987bc7c
update descriptions in serverless config
matthewhanson Apr 30, 2020
41412af
update package-lock
matthewhanson Apr 30, 2020
161f8e2
remove reserved concurrency
matthewhanson May 5, 2020
b0e9958
add back in created and updated properties
matthewhanson May 7, 2020
07bdcc5
fix next page link, resolves #43
matthewhanson May 7, 2020
d3da433
add published topic
matthewhanson May 7, 2020
8a79eee
fix envvar for published sns
matthewhanson May 7, 2020
9d6421f
add published topic policy
matthewhanson May 7, 2020
917e253
add publih option to ingest lambda
matthewhanson May 7, 2020
aec9901
fix created and updated timestamps
matthewhanson May 31, 2020
9552d90
remove publish_topic
matthewhanson May 31, 2020
aea0a49
do not add created and updated to collections
matthewhanson Jun 10, 2020
6f7af38
remove published topic option
matthewhanson Jun 10, 2020
ef7b9e7
remove subscribe-to-sns lambda
matthewhanson Jun 10, 2020
6dd24e2
Merge branch 'develop' of github.com:stac-utils/stac-server into develop
matthewhanson Jun 10, 2020
9eb88f7
bump node version
matthewhanson Jun 10, 2020
ef10e39
update pagination for spec, resolves #47
matthewhanson Aug 19, 2020
8f096b2
update returned collections response, resolves #46
matthewhanson Aug 19, 2020
8e40161
fix envvar for root url
matthewhanson Aug 19, 2020
7abbabd
update default stac version
matthewhanson Aug 19, 2020
9cc53dc
add stac_api_version
matthewhanson Aug 19, 2020
20dbec2
set merge false in next and prev pagelinks
matthewhanson Aug 20, 2020
57422d0
fix stub in test for getCollections
matthewhanson Aug 21, 2020
76335d6
tests fix
matthewhanson Aug 21, 2020
b4073fe
test update
matthewhanson Aug 21, 2020
935a10a
add test debug statement
matthewhanson Aug 21, 2020
ac34656
update failing tests
matthewhanson Aug 21, 2020
cba25b3
update version
matthewhanson Aug 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.14
12.18
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
- Partial STAC transaction extension added, disabled by default - set ENABLE_TRANSACTIONS_EXTENSION=true to enable

### Changed
- Name changed from 'stac-api' to 'stac-server' to avoid confusion with [stac-api-spec](https://github.com/radiantearth/stac-api-spec)
- Elasticsearch client library updated to @elastic/elasticsearch

### Removed
- Collection properties no longer merged into Item on ingest (commons extension removed from STAC)


## [0.1.0] - 2020-03-20

Initial release, forked from [sat-api](https://github.com/sat-utils/sat-api/tree/develop).
Expand Down
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# stac-api
# stac-server

![](https://github.com/stac-utils/stac-api/workflows/Push%20Event/badge.svg)
![](https://github.com/stac-utils/stac-server/workflows/Push%20Event/badge.svg)

Stac-api is a STAC compliant Rest API for searching and serving metadata for geospatial data (including but not limited to satellite imagery). The STAC version supported by a given version of stac-api is shown in the table below. Additional information can be found in the [CHANGELOG](CHANGELOG.md)
Stac-server is a STAC compliant Rest API for searching and serving metadata for geospatial data (including but not limited to satellite imagery). The STAC version supported by a given version of stac-api is shown in the table below. Additional information can be found in the [CHANGELOG](CHANGELOG.md)

| stac-api Version | STAC Version |
| stac-server Version | STAC Version |
| -------- | ---- |
| 0.1.0 | 0.9.x |

The following APIs are deployed instances of stac-api:
The following APIs are deployed instances of stac-server:

| Name | Version | Description |
| -------- | ---- | ---- |
Expand All @@ -17,7 +17,7 @@ The following APIs are deployed instances of stac-api:

## Usage

Stac-api is a RESTful API that returns JSON, see the [documentation](http://stac-utils.github.io/stac-api), or the /api endpoint which is a self-documenting OpenAPI document. Here are some additional tools that might prove useful:
Stac-server is a RESTful API that returns JSON, see the [documentation](http://stac-utils.github.io/stac-server), or the /api endpoint which is a self-documenting OpenAPI document. Here are some additional tools that might prove useful:

- [JSONView Chrome Extension](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en): Useful for exploring the API in the browser.
- [sat-search](https://github.com/sat-utils/sat-search): A Python client library and CLI for searching a STAC compliant API
Expand All @@ -28,25 +28,27 @@ Stac-api is a RESTful API that returns JSON, see the [documentation](http://stac

This repository contains Node libraries for running the API, along with a [serverless](https://serverless.com/) configuration file for deployment to AWS.

To create your own deployment of stac-api, first clone the repository:
To create your own deployment of stac-server, first clone the repository:

```
$ git clone https://github.com/stac-utils/stac-api.git
$ cd stac-api
$ git clone https://github.com/stac-utils/stac-server.git
$ cd stac-server
```

There are some settings that should be reviewed and updated as needeed in the [serverless config file](serverless.yml), under provider->environment:

| Name | Description | Default Value |
| ---- | ----------- | ------------- |
| STAC_VERSION | STAC Version of this STAC API | 0.9.0 |
| STAC_ID | ID of this catalog | stac-api |
| STAC_VERSION | STAC Version of this STAC API | 1.0.0-beta.2 |
| STAC_API_VERSION | STAC API Version of this STAC API | 0.9.0 |
| STAC_ID | ID of this catalog | stac-server |
| STAC_TITLE | Title of this catalog | STAC API |
| STAC_DESCRIPTION | Description of this catalog | A STAC API |
| STAC_DOCS_URL | URL to documentation | [https://stac-utils.github.io/stac-api](https://stac-utils.github.io/stac-api) |
| STAC_DOCS_URL | URL to documentation | [https://stac-utils.github.io/stac-server](https://stac-utils.github.io/stac-server) |
| ES_BATCH_SIZE | Number of records to ingest in single batch | 500 |
| LOG_LEVEL | Level for logging (CRITICAL, ERROR, WARNING, INFO, DEBUG) | INFO |
| STAC_API_URL | The root endpoint of this API | Inferred from request |
| ENABLE_TRANSACTIONS_EXTENSION | Boolean specifying if the [Transaction Extension](https://github.com/radiantearth/stac-api-spec/tree/master/extensions/transaction) should be activated | false |

After reviewing the settings, build and deploy the project.

Expand All @@ -56,7 +58,7 @@ $ npm run build
$ npm run deploy
```

This will create a CloudFormation stack in the `us-west-2` region called `stac-api-dev`. To change the region or the stage name (from `dev`) provide arguments to the deploy command (note the additional `--` in the command, required by `npm` to provide arguments):
This will create a CloudFormation stack in the `us-west-2` region called `stac-server-dev`. To change the region or the stage name (from `dev`) provide arguments to the deploy command (note the additional `--` in the command, required by `npm` to provide arguments):

```
$ npm run deploy -- --stage mystage --region eu-central-1
Expand All @@ -70,25 +72,25 @@ Once deployed there is one final step - creating the indices and mappings in Ela
}
```

Stac-api is now ready to ingest data!
Stac-server is now ready to ingest data!

## Ingesting Data

STAC Collections and Items are ingested by the `ingest` Lambda function, however this Lambda is not invoked directly by a user, it consumes records from the `stac-api-<stage>-queue` SQS. To add STAC Items or Collections to the queue, publish them to the SNS Topic `stac-api-<stage>-ingest`.
STAC Collections and Items are ingested by the `ingest` Lambda function, however this Lambda is not invoked directly by a user, it consumes records from the `stac-server-<stage>-queue` SQS. To add STAC Items or Collections to the queue, publish them to the SNS Topic `stac-server-<stage>-ingest`.

STAC Collections should be ingested before Items that belong to that Collection. Items should have the `collection` field populated with the ID of an existing Collection.

### Subscribing to SNS Topics

Stac-api can also be subscribed to SNS Topics that publish complete STAC Items as their message. This provides a way to keep stac-api up to date with new data. Use the AWS Lambda console for the function `stac-api-<stage>-subscibe-to-sns` to subscribe to an SNS Topic for which you have the full ARN and permission to subscribe to. This could be an SNS Topic you created yourself to publish STAC records to, or a publicly available one, such as for [Sentinel](https://github.com/sat-utils/sat-stac-sentinel).
Stac-server can also be subscribed to SNS Topics that publish complete STAC Items as their message. This provides a way to keep stac-server up to date with new data. Use the AWS Lambda console for the function `stac-server-<stage>-subscibe-to-sns` to subscribe to an SNS Topic for which you have the full ARN and permission to subscribe to. This could be an SNS Topic you created yourself to publish STAC records to, or a publicly available one, such as for [Sentinel](https://github.com/sat-utils/sat-stac-sentinel).

### Ingest Errors

Errors that occur during ingest will end up in the dead letter processing queue, where they are processed by the `stac-api-<stage>-failed-ingest` Lambda function. Currently all the failed-ingest Lambda does is log the error, see the CloudWatch log '/aws/lambda/stac-api-<stage>-failed-ingest' for errors.
Errors that occur during ingest will end up in the dead letter processing queue, where they are processed by the `stac-server-<stage>-failed-ingest` Lambda function. Currently all the failed-ingest Lambda does is log the error, see the CloudWatch log '/aws/lambda/stac-server-<stage>-failed-ingest' for errors.

## Development

The latest released version is on the [master branch](https://github.com/sat-utils/sat-api/tree/master), and the latest development version is on the [develop](https://github.com/sat-utils/sat-api/tree/develop) branch.
The latest released version is on the [master branch](https://github.com/stac-utils/stac-server/tree/master), and the latest development version is on the [develop](https://github.com/stac-utils/stac-server/tree/develop) branch.

```
# Install dependencies in package.json
Expand All @@ -106,4 +108,4 @@ $ npm run build-api-docs

## About

[stac-api](https://github.com/stac-utils/stac-api) was forked from [stac-api](https://github.com/sat-utils/sat-api). The stac-api is for STAC versions 0.9.0+, while sat-api exists for versions of STAC prior to 0.9.0.
[stac-server](https://github.com/stac-utils/stac-server) was forked from [sat-api](https://github.com/sat-utils/sat-api). Stac-server is for STAC versions 0.9.0+, while sat-api exists for versions of STAC prior to 0.9.0.
69 changes: 33 additions & 36 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: The SAT-API
title: stac-server
language_tabs:
- nodejs: NodeJS
- python: Python
Expand All @@ -11,22 +11,19 @@ headingLevel: 2

---

<h1 id="the-sat-api">The SAT-API v0.2.0</h1>
<h1 id="stac-server">stac-server</h1>

> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Sat-api is a STAC compliant web API for searching and serving metadata for geospatial data (including but not limited to satellite imagery). Development Seed runs an instance of sat-api for the Landsat-8 and Sentinel-2 imagery that is hosted on AWS.
Stac-server is a STAC compliant web API for searching and serving metadata for geospatial data (including but not limited to satellite imagery).

Base URLs:

* <a href="https://sat-api.developmentseed.org/">https://sat-api.developmentseed.org/</a>
* <a href="https://earth-search.aws.element84.com/">https://earth-search.aws.element84.com/</a>

* <a href="https://sat-api-dev.developmentseed.org/">https://sat-api-dev.developmentseed.org/</a>
License: <a href="https://github.com/stac-utils/stac-server/blob/master/LICENSE">MIT License</a>

Email: <a href="mailto:info@developmentseed.org">Development Seed</a> Web: <a href="https://developmentseed.org/contacts/">Development Seed</a>
License: <a href="https://github.com/sat-utils/sat-api/blob/master/LICENSE">MIT License</a>

<h1 id="the-sat-api-stac">STAC</h1>
<h1 id="stac">STAC</h1>

Extension to WFS3 Core to support STAC metadata model and search API

Expand All @@ -42,7 +39,7 @@ const headers = {

};

fetch('https://sat-api.developmentseed.org/stac',
fetch('https://earth-search.aws.element84.com',
{
method: 'GET',

Expand All @@ -62,15 +59,15 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://sat-api.developmentseed.org/stac', params={
r = requests.get('https://earth-search.aws.element84.com', params={

}, headers = headers)

print r.json()

```

`GET /stac`
`GET /`

Returns the root STAC Catalog or STAC Collection that is the entry point for users to browse with STAC Browser or for search engines to crawl. This can either return a single STAC Collection or more commonly a STAC catalog that usually lists sub-catalogs of STAC Collections, i.e. a simple catalog that lists all collections available through the API.

Expand Down Expand Up @@ -119,7 +116,7 @@ const headers = {

};

fetch('https://sat-api.developmentseed.org/stac/search',
fetch('https://earth-search.aws.element84.com/search',
{
method: 'GET',

Expand All @@ -139,15 +136,15 @@ headers = {
'Accept': 'application/geo+json'
}

r = requests.get('https://sat-api.developmentseed.org/stac/search', params={
r = requests.get('https://earth-search.aws.element84.com/search', params={

}, headers = headers)

print r.json()

```

`GET /stac/search`
`GET /search`

Retrieve Items matching filters. Intended as a shorthand API for simple queries.

Expand Down Expand Up @@ -256,7 +253,7 @@ requested items shall not be counted.
"links": [
{
"rel": "self",
"href": "http://https://sat-api.developmentseed.org/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
"href": "http://https://earth-search.aws.element84.com/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
}
],
"assets": {
Expand All @@ -276,7 +273,7 @@ requested items shall not be counted.
"links": [
{
"rel": "next",
"href": "http://sat-api.developmentseed.org/collections/landsat-8-l1/items/gasd312fsaeg"
"href": "http://earth-search.aws.element84.com/collections/landsat-8-l1/items/gasd312fsaeg"
}
]
}
Expand Down Expand Up @@ -328,7 +325,7 @@ const headers = {

};

fetch('https://sat-api.developmentseed.org/stac/search',
fetch('https://earth-search.aws.element84.com/search',
{
method: 'POST',
body: inputBody,
Expand All @@ -349,7 +346,7 @@ headers = {
'Accept': 'application/geo+json'
}

r = requests.post('https://sat-api.developmentseed.org/stac/search', params={
r = requests.post('https://earth-search.aws.element84.com/search', params={

}, headers = headers)

Expand Down Expand Up @@ -443,7 +440,7 @@ retrieve items matching filters. Intended as the standard, full-featured query A
"links": [
{
"rel": "self",
"href": "http://https://sat-api.developmentseed.org/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
"href": "http://https://earth-search.aws.element84.com/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
}
],
"assets": {
Expand All @@ -463,7 +460,7 @@ retrieve items matching filters. Intended as the standard, full-featured query A
"links": [
{
"rel": "next",
"href": "http://sat-api.developmentseed.org/collections/landsat-8-l1/items/gasd312fsaeg"
"href": "http://earth-search.aws.element84.com/collections/landsat-8-l1/items/gasd312fsaeg"
}
]
}
Expand All @@ -480,7 +477,7 @@ retrieve items matching filters. Intended as the standard, full-featured query A
This operation does not require authentication
</aside>

<h1 id="the-sat-api-capabilities">Capabilities</h1>
<h1 id="capabilities">Capabilities</h1>

## landing page of this API

Expand All @@ -496,7 +493,7 @@ const headers = {

};

fetch('https://sat-api.developmentseed.org/',
fetch('https://earth-search.aws.element84.com/',
{
method: 'GET',

Expand All @@ -516,7 +513,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://sat-api.developmentseed.org/', params={
r = requests.get('https://earth-search.aws.element84.com/', params={

}, headers = headers)

Expand All @@ -536,19 +533,19 @@ The landing page provides links to the API definition, the Conformance statement
{
"links": [
{
"href": "http://sat-api.developmentseed.org",
"href": "http://earth-search.aws.element84.com",
"rel": "self",
"type": "application/json",
"title": "this document"
},
{
"href": "http://sat-api.developmentseed.org/api",
"href": "http://earth-search.aws.element84.com/api",
"rel": "service",
"type": "application/json",
"title": "this document"
},
{
"href": "http://sat-api.developmentseed.org/collections",
"href": "http://earth-search.aws.element84.com/collections",
"rel": "data",
"type": "application/json",
"title": "Metadata about the feature collections"
Expand Down Expand Up @@ -581,7 +578,7 @@ const headers = {

};

fetch('https://sat-api.developmentseed.org/collections',
fetch('https://earth-search.aws.element84.com/collections',
{
method: 'GET',

Expand All @@ -601,7 +598,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://sat-api.developmentseed.org/collections', params={
r = requests.get('https://earth-search.aws.element84.com/collections', params={

}, headers = headers)

Expand Down Expand Up @@ -1050,7 +1047,7 @@ If a feature has multiple temporal properties, it is the decision of the server
"links": [
{
"rel": "self",
"href": "http://https://sat-api.developmentseed.org/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
"href": "http://https://earth-search.aws.element84.com/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
}
],
"assets": {
Expand All @@ -1070,7 +1067,7 @@ If a feature has multiple temporal properties, it is the decision of the server
"links": [
{
"rel": "next",
"href": "http://sat-api.developmentseed.org/collections/landsat-8-l1/items/gasd312fsaeg"
"href": "http://earth-search.aws.element84.com/collections/landsat-8-l1/items/gasd312fsaeg"
}
]
}
Expand Down Expand Up @@ -1138,7 +1135,7 @@ If a feature has multiple temporal properties, it is the decision of the server
"links": [
{
"rel": "self",
"href": "http://https://sat-api.developmentseed.org/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
"href": "http://https://earth-search.aws.element84.com/collections/landsat-8-l1/items/LC80100102015050LGN00.json"
}
],
"assets": {
Expand Down Expand Up @@ -1268,7 +1265,7 @@ If a feature has multiple temporal properties, it is the decision of the server
[
{
"rel": "next",
"href": "http://sat-api.developmentseed.org/collections/landsat-8-l1/items/gasd312fsaeg"
"href": "http://earth-search.aws.element84.com/collections/landsat-8-l1/items/gasd312fsaeg"
}
]

Expand All @@ -1290,19 +1287,19 @@ If a feature has multiple temporal properties, it is the decision of the server
{
"links": [
{
"href": "http://sat-api.developmentseed.org",
"href": "http://earth-search.aws.element84.com",
"rel": "self",
"type": "application/json",
"title": "this document"
},
{
"href": "http://sat-api.developmentseed.org/api",
"href": "http://earth-search.aws.element84.com/api",
"rel": "service",
"type": "application/json",
"title": "this document"
},
{
"href": "http://sat-api.developmentseed.org/collections",
"href": "http://earth-search.aws.element84.com/collections",
"rel": "data",
"type": "application/json",
"title": "Metadata about the feature collections"
Expand Down
Loading