Spaces:
Paused
Paused
Update README for improved clarity and consistency in installation instructions and parameter tables
Browse files
README.md
CHANGED
|
@@ -33,17 +33,20 @@ A FastAPI service that generates tile URLs for Google Earth Engine assets, suita
|
|
| 33 |
### Installation
|
| 34 |
|
| 35 |
1. Clone the repository:
|
|
|
|
| 36 |
```bash
|
| 37 |
git clone <repository-url>
|
| 38 |
cd ee-tile-request
|
| 39 |
```
|
| 40 |
|
| 41 |
2. Install dependencies:
|
|
|
|
| 42 |
```bash
|
| 43 |
pip install -r requirements.txt
|
| 44 |
```
|
| 45 |
|
| 46 |
3. Set your Earth Engine token:
|
|
|
|
| 47 |
```bash
|
| 48 |
export EARTHENGINE_TOKEN="your_token_here"
|
| 49 |
```
|
|
@@ -60,7 +63,7 @@ uvicorn main:app --host 0.0.0.0 --port 7865 --reload
|
|
| 60 |
|
| 61 |
```bash
|
| 62 |
docker build -t ee-tile-request .
|
| 63 |
-
docker run -p 7865:7865 -e
|
| 64 |
```
|
| 65 |
|
| 66 |
### Access Points
|
|
@@ -78,13 +81,13 @@ docker run -p 7865:7865 -e EARTHENGINE_TOKEN="your_token" ee-tile-request
|
|
| 78 |
|
| 79 |
### Tile Request Parameters
|
| 80 |
|
| 81 |
-
| Parameter
|
| 82 |
-
|-----------|------|----------
|
| 83 |
-
| `asset_id`
|
| 84 |
-
| `vis_params` | object | No
|
| 85 |
-
| `start_date` | string | No
|
| 86 |
-
| `end_date`
|
| 87 |
-
| `bbox`
|
| 88 |
|
| 89 |
### Examples
|
| 90 |
|
|
@@ -178,16 +181,16 @@ Computes JRC monthly water history and water occurrence statistics for a given b
|
|
| 178 |
|
| 179 |
### JRC Request Parameters
|
| 180 |
|
| 181 |
-
| Parameter
|
| 182 |
-
|-----------|------|----------
|
| 183 |
-
| `bbox`
|
| 184 |
-
| `scale`
|
| 185 |
-
| `start_date`
|
| 186 |
-
| `end_date`
|
| 187 |
-
| `start_month` | integer | No
|
| 188 |
-
| `end_month`
|
| 189 |
-
| `frequency`
|
| 190 |
-
| `denominator` | number
|
| 191 |
|
| 192 |
### Example
|
| 193 |
|
|
@@ -211,8 +214,8 @@ curl -X POST "http://localhost:7865/jrc-water-stats" \
|
|
| 211 |
"frequency": "year",
|
| 212 |
"unit": "hectares",
|
| 213 |
"data": [
|
| 214 |
-
{"Year": "1984", "Area": 123.45},
|
| 215 |
-
{"Year": "1985", "Area": 130.
|
| 216 |
]
|
| 217 |
},
|
| 218 |
"water_occurrence": {
|
|
@@ -248,30 +251,31 @@ When `frequency` is `"month"`, the `data` array contains `{"Month": "Jan", "Area
|
|
| 248 |
```javascript
|
| 249 |
const tileUrl = response.tile_url;
|
| 250 |
L.tileLayer(tileUrl, {
|
| 251 |
-
attribution:
|
| 252 |
-
maxZoom: 18
|
| 253 |
}).addTo(map);
|
| 254 |
```
|
| 255 |
|
| 256 |
#### Mapbox GL JS
|
| 257 |
|
| 258 |
```javascript
|
| 259 |
-
map.addSource(
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
});
|
| 264 |
|
| 265 |
map.addLayer({
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
});
|
| 270 |
```
|
| 271 |
|
| 272 |
## Web UI (Gradio)
|
| 273 |
|
| 274 |
Access the web interface at http://localhost:7865 to:
|
|
|
|
| 275 |
- Enter Earth Engine asset IDs
|
| 276 |
- Specify visualization parameters as JSON
|
| 277 |
- Get tile URLs instantly
|
|
|
|
| 33 |
### Installation
|
| 34 |
|
| 35 |
1. Clone the repository:
|
| 36 |
+
|
| 37 |
```bash
|
| 38 |
git clone <repository-url>
|
| 39 |
cd ee-tile-request
|
| 40 |
```
|
| 41 |
|
| 42 |
2. Install dependencies:
|
| 43 |
+
|
| 44 |
```bash
|
| 45 |
pip install -r requirements.txt
|
| 46 |
```
|
| 47 |
|
| 48 |
3. Set your Earth Engine token:
|
| 49 |
+
|
| 50 |
```bash
|
| 51 |
export EARTHENGINE_TOKEN="your_token_here"
|
| 52 |
```
|
|
|
|
| 63 |
|
| 64 |
```bash
|
| 65 |
docker build -t ee-tile-request .
|
| 66 |
+
docker run -p 7865:7865 -e EE_SERVICE_ACCOUNT ee-tile-request
|
| 67 |
```
|
| 68 |
|
| 69 |
### Access Points
|
|
|
|
| 81 |
|
| 82 |
### Tile Request Parameters
|
| 83 |
|
| 84 |
+
| Parameter | Type | Required | Description |
|
| 85 |
+
| ------------ | ------ | -------- | ----------------------------------------------------------------- |
|
| 86 |
+
| `asset_id` | string | Yes | Earth Engine asset ID (e.g., "USGS/SRTMGL1_003") or ee expression |
|
| 87 |
+
| `vis_params` | object | No | Visualization parameters (min, max, palette, bands, etc.) |
|
| 88 |
+
| `start_date` | string | No | Start date for filtering (format: "YYYY-MM-DD") |
|
| 89 |
+
| `end_date` | string | No | End date for filtering (format: "YYYY-MM-DD") |
|
| 90 |
+
| `bbox` | array | No | Bounding box [west, south, east, north] in degrees |
|
| 91 |
|
| 92 |
### Examples
|
| 93 |
|
|
|
|
| 181 |
|
| 182 |
### JRC Request Parameters
|
| 183 |
|
| 184 |
+
| Parameter | Type | Required | Default | Description |
|
| 185 |
+
| ------------- | ------- | -------- | ------------ | -------------------------------------------------- |
|
| 186 |
+
| `bbox` | array | Yes | — | Bounding box [west, south, east, north] in degrees |
|
| 187 |
+
| `scale` | number | No | 30 | Scale in meters for computation |
|
| 188 |
+
| `start_date` | string | No | "1984-03-16" | Start date (format: "YYYY-MM-DD") |
|
| 189 |
+
| `end_date` | string | No | today | End date (format: "YYYY-MM-DD") |
|
| 190 |
+
| `start_month` | integer | No | 1 | Start month for calendar filtering (1-12) |
|
| 191 |
+
| `end_month` | integer | No | 12 | End month for calendar filtering (1-12) |
|
| 192 |
+
| `frequency` | string | No | "year" | Aggregation frequency: "month" or "year" |
|
| 193 |
+
| `denominator` | number | No | 10000 | Area unit conversion (10000 = hectares) |
|
| 194 |
|
| 195 |
### Example
|
| 196 |
|
|
|
|
| 214 |
"frequency": "year",
|
| 215 |
"unit": "hectares",
|
| 216 |
"data": [
|
| 217 |
+
{ "Year": "1984", "Area": 123.45 },
|
| 218 |
+
{ "Year": "1985", "Area": 130.2 }
|
| 219 |
]
|
| 220 |
},
|
| 221 |
"water_occurrence": {
|
|
|
|
| 251 |
```javascript
|
| 252 |
const tileUrl = response.tile_url;
|
| 253 |
L.tileLayer(tileUrl, {
|
| 254 |
+
attribution: "Google Earth Engine",
|
| 255 |
+
maxZoom: 18,
|
| 256 |
}).addTo(map);
|
| 257 |
```
|
| 258 |
|
| 259 |
#### Mapbox GL JS
|
| 260 |
|
| 261 |
```javascript
|
| 262 |
+
map.addSource("ee-tiles", {
|
| 263 |
+
type: "raster",
|
| 264 |
+
tiles: [response.tile_url],
|
| 265 |
+
tileSize: 256,
|
| 266 |
});
|
| 267 |
|
| 268 |
map.addLayer({
|
| 269 |
+
id: "ee-layer",
|
| 270 |
+
type: "raster",
|
| 271 |
+
source: "ee-tiles",
|
| 272 |
});
|
| 273 |
```
|
| 274 |
|
| 275 |
## Web UI (Gradio)
|
| 276 |
|
| 277 |
Access the web interface at http://localhost:7865 to:
|
| 278 |
+
|
| 279 |
- Enter Earth Engine asset IDs
|
| 280 |
- Specify visualization parameters as JSON
|
| 281 |
- Get tile URLs instantly
|