Skip to content

Commit

Permalink
made sure that martin loads fonts and sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jul 14, 2024
1 parent a14f42e commit 7f2badd
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 29 deletions.
57 changes: 43 additions & 14 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ services:
condition: service_started
db:
condition: service_healthy
osm2pgsql:
image: iboates/osm2pgsql:latest
environment:
PGPASSWORD: ${POSTGRES_PASSWORD}
command:
- replication
- update
- --database ${POSTGRES_DB}
- --username ${POSTGRES_USER}
- --host db
- --port 5432
depends_on:
db:
condition: service_healthy
meilisearch:
image: getmeili/meilisearch:v1.9.0
restart: unless-stopped
Expand Down Expand Up @@ -88,3 +74,46 @@ services:
retries: 5
interval: 10s
start_period: 10s
osm2pgsql:
image: iboates/osm2pgsql:latest
environment:
PGPASSWORD: ${POSTGRES_PASSWORD}
command:
- replication
- update
- --database ${POSTGRES_DB}
- --username ${POSTGRES_USER}
- --host db
- --port 5432
depends_on:
db:
condition: service_healthy
martin-init-config:
image: alpine:latest
command:
- /bin/sh
- /map/martin/setup.sh
volumes:
- ./map/:/map/
martin:
image: ghcr.io/maplibre/martin:v0.14.2
restart: unless-stopped
command:
- --listen-addresses
- 0.0.0.0:3001
- --base-path
- /
- --config
- /map/config.yaml
ports:
- "3001:3001"
environment:
- BASE_PATH=/
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
depends_on:
db:
condition: service_healthy
martin-init-config:
condition: service_completed_successfully
volumes:
- ./map/martin/:/map/:rw
2 changes: 2 additions & 0 deletions map/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ tile_weights.tsv.gz
sources/
tmp/
data/
martin/fonts/
martin/sprites/
24 changes: 9 additions & 15 deletions map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ this.
From the root of the repository, run either (depending on your waiting tolerance and avaliable RAM):

- <details><summary>[~minutes] Only <b>Germany</b> with approx 64GB of RAM</summary>

```bash
docker run -it -e JAVA_TOOL_OPTIONS="-Xmx54g" -v "$(pwd)/map":/data ghcr.io/onthegomap/planetiler:latest --download --download-threads=10 --download-chunk-size-mb=1000 --fetch-wikidata --languages=de,en --area=germany --Xmx10g --Xmx54g --nodemap-type=sparsearray --nodemap-storage=ram
```

</details>

- <details><summary>[~1 hour] Only <b>Germany</b> with lower RAM</summary>

```bash
docker run -it -e JAVA_TOOL_OPTIONS="-Xmx10g" -v "$(pwd)/map":/data ghcr.io/onthegomap/planetiler:latest --download --download-threads=10 --download-chunk-size-mb=1000 --fetch-wikidata --languages=de,en --area=germany --Xmx10g --storage=mmap
```

</details>

- <details><summary>[~3 hours] <b>Planet</b> with approx 128GB of RAM</summary>

```bash
docker run -it -e JAVA_TOOL_OPTIONS="-Xmx100g" -v "$(pwd)/map":/data ghcr.io/onthegomap/planetiler:latest --download --download-threads=10 --download-chunk-size-mb=1000 --fetch-wikidata --languages=de,en --area=planet --bounds=world --Xmx100g --nodemap-type=sparsearray --nodemap-storage=ram
```

</details>
- <details><summary>[~24 hours] <b>Planet</b> with lower amounts of RAM (slower)</summary>

```bash
docker run -it -e JAVA_TOOL_OPTIONS="-Xmx25g" -v "$(pwd)/map":/data ghcr.io/onthegomap/planetiler:latest --download --download-threads=10 --download-chunk-size-mb=1000 --fetch-wikidata --languages=de,en --area=planet --bounds=world --Xmx25g --nodemap-type=array --storage=mmap
```
Expand Down Expand Up @@ -114,17 +114,11 @@ docker run -it --rm -p 8888:8888 maputnik/editor
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| ![Where in Maputnik to click to import a style](/resources/documentation/maputnik-import1.png) | ![Where in Maputnik to click then to import a style](/resources/documentation/maputnik-import2.png) |

### Fonts
### Fonts + Sprites

You will need special fonts ([Roboto](https://fonts.google.com/specimen/Roboto) and [Roboto Condensed](https://fonts.google.com/specimen/Roboto+Condensed)) to run the tileserver.
To do so, please download the font files from google fonts (linked above), convert them via https://maplibre.org/font-maker/ and upload them to the `fonts/` directory of the tileserver
Due to licencing reasons, we cannot directly include the fonts and sprites we use in the project.
You can download them via

### Sprites

We get our sprites from [maputnik/osm-liberty](https://github.com/maputnik/osm-liberty) via

```
export TILE_SPRITES_URL=https://raw.githubusercontent.com/maputnik/osm-liberty/gh-pages/sprites
rm sprites/*
wget -P sprites ${TILE_SPRITES_URL}/osm-liberty.json ${TILE_SPRITES_URL}/[email protected] ${TILE_SPRITES_URL}/osm-liberty.png ${TILE_SPRITES_URL}/[email protected]
```bash
sh ./martin/setup.sh
```
Loading

0 comments on commit 7f2badd

Please sign in to comment.