Hi, How to import India and GCC States data in local OSM server using osm2pgsql? asked 28 Jan '16, 08:52 Reshma Maner |
Download both country files & merge them with osmconvert (easier to use, as has fewer dependencies, but less functional, than Osmosis). Then import using osm2pgsql. Note that if you want to add additional countries with shared borders you will most likely have to reimport all the data. answered 29 Jan '16, 14:20 SK53 ♦ Can I not use osm2pgsql --append option to import the second pbf file?
(30 Jan '16, 10:25)
Reshma Maner
1
You can try it. Don't expect it to work at a reasonable speed, though - much faster to merge first and then load. (or at least it was when I last tried it, and looked at the "append" code in osm2pgsql, around 3 years ago).
(30 Jan '16, 10:33)
SomeoneElse ♦
How to merge .osm.pbf files. If I merge two files with these extensions and pass the merged file to osm2pgsql command, it gives error
(01 Feb '16, 07:38)
Reshma Maner
Which error? And how did you merge them?
(01 Feb '16, 08:05)
scai ♦
1
osmconvert india-latest.osm.pbf gcc-states-latest.osm.pbf -o=newmap.osm.pbf osmconvert Error: more than one .pbf input file is not allowed.
(01 Feb '16, 09:24)
Reshma Maner
Hi, Can somebody help?
(02 Feb '16, 09:54)
Reshma Maner
Maybe osmconvert can't merge PBF files directly and you have to convert them to another format before. Just a guess.
(02 Feb '16, 10:07)
scai ♦
I did that too. I first converted both the pbf files to .osm files. Then merged the two .osm files into single one. Then converted back .osm to .osm.pbf. But osm2pgsql command does not work with such created file.
(02 Feb '16, 10:19)
Reshma Maner
2
Following steps work for me: osmconvert gcc-state-latest.osm.pbf --out-o5m >gcc.o5m osmconvert india-latest.osm.pbf --out-o5m >india.o5m osmconvert india.o5m gcc.o5m --out-o5m > merged.o5m osmconvert merged.o5m --out-pbf >merged.pbf osm2pgsql -U postgres -d osm --host localhost -S default.style -s -C 500 -k merged.pbf The discrete conversion of the merged file from o5m to pbf might be doable in one step.
(02 Feb '16, 19:57)
SK53 ♦
showing 5 of 9
show 4 more comments
|
You can download the full OSM planet file from planet.openstreetmap.org, and then use osmosis to clip out the polygon(s) you want. You'll be left with a pbf file which you can import with osm2psql. answered 28 Jan '16, 08:54 rorym Can I not download two pbf files from geofabrik one for India and one for Gcc states and import both of them? Do I need to install osmosis? How to do that?
(28 Jan '16, 08:56)
Reshma Maner
1
The pbf files on Geofabrik don't follow exactly the borders of the respective countries, they simplify and go into the next country by maybe a few hundred metres, or so. Everything in the country is in the pbf file, but so is stuff from the neighbouring country. Hence importing 2 pbfs from countries that border each other will probably display OK for generating tiles, but not be very useful for say OSRM routing. India and GCC states appear to share no border, so that would be less of a problem
(28 Jan '16, 09:58)
rorym
You can download osmosis here http://wiki.openstreetmap.org/wiki/Osmosis#Downloading
(28 Jan '16, 09:58)
rorym
http://extract.bbbike.org offers extracts of self defined areas in one file but there is a size limit
(30 Jan '16, 11:42)
nevw
|
Could you explain what GCC States is? Is it Gulf Cooperation Council States?
Yes. It is Gulf Cooperation Council States