Osmtrackfilter.pl/HowTo

From OpenStreetMap Wiki
(Redirected from HowTo OSMTrackFilter)
Jump to navigation Jump to search

HowTo Install OSMTrackFilter (Debian)

To install OSMTrackFilter on a Debian Linux, you can try two different things:

install with/from gpsdrive-svn

Instaling the current GpsDrive Debian Development Snapshot also installs osmtrackfilter. So normally this should be the easiest way to install osmtrackfilter.

You could also install the openstreetmap-utils packague from the GpsDrive Debian repository.

Add following lines to your /etc/apt/sources.list

# Gpsdrive Packages
deb     http://www.gpsdrive.de/debian etch main
deb-src http://www.gpsdrive.de/debian etch main

after that run

apt-get update
apt-get install openstreetmap-utils

maybe you have to fix some dependencies manually

apt-get install libwww-perl libxml-parser-perl libfile-slurp-perl libtimedate-perl libdate-manip-perl

See also: GpsDrive Debian HowTo

plain install from scratch

have to do the following steps:

As root do:

aptitude install libwww-perl libxml-parser-perl libfile-slurp-perl libtimedate-perl libdate-manip-perl subversion

As normal user:

# get all programms from the Openstreetmap svn-repository
svn co http://svn.openstreetmap.org/
# Download the newest planet.osm 
# and extract your region from it as csv-excerpt
# If you would happen to have enough RAM (2GB is not enough)
# you could try using the area world
cd svn.openstreetmap.org/applications/utils/export/osm2csv/
perl ./osm2csv.pl -v --area=europe
# symlink the file, so it will be referenced in the future
cd
cd osm/planet/csv
ln -s osm-europe.csv osm.csv

Filtering with OSMTrackFilter

# Filter your gpx/gdb/mps/nmea/TXT/... File
cd svn.openstreetmap.org/applications/utils/import/osmtrackfilter
perl ./osmtrackfilter.pl --filter-all -v path-to-file/your-track*.gpx

The resulting Files are:

Summary files of all tracks processed by the last osmtrackfilter command
 ./00_combination.gpx        : all filtered data
 ./00_combination.osm        : all filtered and converted to osm
 ./00_combination-raw.gpx    : all data without any filters
 ./00_combination-upload.gpx : all data with minimal filtering and obfuscated time/date
results for every single Track:
 path-to-file/your-track-xx.nmea         : the original track-file
 path-to-file/your-track-xx.nmea-raw.gpx : the File converted from nmea to gpx without any filtering
 path-to-file/your-track-xx.nmea-converted.gpx : the converted and filtered File in gpx format for checking
 path-to-file/your-track-xx.gpx.osm      : the result converted into a osm-file

Correcting before uploading

You then can take the resulting files and load them into josm. But before uploading the results you HAVE to check and correct the results. Most of the time you'll have to delete some parts which are duplicate in your track or against the existing osm data. For this I normally do the following steps: symlink the following:

ln -s path-to-file/your-track-xx.nmea-raw track-raw.gpx
ln -s path-to-file/your-track-xx.nmea-raw track-converted.gpx
ln -s path-to-file/your-track-xx.nmea.osm track.osm

then i start

josm  track-converted.gpx track.gpx

I have set the colour of raw to a very dark blue and the colour of converted to a bright yellow. If I use the symlinked files I don't have to set the colour for every new track; I then only have to set the colour once, since josm remembers the colour to each filename. This way I immediately see which parts would be added if I would upload the your-track-xx.nmea.osm file. Then I start another josm with the track.osm File and delete every part which i don't want to upload to OSM because it already exists, is wrong, looks wired, ... And only if everything in the josm instance with the osm-file looks good I do upload the new stuff to the OSM Server.