-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,765 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Generate data script | ||
|
||
Upload the data in `data` folder. For example `layers` will contain all the `.tif` files. | ||
Upload the data in `data` folder. For example `seabirds` will contain all the `.tif` files. | ||
|
||
```bash | ||
docker compose build | ||
docker compose run cli /app/data/layers --output /app/data/layers | ||
docker compose run cli /app/data/seabirds --output /app/data/seabirds --prefix /app/ | ||
``` | ||
|
||
This will convert all the rasters to cog, applying a colorscale based on `Reds`. | ||
This will convert all the rasters to cog, applying a colorscale based on `Reds`. It will also create the required files (`metadata.json`, `style.json`) in the output directory. `prefix` allows to "remove" from the `cog` path the prefix that is served by nginx. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
|
||
set -exuo pipefail | ||
shopt -s globstar | ||
|
||
url="http://localhost:8080" | ||
credentials="admin:geoserver" | ||
workspace="marcis" | ||
style="$workspace:seabirds" | ||
geoserver_path="file:///opt/marcis" | ||
|
||
for file in **/indexer.properties | ||
do | ||
path="$geoserver_path/$(dirname $file)" | ||
layer="$(basename $path)" | ||
curl -v -u "$credentials" --header "Content-Type: application/json" --data "$( | ||
jq --null-input --arg workspace "$workspace" --arg url "$path" --arg layer "$layer" ' | ||
{ | ||
"coverageStore": { | ||
"name": $layer, | ||
"url": $url, | ||
"type": "ImageMosaic", | ||
"enabled": true, | ||
"workspace": { | ||
"name": $workspace | ||
} | ||
} | ||
} | ||
')" "$url/geoserver/rest/workspaces/$workspace/coveragestores" | ||
curl -v -u "$credentials" --header "Content-Type: application/json" --data "$( | ||
jq --null-input --arg workspace "$workspace" --arg layer "$layer" ' | ||
{ | ||
"coverage": { | ||
"name": $layer, | ||
"nativeName": $layer, | ||
"namespace": { | ||
"name": $workspace | ||
}, | ||
"title": $layer, | ||
"description": "Generated from ImageMosaic", | ||
"keywords": { | ||
"string": [ | ||
$layer, | ||
"WCS", | ||
"ImageMosaic" | ||
] | ||
}, | ||
"enabled": true, | ||
"metadata": { | ||
"entry": [ | ||
{ | ||
"@key": "time", | ||
"dimensionInfo": { | ||
"enabled": true, | ||
"presentation": "LIST", | ||
"units": "ISO8601", | ||
"defaultValue": "", | ||
"nearestMatchEnabled": false, | ||
"rawNearestMatchEnabled": false | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
')" "$url/geoserver/rest/workspaces/$workspace/coveragestores/$layer/coverages" | ||
curl -v -u "$credentials" --header "Content-Type: application/json" --data "$( | ||
jq --null-input --arg workspace "$workspace" --arg layer "$layer" --arg style "$style" ' | ||
{ | ||
"layer": { | ||
"name": $layer, | ||
"type": "RASTER", | ||
"defaultStyle": { | ||
"name": $style, | ||
"workspace": $workspace | ||
} | ||
} | ||
} | ||
')" -X PUT "$url/geoserver/rest/layers/$workspace:$layer" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ services: | |
cli: | ||
build: . | ||
volumes: | ||
- ../data:/app/data | ||
- ../data:/data | ||
- ./src:/app/src |
Oops, something went wrong.