Skip to content

Commit adcb499

Browse files
Merge pull request #149 from developmentseed/docs/edit-services
Review and edit services.md
2 parents 0ec5edd + 12a00d7 commit adcb499

File tree

9 files changed

+273
-113
lines changed

9 files changed

+273
-113
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Development - Contributing
2-
31
Issues and pull requests are more than welcome: https://github.com/developmentseed/eoAPI/issues
42

3+
You can also start **Discussions** in https://github.com/developmentseed/eoAPI/discussions
4+
55
**dev install**
66

77
```bash
@@ -19,7 +19,9 @@ python -m pip install "psycopg[binary,pool]"
1919
python -m pip install -e runtime/eoapi/raster["test"] # or -e runtime/eoapi/stac["test"] | -e runtime/eoapi/vector["test"]
2020
```
2121

22-
Note: services might have incompatible dependencies which you can resolve by using virtual environnement per service
22+
!!! danger
23+
24+
Python applications might have incompatible dependencies which you can resolve by using virtual environment *per application*
2325

2426
**pre-commit**
2527

@@ -28,3 +30,13 @@ This repo is set to use `pre-commit` to run *isort*, *ruff*, *pydocstring*, *bla
2830
```bash
2931
$ pre-commit install
3032
```
33+
34+
### Open Source
35+
36+
You can also contribute indirectly to eoAPI by helping on the sub-modules:
37+
38+
- **PgSTAC** database https://github.com/stac-utils/pgstac
39+
- **stac-fastapi**: https://github.com/stac-utils/stac-fastapi
40+
- **titiler-pgstac**: https://github.com/stac-utils/titiler-pgstac
41+
- **TiTiler**: https://github.com/developmentseed/titiler
42+
- **TiPg**: https://github.com/developmentseed/tipg

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
<p align="center">
32
<img width="700" src="docs/logos/eoAPI.png"/>
4-
<p align="center">Create a full Earth Observation API with Metadata, Raster and Vector services.</p>
3+
<p align="center">Create a full Earth Observation API with Metadata, Raster, and Vector services.</p>
54
</p>
65

76
<p align="center">
@@ -23,7 +22,7 @@
2322

2423
## **E**arth **O**bservation **API**
2524

26-
`eoAPI` combines several *state-of-the-art* projects to create a full Earth Observation API. Each service can be used and deployed independently but `eoAPI` creates the interconnections between each service:
25+
`eoAPI` combines several *state-of-the-art* projects to create a full Earth Observation API. Each service can be used and deployed independently, but `eoAPI` creates the interconnections between each service:
2726

2827
- **pgSTAC** database [https://github.com/stac-utils/pgstac](https://github.com/stac-utils/pgstac)
2928

@@ -37,18 +36,29 @@
3736

3837
## 🌍 eoAPI: An Open-Source Community Project
3938

40-
`eoAPI` is proudly open-source and driven by a dedicated community of contributors. We believe in the power of open collaboration and welcome anyone to contribute, discuss, and grow this tool with us. Join the conversations on [GitHub Discussions](https://github.com/developmentseed/eoAPI/discussions) and make a difference in the Earth Observation realm.
39+
`eoAPI` is proudly open-source and driven by a dedicated community of contributors. We believe in the power of open collaboration and welcome anyone to contribute, discuss, and grow this tool. Join the conversations on [GitHub Discussions](https://github.com/developmentseed/eoAPI/discussions) and make a difference in the Earth Observation realm.
4140

4241

4342
---
4443

4544
## Getting started
4645

47-
- Clone the repository: `git clone https://github.com/developmentseed/eoAPI.git`
48-
- Navigate to the project: `cd eoAPI`
49-
- Run services with `docker compose up`
50-
- Follow the [MAXAR open data demo](https://github.com/vincentsarago/MAXAR_opendata_to_pgstac) (or get inspired by the other [demos](./demo/)) to load some data into eoAPI
51-
- Check out the [Search Viewer](http://localhost:8081/index.html), and the API documentation ([STAC Metadata](http://localhost:8081/docs), [Raster Tiles](http://localhost:8082/docs), [Vector Tiles](http://localhost:8083/api.html))
46+
The easiest way to start exploring the different eoAPI services is with *Docker*. Clone this repository and start the multi-container *Docker* applications using `Compose`:
47+
48+
```
49+
git clone https://github.com/developmentseed/eoAPI.git
50+
cd eoAPI
51+
docker compose up
52+
```
53+
54+
Once the applications are *up*, you'll need to add STAC **Collections** and **Items** to the PgSTAC database. If you don't have, you can use the follow the [MAXAR open data demo](https://github.com/vincentsarago/MAXAR_opendata_to_pgstac) (or get inspired by the other [demos](https://github.com/developmentseed/eoAPI/tree/main/demo)).
55+
56+
Then you can start exploring your dataset with:
57+
58+
- the STAC Metadata service [http://localhost:8081](http://localhost:8081)
59+
- the Raster service [http://localhost:8082](http://localhost:8082)
60+
61+
If you've added a vector dataset to the `public` schema in the Postgres database, they will be available through the **Vector** service at [http://localhost:8083](http://localhost:8083).
5262

5363
Alternatively, you may launch the application locally:
5464
```bash
@@ -57,22 +67,22 @@ virtualenv .venv
5767
source .venv/bin/activate
5868

5969
python -m pip install "psycopg[binary,pool]" uvicorn
60-
python -m pip install runtime/eoapi/{SERVICE} # SERVICE should be one of `raster, vector, stac`
70+
python -m pip install runtime/eoapi/{SERVICE} # SERVICE should be one of `raster, vector, stac.`
6171

6272
export DATABASE_URL=postgresql://username:password@0.0.0.0:5439/postgis # Connect to the database of your choice
6373

6474
.venv/bin/uvicorn eoapi.{SERVICE}.app:app --port 8000 --reload
6575
```
6676

67-
Note: services might have incompatible dependencies which you can resolve by using a virtual environment for each service
77+
Note: services might have incompatible dependencies, which you can resolve by using a virtual environment for each service
6878

6979
---
7080

7181
## Deployment
7282

73-
This repository has current runtimes that are consistently updated with new functionality.
83+
This repository has current runtimes that are consistently updated with new functionality.
7484

75-
The services can be deployed locally via docker with `docker-compose up`. The official runtimes can be launched with `docker-compose -f docker-compose.yml -f docker-compose.official.yml up stac-fastapi titiler-pgstac tipg`.
85+
The services can be deployed locally via docker with `docker-compose up`. The official runtimes can be launched with `docker compose -f docker-compose.official.yml up stac-fastapi titiler-pgstac tipg`.
7686

7787
Two Infrastructure as Code (IaC) repositories are available:
7888
- [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk): A set of AWS CDK constructs to deploy eoAPI services
@@ -82,7 +92,7 @@ Finally, [eoapi-template](https://github.com/developmentseed/eoapi-template) is
8292

8393
## Contribution & Development
8494

85-
We highly value and rely on our community! Whether you're an expert or just getting started, you can make a difference. Here's how:
95+
We highly value and rely on our community! You can make a difference whether you're an expert or just getting started. Here's how:
8696

8797
- **Contribute**: Check out our [CONTRIBUTING.md](https://github.com/developmentseed/eoAPI/blob/main/CONTRIBUTING.md) guide to understand how you can contribute.
8898
- **Engage in Discussions**: Share your ideas, ask questions, or provide feedback through [GitHub Discussions](https://github.com/developmentseed/eoAPI/discussions). This is where most of our project conversations take place.
@@ -103,4 +113,4 @@ See [contributors](https://github.com/developmentseed/eoAPI/graphs/contributors)
103113

104114
## Changes
105115

106-
See [CHANGES.md](https://github.com/developmentseed/eoAPI/blob/main/CHANGES.md).
116+
See [CHANGES.md](https://github.com/developmentseed/eoAPI/blob/main/CHANGES.md).

docker-compose.official.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ version: '3'
22

33
services:
44
stac-fastapi:
5+
# Note:
6+
# the official ghcr.io/stac-utils/stac-fastapi-pgstac image uses python 3.8 and uvicorn
7+
# which is why here we use a custom Dockerfile using python 3.11 and gunicorn
58
build:
69
context: .
710
dockerfile: dockerfiles/Dockerfile.stac
@@ -40,7 +43,7 @@ services:
4043
# At the time of writing, rasterio and psycopg wheels are not available for arm64 arch
4144
# so we force the image to be built with linux/amd64
4245
platform: linux/amd64
43-
image: ghcr.io/stac-utils/titiler-pgstac:latest
46+
image: ghcr.io/stac-utils/titiler-pgstac:0.8.0
4447
ports:
4548
- "${MY_DOCKER_IP:-127.0.0.1}:8082:8082"
4649
environment:
@@ -86,7 +89,7 @@ services:
8689
- ./dockerfiles/scripts:/tmp/scripts
8790

8891
tipg:
89-
image: ghcr.io/developmentseed/tipg:latest
92+
image: ghcr.io/developmentseed/tipg:0.4.4
9093
ports:
9194
- "${MY_DOCKER_IP:-127.0.0.1}:8083:8083"
9295
environment:
@@ -115,8 +118,7 @@ services:
115118
- ./dockerfiles/scripts:/tmp/scripts
116119

117120
database:
118-
container_name: eoapi.db
119-
image: ghcr.io/stac-utils/pgstac:v0.7.10
121+
image: ghcr.io/stac-utils/pgstac:v0.8.1
120122
environment:
121123
- POSTGRES_USER=username
122124
- POSTGRES_PASSWORD=password

docs/mkdocs.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ extra:
1919
link: "https://developmentseed.org/blog"
2020

2121
nav:
22-
- Home: "index.md"
23-
- Intro: "intro.md"
24-
- Services: "services.md"
25-
- Deployment: "deployment.md"
26-
- Contributing: "contributing.md"
27-
22+
- Home: index.md
23+
- Getting started:
24+
- intro.md
25+
- Services: services.md
26+
- Contributing: contributing.md
27+
- Advanced User Guide:
28+
- Customization: customization.md
29+
- Deployment: deployment.md
2830

2931
plugins:
3032
- search
@@ -36,17 +38,17 @@ theme:
3638
palette:
3739
primary: custom
3840
accent: deep orange
39-
4041
features:
4142
- navigation.tabs
43+
- navigation.tabs.sticky
4244
- navigation.instant
4345
- navigation.tracking
4446
- navigation.top
45-
- navigation.expand
47+
- navigation.footer
48+
- navigation.sections
4649
favicon: img/favicon.ico
4750
logo: img/logo.png
4851

49-
5052
markdown_extensions:
5153
- admonition
5254
- attr_list
@@ -59,7 +61,6 @@ markdown_extensions:
5961
- pymdownx.caret:
6062
insert: false
6163
- pymdownx.details
62-
- pymdownx.emoji
6364
- pymdownx.escapeall:
6465
hardbreak: true
6566
nbsp: true
@@ -73,3 +74,6 @@ markdown_extensions:
7374
- pymdownx.tilde
7475
- toc:
7576
permalink: true
77+
- pymdownx.emoji:
78+
emoji_index: !!python/name:material.extensions.emoji.twemoji
79+
emoji_generator: !!python/name:material.extensions.emoji.to_svg

docs/src/contributing.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
---
2-
hide:
3-
- navigation
4-
- toc
5-
---
6-
71
Issues and pull requests are more than welcome: https://github.com/developmentseed/eoAPI/issues
82

3+
You can also start **Discussions** in https://github.com/developmentseed/eoAPI/discussions
4+
95
**dev install**
106

117
```bash
@@ -18,12 +14,14 @@ python -m pip install --upgrade virtualenv
1814
virtualenv .venv
1915
source .venv/bin/activate
2016

21-
# Install eoapi module
17+
# Install the eoapi module
2218
python -m pip install "psycopg[binary,pool]"
2319
python -m pip install -e runtime/eoapi/raster["test"] # or -e runtime/eoapi/stac["test"] | -e runtime/eoapi/vector["test"]
2420
```
2521

26-
Note: services might have incompatible dependencies which you can resolve by using virtual environnement per service
22+
!!! danger
23+
24+
Python applications might have incompatible dependencies, which you can resolve by using a virtual environment *per application*
2725

2826
**pre-commit**
2927

@@ -32,3 +30,13 @@ This repo is set to use `pre-commit` to run *isort*, *ruff*, *pydocstring*, *bla
3230
```bash
3331
$ pre-commit install
3432
```
33+
34+
### Open Source
35+
36+
You can also contribute indirectly to eoAPI by helping on the sub-modules:
37+
38+
- **PgSTAC** database https://github.com/stac-utils/pgstac
39+
- **stac-fastapi**: https://github.com/stac-utils/stac-fastapi
40+
- **titiler-pgstac**: https://github.com/stac-utils/titiler-pgstac
41+
- **TiTiler**: https://github.com/developmentseed/titiler
42+
- **TiPg**: https://github.com/developmentseed/tipg

docs/src/customization.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
The eoAPI repository (https://github.com/developmentseed/eoAPI) hosts customized versions of each base service. The documentation below demonstrates how each service can be customized. The eoAPI services can work in parallel or in combination with each other.
2+
3+
---
4+
## eoapi.stac
5+
6+
Built on [stac-fastapi.pgstac](https://github.com/stac-utils/stac-fastapi) application, adding a **`TiTilerExtension`** and a simple **`Search Viewer`**.
7+
8+
The service includes:
9+
10+
- Full **stac-fastapi** implementation - see [docs](http://localhost:8081/docs) if using the `docker-compose` configuration.
11+
- Simple STAC Search **viewer** - see [viewer](http://localhost:8081/index.html) if using the `docker-compose` configuration.
12+
- **Proxy** to the tiler endpoint for STAC Items.
13+
14+
When the `TITILER_ENDPOINT` environment variable is set (pointing to the `raster` application), additional endpoints will be added to the stac-fastapi application (see: [stac/extension.py](https://github.com/developmentseed/eoAPI/blob/main/src/eoapi/stac/eoapi/stac/extension.py)):
15+
16+
- `/collections/{collectionId}/items/{itemId}/tilejson.json`: Return the `raster` tilejson for an item
17+
- `/collections/{collectionId}/items/{itemId}/viewer`: Redirect to the `raster` viewer
18+
19+
<p align="center">
20+
<img alt="eoapi.stac OpenAPI documentation"src="https://github.com/developmentseed/eoAPI/assets/10407788/f7fc4e7f-079a-4007-8c4c-74ff9ca7b012">
21+
<img alt="Metadata STAC search viewer" src="https://github.com/developmentseed/eoAPI/assets/10407788/b1fd6aa8-aab9-4d58-9ad4-6e1069ed9473"/>
22+
</p>
23+
24+
Code: [/runtime/eoapi/stac](https://github.com/developmentseed/eoAPI/tree/main/runtime/eoapi/stac)
25+
26+
---
27+
## eoapi.raster
28+
29+
The dynamic tiler deployed within `eoAPI` is built on top of [titiler-pgstac](https://github.com/stac-utils/titiler-pgstac) and [pgstac](https://github.com/stac-utils/pgstac). It enables large-scale mosaic based on the results of STAC search queries.
30+
31+
The service includes all the default endpoints from **titiler-pgstac** application and:
32+
33+
- `/`: a custom landing page with links to the different endpoints
34+
35+
- `/mosaic/builder`: a virtual mosaic builder UI, which helps create and register STAC Search queries
36+
37+
- `/collections`: a *secret* (not in OpenAPI documentation) endpoint used in the mosaic-builder page
38+
39+
- `/collections/{collection_id}/items/{item_id}/viewer`: a simple STAC Item viewer
40+
41+
<p align="center">
42+
<img alt="eoapi.stac OpenAPI documentation" src="https://github.com/developmentseed/eoAPI/assets/10407788/aa08d796-f3b1-4f43-8021-cbddfff95d26">
43+
<img alt="Raster mosaic builder" src="https://github.com/developmentseed/eoAPI/assets/10407788/8f0c96e6-d80a-46ef-a34f-66e59c64a027"/>
44+
<img alt="STAC Item viewer" src="https://github.com/developmentseed/eoAPI/assets/10407788/be86f07e-4b05-4c78-87bf-8738daf1ee20">
45+
</p>
46+
47+
48+
Code: [/runtime/eoapi/raster](https://github.com/developmentseed/eoAPI/tree/main/runtime/eoapi/raster)
49+
50+
---
51+
## eoapi.vector
52+
53+
OGC Features and Tiles API built on top of [tipg](https://github.com/developmentseed/tipg).
54+
55+
By default, the API will look for tables in the `public` schema of the database. We've also added three functions that connect to the pgSTAC schema:
56+
57+
- **pg_temp.pgstac_collections_view**: Simple function which returns PgSTAC Collections
58+
- **pg_temp.pgstac_hash**: Return features for a specific `searchId` (hash)
59+
- **pg_temp.pgstac_hash_count**: Return the number of items per geometry for a specific `searchId` (hash)
60+
61+
<p align="center">
62+
<img alt="eoapi.vector OpenAPI documentation" src="https://github.com/developmentseed/eoAPI/assets/10407788/80ff9659-bc07-4238-a94a-7cab0a2af380">
63+
<img alt="eoapi.vector landing page" src="https://github.com/developmentseed/eoAPI/assets/10407788/b2a8a8d4-d3a1-464a-8b1a-166499ee4abd">
64+
</p>
65+
66+
Code: [/runtime/eoapi/vector](https://github.com/developmentseed/eoAPI/tree/main/runtime/eoapi/vector)

0 commit comments

Comments
 (0)