wiktorn / Overpass-API

Overpass API docker image
MIT License
133 stars 47 forks source link

Multiple countries + updates #113

Closed MennoSaey closed 9 months ago

MennoSaey commented 9 months ago

I would like to only use for example 2 countries to keep the size to a minimum, is it possible to provide a download link to multiple countries and diffs or use multiple already locally downloaded files? how would updating them work?

P.s. I have gone through other similar issues but these answers weren't clear to me.

i currently have this docker compose file:

version: "3.8"

services:
  db:
    image: wiktorn/overpass-api
    container_name: `overpass_test`
    ports:
      - "4200:80"
    volumes:
      # mounts local subfolder into container
      - ./overpass_db:/db
    environment:
      OVERPASS_META: "no"
      OVERPASS_MODE: "init"
      OVERPASS_PLANET_URL: "file:///db/multiple_countries.osm.bz2"
      OVERPASS_DIFF_URL: "http://download.geofabrik.de/europe/germany/bayern-updates/"
      OVERPASS_RULES_LOAD: 10
      OVERPASS_UPDATE_SLEEP: 3600

what should be the OVERPASS_DIFF_URL to update a custom planet file?

an update on issue #67 is basically my question or atleast part of it. in short. what are the steps that differ from a normal installation to get a local overpass api running for lets say the benelux where there isn't a link i can provide from somwhere to download the files from or a way to select only a part of the europe planet file with osmium and only update that part too.

wiktorn commented 9 months ago

You can't provide multiple sources. But what you can do instead, to reach your goal, is to point out to the extract, that covers the areas of your interest and then use osmium to extract the areas of your interest using OVERPASS_PLANET_PREPROCESS.

The only thing that is missing, that if you want to run updates, you again need to point out to the diffs for your extract and then run the same osmium command on each of the diffs. This is missing functionality mentioned in #67 that you would need to add.

MennoSaey commented 9 months ago

i have no clue how i would add the functionality for updating the diffs, would the following case be viable: a planet url of europe using the OVERPASS_PLANET_PREPROCESS to extract areas of interest. (i assume this just makes it so that only this area is queried?) use update diff of europe.

the only thing i really care about is my query speed.

wiktorn commented 9 months ago

In the [README.md] there is an example how to use OVERPASS_PLANET_PREPROCESS:

mv /db/planet.osm.bz2 /db/planet.osm.pbf && osmium cat -o /db/planet.osm.bz2 /db/planet.osm.pbf && rm /db/planet.osm.pbf'

In this example, osmium is used to convert from osm.bz2 to pbf file.

And here you can find manual, how to use osmium to extract any area.

MennoSaey commented 9 months ago

`version: "3.8"

services: db: image: wiktorn/overpass-api container_name: overpass_test ports:

wiktorn commented 9 months ago

As you can notice in the example I provided above, when OVERPASS_PLANET_PREPROCESS is run, your file is available as /db/planet.osm.bz2.

What you need to do is to process it and in the end replace with the contents that match your requirements. Per documentation your command will produce the extracted areas on the output and original file will be left intact.

So I recommend moving the file first, then use -o /db/planet.osm.bz2 option to osmium to create trimmed version of the file.

Remember that OVERPASS_PLANET_PREPROCESS is only run when initializing the database. It is not run during updates from downloaded diffs, which is what is requested in #67

MennoSaey commented 9 months ago

thank you, i realise that it wont work with updates. I'll close this now.