GPS 2D polygons

GPS|GPS

Fieldwork
Power on the GPS devise as soon as you are on the field, in order to acquire the satellite.

When you are on the survey unit that you are going to check, you should walk and track around the bounding box of that SU. Choose a starting point and check the GPS accuracy, if it is good enough you are ready to go.

|--Open the 'Track Manager' page from the GPS menu. |   |--Enter the 'Current Track' submenu and |      |--'Clear Current Track' before you start your walking

As soon as the GPS acquires the satellites, it starts to track the receivers movement over time in the 'Current Track'. You need to clean that track before track the survey unit.

|        |--'View Map' and walk around the SU up to your end/start point |           |--'Save Track' as: Locality SU# (serial number)

If you find something interesting during your walk, just collect it and mark the point.

|           |--'Mark' as: ### (serial number)

GPSBabel

 * http://www.gpsbabel.org GPSBabel

Save the raw data from the device! GPX format is highly recommended.

GPX (GPS eXchange format) is a standard interchange format that can contain any number of waypoints, routes and tracks in the same file.

Connect the GPS to the notebook and use GPSBabel to download gpx files (Waypoint or Tracks) in your local directory.

|--Input → Device → Format: Garmin serial/USB protocol |   |--Device Name: usb |      |--Translation Options → | | Waypoints | | Routes |x| Tracks |         |--Output → File → Format: GPX XML |            |--File Name: yyyymmdd_locality_su#_type(*) | 	    |--OK!

(*) yyyymmdd_locality_su#_type (where type is: track or points)

Your gpx file looks like:

Download sample data:


 * 

QGIS

 * http://www.qgis.org/en/docs/user_manual/working_with_gps/plugins_gps.html

First of all check the CRS (Coordinate Reference System) of the project!

|--Project → Project properties → CRS |   |-- |      |--Select WGS84 EPSG:4326 → OK

QGIS displays waypoints in point layers while routes and tracks are displayed in linestring layers. But we need polygon from track.

Open QGIS and connect the GPS device to your notebook.

|--Vector → GPS → GPS Tools |   |--Load GPX file → Browse → Features type → OK

Repeat the operation for each GPX file that you want to load in QGIS.

The GPX file are loaded as layers of the QGIS current project.

Each file.gpx has a table of attribute, like:

From the layer menu select the GPX track layer that you want to transform in polygon.

|--Vector → Geometry Tools → Lines to polygon |   |--Input line vector layer: your GPX track |      |--Output polygon shapefile: Browse the directory and type the name |         |--|x| Add result to cancas → OK

The polygon has been created and saved as Shapefile, with an attribute table, but it seems not so beauty... Most of the time you get a topological invalid geometry.

You need to validate it!

Using the QGIS tools, or using the GRASS tools...

GRASS

 * https://qgis.org/en/docs/user_manual/grass_integration/grass_integration.html
 * http://grass.osgeo.org/grass64/manuals/v.in.ogr.html
 * http://grasswiki.osgeo.org/wiki/QGIS_GRASS_Cookbook

GRASS is a fully topological GIS, this means that when importing a vector layer in its own data model it does not tolerate topological errors (that the simple features models allows, ex: overlaps).

Fix the topological problem in GRASS, or save again the grass vector in shapefile and load it as QGIS layer to clean it using the vector tools.

Now that you have a topological correct polygon, you should update the database.

PostgreSQL/PostGIS
shp2pgsql is a shapefile to postgis loader.

The shp2pgsql data loader converts ESRI Shape files into SQL suitable for insertion into a PostGIS/PostgreSQL database.

Edit su_polygon.sql

Or...

GPSBabel
TODO Upgrade! New release 1.5.0

Transform waypoints into a route, tracks into routes...


 * http://www.gpsbabel.org/htmldoc-1.5.0/filter_transform.html

QGIS
Load the original track and the waypoints from that track, in order to remove bad points, before to create the polygon...

GRASS

 * http://grass.osgeo.org/grass64/manuals/v.in.gpsbabel.html
 * http://grass.osgeo.org/grass64/manuals/v.hull.html

GRASS

 * http://grass.osgeo.org/grass64/manuals/v.in.gpsbabel.html
 * http://grass.osgeo.org/grass64/manuals/v.hull.html

-p Force vertices of track or route data as points