Hi! I succeeded to import the OSM data for Netherlands (by the way, took 38 hours to finish) and now I want also to import (in the same database) the OSM data for Belgium and Luxembourg. Do you know how can be done? I have tried using ./utils/setup.php --osm-file belgium.pbf --import-data , but didn’t work (stopped at some point: Setting up table: planet_osm_ways) Should I use ./utils/setup.php --osm-file belgium.pbf --load-data? Thank you! Best regards, Roxana asked 25 Aug '12, 09:31 RoxanaO aseerel4c26 ♦ |
I assume you are talking about importing into a Nominatim DB. In theory, you could do that by using the update script:
(pbf files will not work here) and then reindex your data:
But that will be very, very slow. The import will go much faster if you first merge the three country excerpts and then import the result in one go. answered 25 Aug '12, 10:47 lonvia 2
In the case of these three countries, there is even an excerpt available that already contains all three of them: planet-benelux
(25 Aug '12, 12:52)
cartinus
I tried also to import the merged made with the country excerpts and got a fatal error and stopped: COPY_END for COPY planet_osm_rels FROM STDIN; failed: ERROR: duplicate key value violates unique constraint "planet_osm_rels_pkey" And tried again with ./utils/update.php --import-file belgium.pbf but still have java errors from above. Any other ideas? Sorry for bother and thank you!
(28 Aug '12, 13:09)
RoxanaO
Ages ago someone posted a patch for osm2pgsql to modify instead of create data. If you really must merge data, you could try something like that - I'm sure that it'd be much slower than importing the data that cartinus linked to, though.
(28 Aug '12, 13:21)
SomeoneElse ♦
Looks like it cannot read pdf format. Try with the belgium.xml.bz2 file.
(28 Aug '12, 19:37)
lonvia
I have tried with belgium.osm (extracted from belgium.osm.bz2) and worked, but when I want to search (on local website) Belgium as a text: No results found. If I search after coordinates, for example: [51.4494967087473,4.46587880577936] should get: Oude Baan, Schildershof, Essen, Antwerpen, Antwerp, Flanders, 2910, Belgium, but instead I get only: Oude Baan, Belgium. Do you know why is this happening?
(29 Aug '12, 07:18)
RoxanaO
Yes, sorry, forgot to mention that you also have to reindex your data. I've added that step to my original answer.
(29 Aug '12, 07:30)
lonvia
If you use osmosis to do the merge, it will merge the files correctly when there are duplicate objects in the same files.
(23 Dec '12, 00:04)
smsm1
Solution works, but you can speed up the process by using osm2pgsql cahce like this(12G) ./utils/update.php --import-file ../azerbaijan-latest.osm.bz2 --osm2pgsql-cache 12000 And when indexing you can use threads aka index instances depending on your cpus count: ./utils/update.php –index --index-instances 4
(07 Jan '15, 07:57)
ttrumm
I approve that I had successfully imported the missing osm file into the existing nominatim database (europe+asia). I took an osm.bz2 file from geofabrik, unpacked it to an osm (to speed things up) and ran --import-file. It took me very reasonable 2 days on 4 core 5GB RAM VM. Next step will be indexing.
(23 Oct '17, 15:16)
sunsetjunks
When i try to import a little
(18 Apr '18, 22:19)
cybercoder
Please ask a new question.
(19 Apr '18, 07:53)
scai ♦
This is command: ./utils/update.php --import-file belgium.xml.bz2 not working! Although the data fills, table "word" - updated! As well checked command : ./utils/setup.php --import-data --osm-file belgium.osm.pbf It does not updated "placex" table, because of this not updated "search_word" table
(04 Dec '19, 08:05)
Uffik
showing 5 of 12
show 7 more comments
|
Hi, the easy way is to do the following:
If you have questions or need support, you can contact me: sistemas@aguilacontrol.com answered 04 Jul '16, 22:15 aguilacontrol Step 3:
Step 5:
(04 Jul '16, 22:19)
aguilacontrol
Hi aguilacontrol, thank you for the very clear instructions. I'm currently in the process of the last line of point 5. After point 5 succeeds and I want to update the Nominatim database, is your recommendation to do (from the wiki) rm settings/configuration.txt ./utils/setup.php --osmosis-init ./utils/setup.php --create-functions --enable-diff-updates ./utils/update.php --import-osmosis-all --no-npi and then have coffee, or do something else?
(07 Jan '17, 14:14)
OttoH
|
@lonvia Unfortunately didn't work! Here is the result:
/var/www/public_html/Nominatim/osmosis-0.40.1/bin/osmosis --read-xml 'belgium.pbf' --read-empty --derive-change --write-xml-change /var/www/public_html/Nominatim/data/osmosischange.osc ... org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion SEVERE: Thread for task 1-read-xml failed org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse xml file belgium.pbf.
@Cartinus Thank you for the link! It will help me, but I wanted to know how to do if I want to import countries one by one.
You are using the wrong Osmosis flag, use --read-pbf, not --read-xml, see http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage#PBF_Binary_Tasks (I have removed superfluous parts of above error message).
Hello, I have the same problem with you. And I use the following statement to import the first country data:
./utils/setup.php --osm-file countryA.bz2
However, it shows "countryA.bz2" not readable.
Do you know Why such problems have appeared?
Does the file countryA.bz2 exist? Is it located in your current directory? Is it readable by your user?