Hi guys, I spent the whole day trying to import a .osm-file into a database on Windows 7. I read many many pages about how to do this, but still I didn't succeed. :-( The problem is that there are so many different tools available and as a newbie I just can't decide which to use. I would be so happy, if you could give a step by step instruction on how to do it. It must be possible somehow! ;-) There is no need to be too detailed right now, I will try to follow your steps as good as possible and will just ask if more detail is needed for me. Thank you so much in advance! drummer asked 08 Oct '11, 18:24 drummer83 |
Hi, you have to do some tweaking to your postgis database to make it work with osm. If you understand German, look at my wiki-Page: http://wiki.openstreetmap.org/wiki/User:Ajoessen/Postgis Greetings, ajoessen answered 14 Oct '11, 07:45 ajoessen Any chance you'd know of an english version of that?
(25 Nov '12, 19:21)
JuZeeMan
|
Once you have set up PostGIS on Windows (which is outside the scope of OSM and you should find information about this elsewhere), Osmosis can be used to import data. You will not get a database that is fit for standard rendering with Mapnik, but if all you need is to somehow get the data into PostGIS, that might be the easiest way. Osmosis can write different data schemas and which one you choose depends on what you want to do with the data. You could also choose an even simpler path and download a set of shape files for your region from the Geofabrik download server, then use the shp2pgsql that comes with PostGIS to load the shape files into a database. Note however that in contrast to the Osmosis approach, this will not give you the complete set of OSM data - just the stuff that the Geofabrik people chose to export in their shape file. answered 08 Oct '11, 18:41 Frederik Ramm ♦ Hi, thanks for your answer. I decided to go for your second approach, as it seems to be easier. So I set up PostgreSQL 9.1 and PostGIS 1.5.3 using all the standard settings. I didn't choose to create a spatial database during the PostGIS setup. When I try to import the shapefile (hamburg.shp -> roads.shp) using shp2pgsql it says the connection succeeded, but I get the following error:
What is the problem here? Thanks for any suggestions. Using your first approach (osmosis) I guess I have to set up a database with the correct structure first. Is any of the files in this folder doing it for me? C:Program Filesosmosis-0.39scriptcontrib apidb_0.6.sql maybe? But what do I have to do to execute the script? I tried pasting the code in the SQL part of pgAdmin but which database has to be selected: postgres? template_postgis? a new one? Thanks for any help!
(09 Oct '11, 10:33)
drummer83
|