https://github.com/azavea/geotrellis-collections-api-research
A research project to investigate using GeoTrellis as a REST service
https://github.com/azavea/geotrellis-collections-api-research
akka-http geotrellis leaflet react react-leaflet redux scala spark victory
Last synced: 5 days ago
JSON representation
A research project to investigate using GeoTrellis as a REST service
- Host: GitHub
- URL: https://github.com/azavea/geotrellis-collections-api-research
- Owner: azavea
- License: mit
- Created: 2017-03-24T17:52:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T20:15:54.000Z (almost 7 years ago)
- Last Synced: 2025-04-03T07:06:10.624Z (26 days ago)
- Topics: akka-http, geotrellis, leaflet, react, react-leaflet, redux, scala, spark, victory
- Language: JavaScript
- Homepage:
- Size: 18.3 MB
- Stars: 14
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# geotrellis-collections-api-research
[](https://travis-ci.org/azavea/geotrellis-collections-api-research)
A research project to set up and use GeoTrellis as a REST service.

### Requirements
* Make
* curl
* [Docker](https://store.docker.com/search?offering=community&type=edition)
* [java](http://openjdk.java.net/)
* [sbt](http://www.scala-sbt.org/download.html)
* [Spark 2.x](https://spark.apache.org/downloads.html)To ingest the geotiff data used in the app, you'll also need to ensure that you've got `spark-submit` on your local path.
### Getting started
#### Setup
Clone the project, make sure that Docker's running, then run:
```sh
make
```This will
- build the app client
- compile the API service
- [download a geotiff representing 1992 NLCD values for Pennsylvania](http://www.pasda.psu.edu/uci/DataSummary.aspx?dataset=339)
- ingest the geotiff as an RDD for GeoTrellis
- paint tiles of the geotiff from the RDD#### Server
To start the app & API servers, run:
```
make server
```This will start servers to run the app on port `9555` and the API on port `7000`.
### Ports
| Port | Service |
| --- | --- |
| [9555](http://localhost:9555) | Webpack dev server |
| [7000](http://localhost:7000) | GeoTrellis API |### API Endpoints
Each of these API endpoints accepts a polygon geometry object posted from the client:
| Path | Service |
| --- | --- |
| `/panlcdcount` | Returns NLCD cell counts arranged by type for AOI |### Make rules
| Rule | Description |
| --- | --- |
| `make build` | Install app container npm dependencies |
| `make compile` | Compile app & api for CI |
| `make app-console` | Log into app container shell |
| `make api-console` | Log into API with `./sbt console` |
| `make restart` | Start API with `./sbt ~reStart` |
| `make server` | Start app container & API service |
| `make download-tif` | Download a geotiff of 1992 NLCD data for Pennsylvania |
| `make ingest` | Ingest Pennsylvania NLCD GeoTiff into GeoTrellis RDD |
| `make paint` | Paint Pennsylvania NCLD tiles from RDD |
| `make clean` | Remove downloaded geotiff, generated RDD, generated tiles |