Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ Dockerfile
.dockerignore
.history
*.mbtiles
*.pmtiles
Comment thread
rudokemper marked this conversation as resolved.
.env.test
14 changes: 7 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ jobs:
short-description: 'Node.js MapGL renderer for styled raster tiles in MBTiles format.'
- name: Test run of Docker image with self-provided style
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style self --stylelocation tests/fixtures/alert/style-with-geojson.json --stylesources tests/fixtures/alert/sources --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f self-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style self --stylelocation tests/fixtures/alert/style-with-geojson.json --stylesources tests/fixtures/alert/sources --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f self-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Test run of Docker image with Bing source
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style bing --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f bing-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style bing --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f bing-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Test run of Docker image with Esri source and GeoJSON overlay
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style esri --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 --overlay '{"type": "FeatureCollection", "name": "alert", "features": [{"geometry": {"coordinates": [[[-54.25348208981326, 3.140689896338671], [-54.25348208981326, 3.140600064810259], [-54.253841415926914, 3.140600064810259], [-54.25348208981326, 3.140689896338671]]], "geodesic": false, "type": "Polygon"}, "id": "-603946+34961", "properties": {"month_detec": "09", "year_detec": "2023"}, "type": "Feature"}]}' -f esri-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style esri --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 --overlay '{"type": "FeatureCollection", "name": "alert", "features": [{"geometry": {"coordinates": [[[-54.25348208981326, 3.140689896338671], [-54.25348208981326, 3.140600064810259], [-54.253841415926914, 3.140600064810259], [-54.25348208981326, 3.140689896338671]]], "geodesic": false, "type": "Polygon"}, "id": "-603946+34961", "properties": {"month_detec": "09", "year_detec": "2023"}, "type": "Feature"}]}' -f esri-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Test run of Docker image with Mapbox source
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style mapbox --mapboxstyle ${{ secrets.MAPBOX_STYLE }} --apikey ${{ secrets.MAPBOX_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f mapbox-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style mapbox --mapboxstyle ${{ secrets.MAPBOX_STYLE }} --apikey ${{ secrets.MAPBOX_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 10 -f mapbox-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Test run of Docker image with Planet source
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style planet --monthyear 2023-12 --apikey ${{ secrets.PLANET_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f planet-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style planet --monthyear 2023-12 --apikey ${{ secrets.PLANET_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f planet-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Test run of Docker image with Protomaps source
run: |
docker run --rm -v ${{ github.workspace }}:/app ${{ steps.meta.outputs.tags }} --style protomaps --apikey ${{ secrets.PROTOMAPS_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f protomaps-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
docker run --rm -v ${{ github.workspace }}/outputs:/app/outputs ${{ steps.meta.outputs.tags }} --style protomaps --apikey ${{ secrets.PROTOMAPS_API_KEY }} --bounds "-54.28772,3.11460,-54.03630,3.35025" -Z 5 -f protomaps-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- name: Upload mbtiles artifacts
uses: actions/upload-artifact@v2
with:
name: mbtiles-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
path: *.mbtiles
path: outputs/*.mbtiles
if-no-files-found: error # 'warn' or 'ignore' are also available, 'error' will fail the step
retention-days: ${{ github.event_name == 'release' && 90 || 15 }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Common options:
* `-b` or `--bounds`: Bounding box in WSEN format, comma separated (required)
* `-Z` or `--maxzoom`: Maximum zoom level (required)
* `-z` or `--minzoom`: Minimum zoom level (optional, 0 if not provided)
* `-o` or `--outputdir`: Output directory (optional, "./" if not provided)
* `-o` or `--outputdir`: Output directory (optional, "outputs/" if not provided)
* `-f` or `--filename`: Name of the output MBTiles file (optional, "output" if not provided)

## CLI example usage
Expand Down Expand Up @@ -118,14 +118,14 @@ In the future, we may decide to extend this tool to support creating raster tile
To run the tool with Docker, run:

```bash
docker run -it --rm -v "$(pwd)":/app communityfirst/mapgl-tile-renderer --style "mapbox" --bounds "-79,37,-77,38" -Z 8 --mapboxstyle YOUR_USERNAME/YOUR_MAPBOX_STYLE_ID --apikey YOUR_API_KEY_HERE
docker run -it --rm -v "$(pwd)":/app/outputs communityfirst/mapgl-tile-renderer --style "mapbox" --bounds "-79,37,-77,38" -Z 8 --mapboxstyle YOUR_USERNAME/YOUR_MAPBOX_STYLE_ID --apikey YOUR_API_KEY_HERE
```

This automatically pulls the latest image from Docker hub. The `docker run` command is used to execute the mapgl-tile-renderer tool with a set of options that define how the map tiles will be rendered and saved. Here's a breakdown of the command and its variables:

- `-it`: This option ensures that the Docker container runs in interactive mode, allowing you to interact with the command-line interface.
- `--rm`: This option automatically removes the container when it exits, which helps to clean up and save disk space.
- `-v "$(pwd)":/app`: This mounts the current working directory (`$(pwd)`) to the `/app` directory inside the container, allowing the container to write the output files to your local file system.
- `-v "$(pwd)":/app/outputs`: This mounts the current working directory (`$(pwd)`) to the `/app/outputs` directory inside the container, allowing the container to write the output files to your local file system.
- `communityfirst/mapgl-tile-renderer`: This is the name of the Docker image that contains the mapgl-tile-renderer tool.
Make sure to replace the placeholder values with your actual information before running the command.

Expand All @@ -139,7 +139,7 @@ docker build -t mapgl-tile-renderer .
Then run:

```bash
docker run -it --rm -v "$(pwd)":/app mapgl-tile-renderer --style "mapbox" --bounds "-79,37,-77,38" -Z 8 --mapboxstyle YOUR_USERNAME/YOUR_MAPBOX_STYLE_ID --apikey YOUR_API_KEY_HERE
docker run -it --rm -v "$(pwd)":/app/outputs/ mapgl-tile-renderer --style "mapbox" --bounds "-79,37,-77,38" -Z 8 --mapboxstyle YOUR_USERNAME/YOUR_MAPBOX_STYLE_ID --apikey YOUR_API_KEY_HERE
```

## Azure Storage Queue example usage
Expand Down
Empty file added outputs/.keep
Empty file.
Loading