kosmtik / kosmtik

Make maps with OpenStreetMap and Mapnik

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mbtiles export misses tiles and never completes

volcan01010 opened this issue · comments

I am exporting mbtiles using the script below. The export runs without raising any exceptions, however:

  • Only one of the four required tiles at level 9 is drawn.
  • The export never completes - instead it stops a few hundred tiles short of the final zoom level and the CPU usage stops.

Changing the bounding box can fix the issue with missing tiles on level 9. I wonder if the problem is due to calculation of required tiles?

I'm aware that this isn't the most helpful bug report. If there is a standard test dataset or similar, I will try to make the steps to reproduce.

Export script

#! /bin/bash

# Run the export

# Default settings export globe to data/output.mbtiles
X_MIN="${MBTILES_X_MIN:--180}"
Y_MIN="${MBTILES_Y_MIN:--85.05112877980659}"
X_MAX="${MBTILES_X_MAX:-180}"
Y_MAX="${MBTILES_Y_MAX:-85.05112877980659}"
MIN_ZOOM="${MBTILES_MIN_ZOOM:-1}"
MAX_ZOOM="${MBTILES_MAX_ZOOM:-6}"
OUTFILE="${MBTILES_FILE:-/openstreetmap-carto/data/output.mbtiles}"

echo "Exporting to ${OUTFILE}"


# Show kosmtik version (should be 0.0.16)
# Changes may be necessary as this bug is addressed:
# https://github.com/kosmtik/kosmtik/issues/118
echo "Getting Kosmtik version:"
npm list -g kosmtik

# Switch directory and extract files
cd /usr/lib/node_modules/kosmtik

rm -rf "${OUTFILE}"

node index.js export /openstreetmap-carto/project.mml \
       --format=mbtiles \
       --output="${OUTFILE}" \
       --minZoom=${MIN_ZOOM} --maxZoom=${MAX_ZOOM} \
       --bbox=${X_MIN},${Y_MIN},${X_MAX},${Y_MAX}

# Make file writeable (deletable) by any users
chmod a+w "${OUTFILE}"

exit 0

Example output

Exporting to /openstreetmap-carto/data/svg.mbtiles
Getting Kosmtik version:
/usr/lib
`-- kosmtik@0.0.17 

[Core] Loading config from /root/.config/kosmtik.yml
[Core] Loading plugin from ../plugins/base-exporters/index.js
[Core] Loading plugin from ../plugins/hash/index.js
[Core] Loading plugin from ../plugins/local-config/index.js
[Core] Loading plugin from ../plugins/datasource-loader/index.js
[Core] Loading plugin from kosmtik-overpass-layer
[Core] Loading plugin from kosmtik-fetch-remote
[Core] Loading plugin from kosmtik-overlay
[Core] Loading plugin from kosmtik-open-in-josm
[Core] Loading plugin from kosmtik-map-compare
[Core] Loading plugin from kosmtik-osm-data-overlay
[Core] Loading plugin from kosmtik-mapnik-reference
[Core] Loading plugin from kosmtik-geojson-overlay
[Core] Loading plugin from kosmtik-mbtiles-export
[Core] Loading project from /openstreetmap-carto/project.mml
[Core] Creating metatiles cache dir tmp/openstreetmap-carto/meta
[Core] Deleting previous metatiles tmp/openstreetmap-carto/meta
[Core] Created vector cache dir tmp/openstreetmap-carto/vector
[Local Config] Unable to load local config from /openstreetmap-carto/localconfig.js
[Error: File not found: /openstreetmap-carto/localconfig.js]
[Fetch Remote] Done.
[Export] Starting MBTiles export to /openstreetmap-carto/data/svg.mbtiles
[Export] Starting MBTiles export, with bounds -61.705 12.568 -60.712 13.626 and from zoom 2 to 17
[Core] Generating Mapnik XML…
[Core] Using mapnik version 3.0.20
[Core] Loading map…
[Core] Map ready
[Export] Processing zoom 2
[Export] 1 tiles to process
[Export] Processing zoom 3
[Export] 1 tiles to process
[Export] Processing zoom 4
[Export] 1 tiles to process
[Export] Processing zoom 5
[Export] 1 tiles to process
[Export] Processing zoom 6
[Export] 1 tiles to process
[Export] Processing zoom 7
[Export] 1 tiles to process
[Export] Processing zoom 8
[Export] 1 tiles to process
[Export] Processing zoom 9
[Export] 4 tiles to process
[Export] Processing zoom 10
[Export] 16 tiles to process
[Export] Processing zoom 11
[Export] 49 tiles to process
[Export] Processing zoom 12
[Export] 169 tiles to process
[Export] Processing zoom 13
[Export] 624 tiles to process
[Export] Processing zoom 14
[Export] 2346 tiles to process
[Export] Processing zoom 15
[Export] 9100 tiles to process
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Bold' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Bold' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Serif Tibetan Regular' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
Mapnik LOG> 2020-03-16 17:06:13: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'