Manipulating Spatial Data using Open Source Tools
Introduction
A common way to manipulate spatial data is through the use of GIS, which is not without its drawbacks.
- Limited process memory
- Batch processing is difficult
- May require licensed extensions
- Requires use of proprietary formats
- Limited options
- Expensive
Existing solutions
FME
Global Mapper
ESRI ModelBuilder
FME
Global Mapper
ESRI ModelBuider
What do you really need?
GDAL/OGR Tools
Geospatial Data Abstraction Library (GDAL)
OpenGIS Simple Features Reference Implementation (OGR)
In late 1998, Frank Warmerdam started work on the GDAL/OGR library
Library for reading/writing raster and vector geospatial data formats
Distributed under the terms of X11/MIT License
Supported on all modern flavors of Unix and most versions of Microsoft Windows.
Why use these tools?
import gdal, ogr, osr
Driving GDAL/OGR
Tools are driven from the command line, there is no user interface! Now this might take some getting used to.
Create a VRT from XYZ
<OGRVRTDataSource>
<OGRVRTLayer name="dem">
<SrcDataSource>dem.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="X" y="Y" z="Z"/>
</OGRVRTLayer>
</OGRVRTDataSource>
gdalbuildvrt dem.txt dem.vrt
XYZ Soundings to GRID
gdal_grid -l dem dem.vrt dem.tif
GRID to Contour Model
gdal_contour -f "GML" -a DEPCNT -i 0.5 -nln data dem.tif contours.gml
Applying the technology
How OceanWise harness GDAL/OGR tools
Supporting Formats
By embedding the GDAL/OGR drivers into our internal data processing tools we are able to save time and money whilst supporting a huge variety of Raster/Vector formats and the entire proj4 coordinate reference system library!
Processing large datasets
Bathymetric datasets are an example of Maritime data which is constantly increasing in size. Most programs, GIS included, won't allow you to load more than 4GB of data.
What do you do when you're handed a large bathymetric dataset to build with a contour model?
Raster Charts XL
Alternatives
- QGIS - An open source GIS that uses the OGR and GDAL libraries to view several vector and raster formats, and includes support for PostGIS tables and GRASS digitizing.
- OpenLayers - A pure JavaScript library for displaying map data in most modern web browsers, with no server-side dependencies. OpenLayers implements a JavaScript API for building rich web-based geographic applications.
- Shapely - Python package for manipulation and analysis of planar geometric objects.
Thank you for listening.
Drive Your Data - The Easy Way
By georgeiswright
Drive Your Data - The Easy Way
Presentation delivered by George Wright at OceanWise GIS Workshop 2016
- 1,307