OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2008-05-25 15:18:53

Wullimann
Member
From: Lüneburger Heide
Registered: 2008-05-25
Posts: 7

Convert OSM-Data to use in AMPL/MathProg

Hi!

Is there a conversion tool to extract data from .osm-files and to convert them into a text file? I just need data for a plain directed graph G(V,E,c). Thus I need a table with at least three columns: start node, end node and the length of the edge.

Martin

Offline

#2 2008-05-26 18:21:52

Lambertus
Administrator
From: Apeldoorn (NL)
Registered: 2007-03-17
Posts: 3,269
Website

Re: Convert OSM-Data to use in AMPL/MathProg

Well .osm files are text files using XML markup. You will need to write your own script to translate the XML format to your custom one. This can be done in any scripting language even XSLT (which I don't recommend). There are scripts in the SVN repository that can give you a headstart or at least ideas on how to solve this.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#3 2008-05-26 21:29:41

Wullimann
Member
From: Lüneburger Heide
Registered: 2008-05-25
Posts: 7

Re: Convert OSM-Data to use in AMPL/MathProg

Yes, I just started to write a script in PHP. It seems to work.

Martin

Offline

#4 2008-05-27 08:13:27

emj
Member
From: .se (59.3N17.99E) 0735969076
Registered: 2006-06-18
Posts: 949

Re: Convert OSM-Data to use in AMPL/MathProg

please post the script when you have a prototype.. ;-) I'm sure many people will find themselves in your position at sometime in the future.

Offline

Board footer

Powered by FluxBB