osm 2 sql

Hello everybody!

i want to build an application that needs to go through the database pretty quickly
so i want to convert the osm xml file to a sql server(osm2Pgsql dosent preserve the relation and so isnt very useful to me )
is that possible? are there any other alternatives?

thanks in advance!

Spatialite tools come with ready made binaries for importing OSM data into spatialite tables. It could be at least worth having a try with the “raw” tool.

There are some tools listed at http://wiki.openstreetmap.org/wiki/Planet.osm to use OSM data in a database.

Tell us whether you can find a solution or we have to dig deeper …

first of all thank you both

i’ve looked at the links and to my untrained eye :slight_smile: it looks like :
is what i am looking for
am i right? will this import to PostgreSQL preserve all the nod/way/relation data from the OSM file? so that for example i can do routing calculations?
and thanks again

Should work. But I’m not sure if it’s a good idea to do routing with a database. Rooting tools mainly use routing-optimized data structures which are held in main memory…

i dont really want to do routing,although i do want to run some kind of algorithm but with far less times it needs to access the DB then i guess a routing algorithm needs to.
so how do those routing algorithms work? for example if they use Planet.osm that’s way to much to keep in main memory isnt it?, and if they want to provide routing services world wide they need the whole file(?)

Minimize date, simplify data, filter data, minimize data, simplify… and so on. :slight_smile:

Example: For car routing you don’t need buildings, footways, rivers, railway stations, power lines. You usually don’t need nodes along a way, unless they mark crossings with other ways.

As a result, the planet file of about 13 GB compressed will shrink to some hundred MB.

hmm that sound’s reasonable enough :slight_smile: