This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to prune the .osm data?

0

Hi all:

I'm a newbie trying to do some analysis with the .osm data.

My first task is to parse the xml into efficient data struture for later search algorithm.

But noticably, there is pretty much noise in the raw data.(e.g. one road may have several <way> tags, some nodes in <way><nd> are redundant)

Just wondering if there is a standard way to prune the raw .osm data instead of hacking by myself?

Thanks for your help Best E

asked 17 Oct '11, 02:18

eminemya's gravatar image

eminemya
1444
accept rate: 0%

edited 27 Oct '14, 00:36

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


2 Answers:

0

The "pruning" of data is highly specialised to the algorithm you are running, and most algorithms are capable of handeling "noise" in the data. Hence there are no standard way of "pruning" the data to fit any algoritm.

I would suggest you merge the ways based on the name/ref either on import or after you have applied the search algorithm. The later may be perfered if you want to update the date structure.

answered 17 Oct '11, 07:29

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

Thanks for your advice :)

(17 Oct '11, 14:23) eminemya

0

You could use GPSBabel to do some auto pruning or you could view and prune with GPSprune. http://activityworkshop.net/software/gpsprune/ https://wiki.openstreetmap.org/wiki/GPSBabel

answered 08 Oct '14, 13:08

andy%20mackey's gravatar image

andy mackey
13.2k87143285
accept rate: 4%

Source code available on GitHub .