2

I'm developing a WebGIS in Linux development platform that cannot use internet and need to deal with maps and positioning.

I have used nominatim on OpenStreetMap to implement it. I use postgresql and postgis as my database according to the installation steps of OSM website. Now I have established the server, which contain one country data. I use the following statement to import the first country data:

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/country-latest.osm.pbf --all

I try to use the following statement to import the second country data:

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/anothercountry-latest.osm.pbf --all

It shows "the nominatim database already exists".

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/country-latest.osm.pbf anothercountry-latest.osm.pbf --all

It shows "The file or directory could not be found".

So how do I import the second country data?

5

It would probably be cleaner to join the two PBF files before you do the load. Something like

osmosis --read-pbf file="countryA.pbf" --read-pbf file="countryB.pbf"  --merge --write-pbf file="merged.pbf"

then just use merged.pbf for the load.

If you have more than that, you can just keep adding them, but you need a --merge for each one (so three countries needs two --merge commands, just after each other).

  • I have used the osmosis --read-xml file="countryA.pbf" --read-xml file="countryB.pbf" --write-xml file="merged.pbf" statement, but it shows "Execution aborted. org.openstreetmap.osmosis.core.OsmosisRuntimeException: The following named pipes () and 1 default pipes have not been terminated with appropriate output sinks." – Epulari Dec 20 '16 at 13:38
  • Updated it to add the missing command, and to use the right kind of read and write commands (pbf vs xml). Sorry. – BradHards Dec 20 '16 at 20:19
  • I'm sorry for bother you again. I have done as the updated command, however, it shows "Task type read-pbf doesn't exist." – Epulari Dec 23 '16 at 7:13
  • What version of osmosis do you have? – BradHards Dec 23 '16 at 7:45
  • 0.44.1-4 it shows "It is the latest version." – Epulari Dec 23 '16 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.