User Tools

Site Tools


gis_tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
gis_tools [2013/03/20 12:44]
mantis [Openstreetmap]
gis_tools [2017/04/05 15:42]
mstraub [Merge *.gpx into Shapefile]
Line 1: Line 1:
 +====== Openstreetmap ======
 +
 +===== Get extract =====
 +
 +
 +<code bash>
 +wget -O vienna.osm "​http://​www.overpass-api.de/​api/​xapi?​map?​bbox=16.25,​48.1,​16.5,​48.3"​
 +</​code>​
 +
 +===== Get statistics =====
 +
 +<code bash>
 +wget -O - http://​m.m.i24.cc/​osmfilter.c |cc -x c - -O3 -o osmfilter # found at http://​wiki.openstreetmap.org/​wiki/​Osmfilter ​
 +</​code>​
 +
 +<code bash>
 +./osmfilter estonia.osm --out-count
 +</​code>​
 +
 +======= QGIS =======
 +
 +
 +======= Gpsbabel =======
 +GPSBabel converts waypoints, tracks, and routes between popular GPS receivers and mapping programs. It also has powerful manipulation tools for such data. Install it
 +
 +<code bash>
 +sudo aptitude install gpsbabel
 +</​code>​
 +
 +===== General Information =====
 +gpsbabel understands lots of formats and supports lots of filter functions like removing duplicates, sorting waypoints etc. Look for the -x option in the man page.
 +
 +It is written in C.
 +
 +===== Routes,​Tracks,​Waypoints =====
 +First a general note: GPSBabel distinguishes between routes, tracks and waypoints. So typically you will want to pass one of the following switches on the commandline
 +
 + * -r Process route information
 + * -t Process track information
 + * -w Process waypoint information [default]
 +
 +If you do a conversion and the output file is empty, it is most likely that you need to use a different of the above switches!
 +
 +===== Examples =====
 +==== Convert GPX to CSV ====
 +<code bash>
 +gpsbabel -t -i gpx -f input.gpx -o unicsv -x track,​course,​speed -F output.csv
 +</​code>​
 +
 +==== Add Speed and Course ====
 +If you are processing '''​track information'''​ use the switch
 +
 +<code bash> -x track,​course,​speed</​code>​
 +
 +==== Converting GPS NMEA to GPX====
 +<code bash> gpsbabel ​ -i nmea,​date=20090601 -f input.nmea -x transform,​wpt=trk -o gpx -F output.gpx
 +</​code>​
 +
 +Notes:
 +
 + * a date (see example above) must be given if your GPS data doesn'​t contain one already.
 + * wpt=trk creates waypoints out of tracks.
 +
 +==== Download tracks from QStarz BT-Q1000 ====
 +These tracking devices connect via USB. In Ubuntu 10.04 the device should be accessible at /​dev/​ttyACM0 by default.
 +
 +Data can then be downloaded (details [[http://​www.cyrius.com/​debian/​gps/​bt-q1000x/​|here]]):​
 +
 +<code bash>
 +gpsbabel -t -w -i mtk -f /​dev/​ttyACM0 -o gpx -F out.gpx
 +</​code>​
 +More documentation in gpsbabel'​s manpage ​ and [[http://​www.gpsbabel.org/​htmldoc-development/​fmt_mtk.html|here]].
 +
 +======= mtkbabel =======
 +The [[http://​www.rigacci.org/​wiki/​doku.php/​doc/​appunti/​hardware/​gps_logger_i_blue_747|OSS mtkbabel]] (made using Perl) works with Mediatek mtk chipsets, which are eg. part of Qstarz tracking devices. Besides downloading data, allows for scriptable configuration of the device (control settings, change log file layout etc.)
 +
 +<code bash>
 +sudo apt-get install mtkbabel
 +</​code>​
 +====== bt747 ======
 +This [[http://​www.bt747.org/​|Java tool]] aims to provide a GUI for GPS logging device configuration and log data handling. It is available for desktops and mobile devices.
 +
 +
 +====== ogr2ogr ======
 +
 +===== Merge shapefiles =====
 +
 +<code bash>
 +ogr2ogr merged.shp file1.shp ​                                   # create a copy of file1
 +ogr2ogr -update -append merged.shp file2.shp -nln merge         # append file2
 +</​code>​
 +
 +===== Merge *.gpx into Shapefile =====
 +
 +<code bash>
 +#!/bin/bash
 +SAVEIFS=$IFS
 +IFS=$(echo -en '​\n'​)
 +for f in *.gpx
 +do
 +  ogr2ogr gpx.shp -append "​$f"​ tracks -fieldTypeToString DateTime
 +done
 +IFS=$SAVEIFS ​
 +</​code>​
 +
  
gis_tools.txt ยท Last modified: 2019/02/27 15:44 by mstraub