This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Overpass-API on custom osm postgres database exported as XML

0

Hi everyone,

I have an experimental osm postgres database and website api set according to

https://github.com/openstreetmap/openstreetmap-website

Is there any way I can set the overpass-API to read my own osm postgres db?

Issue: https://github.com/drolbr/Overpass-API/issues/624

The contributor implies that I need to export my database in OSM XML format, is there any instructions on how to achieve that?

Thanks in advance!

asked 29 Jun '21, 09:32

ubill88's gravatar image

ubill88
11113
accept rate: 0%


2 Answers:

2

You haven't said why you have your own database. If you have your own database because you have non-OSM data in it, then yes, exporting that data in OSM XML and importing into Overpass is the way to go. You would typically use the "osmosis" command line tool with a combination of the --read-apidb and --write-xml flags. See https://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.48 for details.

If you have your own database but it has standard OSM data in it, then of course this makes no sense at all and you would simply feed Overpass OSM data downloaded from any of the usual sources!

Also, consider if you really need Overpass. It might be possible to run any queries that you are interested in on your existing API database with some SQL cleverness, which would save you the - potentially long-running - export-import step.

If your own database is very big and the osmosis export step takes too long, you might consider a special tool to convert an API database dump created with pg_dump into an XML representation: https://github.com/zerebubuth/planet-dump-ng

answered 29 Jun '21, 09:43

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 29 Jun '21, 09:49

Hi @Frederik Ramm ♦ thanks for your reply, I have my own postgres database with standard OSM data in it. There are some custom keys and values stored in my experimental region so I'm trying to create my own Overpass API. According to your reply, I just need to feed Overpass my own OSM data. I'm actually stuck in this part. According to the installation guide: https://overpass-api.de/no_frills.html bin/download_clone.sh --source=https://dev.overpass-api.de/api_drolbr/ --db-dir="db/" --meta=no My question is actually here, how to feed my local osm postgres database to Overpass API? Thank you very much!

(30 Jun '21, 04:16) ubill88

0

Hello @ubill88, I was wondering if you managed to do this ? I am also looking to do something like this. It would be great if you can share the solution.

answered 31 Mar '22, 13:19

Allhad's gravatar image

Allhad
1
accept rate: 0%

Source code available on GitHub .