Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement download-diff #313

Open
zstadler opened this issue Sep 4, 2020 · 1 comment
Open

Implement download-diff #313

zstadler opened this issue Sep 4, 2020 · 1 comment

Comments

@zstadler
Copy link
Contributor

zstadler commented Sep 4, 2020

import-update repeatedly pulls the changes from the replication server and applies them according the replication_interval defined in the ${IMPOSM_CONFIG_FILE} file. It works well for the daily updates available for Planet and Geofabrik. It is not applicable for minutely updates because it cannot be active in parallel with the required refresh of the mbtiles by export-list.sh. This limitation is caused by a PostgreSQL restriction preventing read access to materialized views while they are being updated.

Therefore, a continuous minutely update of mbtiles would run export-list.sh in-between subsequent runs of import-diff. AFAIK, there is no tool in openmaptiles-tools to provide the required input for import-diff.

The download-diff would use the replication URL created by download-osm in the ${IMPOSM_CONFIG_FILE} file to:

  • Download the required updates from the replication, according to the latest timestamp in ${area}.pbf
  • Assemble them into the changes.osc.gz file as input for required by import-diff
  • Update the ${area}.pbf file

The minutely updates flow would repeat the following sequence:

  1. Execute download-diff to combine all new minutely updates into the changes.osc.gz file.
  2. Execute import-diff to update the PostGIS DB and create the list of expired tiles.
  3. Extend the list of expired tiles to all zoom levels between MIN_ZOOM and MAX_ZOOM, similar to @frodrigo's tile_multiplier.py
  4. Execute export-list.sh to update the expired tiles in the mbtiles file.

A simpler, yet less-optimized flow could run quickstart.sh in-between runs of download-diff.

The implementation is likely to use osmupdate and osmconvert, already available in the openmaptiles-tools docker image.

@nyurik and @frodrigo,
your thoughts?

@frodrigo
Copy link
Contributor

frodrigo commented Sep 4, 2020

Note.
The replacement of materialized view by table is in progress.
The 3. is an independent issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants