2. Agenda
1. What is GDAL?
2. Software using GDAL
3. Geospatial Data
4. Abstraction
5. Library or maybe framework?
6. Getting started with GDAL and C#
7. More Information
3. What is GDAL?
● Translator library for raster and vector geospatial data formats
● Started in 1998 by Frank Warmerdam as independent professional
● Now the project is under OSGeo’s umberlla
● Free and Open Source Software
● Written in C++
5. GDAL - Geospatial Data Abstraction Library
Data which has a geographical or spatial aspect
Raster - A spatial data model that defines space as an array of
equally sized cells arranged in rows and columns, and composed of
single or multiple bands.
Vector - A coordinate-based data model that represents geographic
features as points, lines, and polygons.
6. GDAL - Geospatial Data Abstraction Library
3 major classes within the GDAL library:
● GDAL - Raster
● OGR - Vector
● OSR - Spatial Reference
What can they do?
Coordinate system conversion, statistics, format conversion, geo operations on
geometries and layers, image merge, build pyramids, create a tileindex, Convert rgb
to indexed color, etc...
7. GDAL - Geospatial Data Abstraction Library
Presents a single raster abstract data model and a single vector abstract data model
to the calling application for all supported formats.
● Supported raster formats (142 drivers) : GeoTIFF, Erdas Imagine, ECW,
JPEG2000, DTED…
● Supported vector formats (84 drivers): ESRI Shapefile, ESRI ArcSDE, ESRI
FileGDB, KML, PostGIS, Oracle Spatial, AutoCAD DWG, Elasticsearch...
8. GDAL - Geospatial Data Abstraction Library
Example for GDAL abstraction:
9. GDAL - Geospatial Data Abstraction Library
Or maybe framework?
● Cross platform - Windows (32, 64 bit), MAC OS X, Linux
● Variety of programming language bindings - Offical: C#, Java. Perl, Python
Unofficial: Go, Lua, Node.js, PHP, Tcl.
● Comes with many useful command line utilities for data translation and
processing
● Extensibility for more geo formats (with plugins)
● Wide community
10. GDAL - Geospatial Data Abstraction Library
Examples for using command line utiltiles:
● ogr2ogr - converts simple features data between file formats
● gdalinfo - lists information about a raster dataset
% ogr2ogr -f "ESRI Shapefile" c:output.shp "PG: host=localhost user=postgres
dbname=gisdb password=postgres" -sql "SELECT name, geom FROM tableName"
% gdalinfo c:input.tiff
11. GDAL - Geospatial Data Abstraction Library
A personal experience about how the
community helped me:
Few months ago, I submitted a new bug
in the GDB driver. Two weeks later the
bug was fixed and published as part of the
next GDAL version.
12. Getting started with GDAL in C#
1. Download the latest version of the precompiled GDAL binaries (32 or 64 bit)
2. Extract the contents from the zip file to a location on your hard disk e.g.
C:Program FilesGDAL
3. Include the path to C:Program FilesGDAL in your PATH system variable and
add path to C:Program FilesGDALgdal-data in a new system variable named
GDAL_DATA
4. Add references to dll-files that can be found at C:Program FilesGDALcsharp
5. Write your code
6. To view the full turorial click here
13. More Information
Links:
● http://www.gdal.org - official GDAL website
● http://www.gisinternals.com - website to download sources
● Getting started with GDAL and C#
● http://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/ - gdal examples in C#
● GDAL dev forum
● https://trac.osgeo.org/gdal - website to submit bugs
Create by: Tomer .L. and Ori .A.