Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GDAL/OGR by Jason Tipton

GDAL/OGR by Jason Tipton

GDAL and OGR are open source libraries that many GIS software packages use. Many common tasks that are performed in ArcGIS can be performed from the command line. Some utilities would otherwise require ArcInfo level to perform where others can’t be done in ArcGIS. This session will be an introduction to these libraries and will show examples of how to get file information, file conversions, and create a raster index and mosaic. Also, if you’ve ever wondered what to do with a GeoPDF or a MapInfo .tab file, this will let you know.

More Decks by Arkansas GIS Users Forum Conference

Other Decks in Technology

Transcript

  1. Why GDAL/OGR • Don’t have ArcInfo $$$ • Need to

    convert formats that ArcMap can’t read • ArcMap crashes 8 out of 10 times, every time. • Open Source
  2. What is GDAL/OGR • How do you say it? •

    Geospatial Data Abstraction Library • Open Source • Free! • Handy • GDAL: Raster data • OGR: Vector data
  3. Add To Path Env Variable • Open cmd • setx

    path "%path%;C:\Program Files\GDAL" • open new cmd. "echo %path%" to confirm OR • Right Click Computer > Properties > Advanced System Settings > Environment Variables • Open Path and add path to GDAL
  4. ArcMap Interchange Format • Failed to import in ArcMap 10.2

    • ogr2ogr output input.e00 • Examples: • ogr2ogr out_boone_region boone_region.e00 • ogr2ogr out_chattanooga_r chattanooga_r.e00
  5. MapInfo TAB • Couldn’t find option in ArcMap • ogr2ogr

    output.shp input.TAB • Examples: • ogr2ogr zout_AtokaTAB.shp AtokaTAB.TAB • ogr2ogr zout_Baldwin.shp Baldwin.TAB
  6. File GDB to PostGIS • W/O GDAL Requires ArcServer •

    HowTo: http://lab.usgin.org/groups/best- practices-usgin-web-service-hosting/convert- file-gdb-postgis-database • ogr2ogr -f "PostgreSQL" PG:"connectionString" "C:\pathToFile\file.gdb" "FeatureClassName"
  7. Shp to PostGIS • ogr2ogr -f "PostgreSQL" PG:"connectionString" "C:\pathToFile\file.shp" •

    Example: • ogr2ogr -f "PostgreSQL" PG:"host=localhost port=5432 dbname=postgis20 user=postgres password=admin" "C:\Users\jtipton\Desktop\symposium\gdal\MapInfo\zout_UpperFay.shp"
  8. GeoPDF • *My Favorite Format Ever! • USGS Topo Maps

    Historic and New • http://nationalmap.gov/ustopo/index.html • *Can’t be added to ArcMap
  9. GeoPDF (Historic Topos) • gdal_translate [options] in.pdf out.tiff • Historic

    Topos are flat and are essentially just Tiffs trapped in a PDF cage. • Example: • gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES" AR_Rogers_259521_1958_24000_geo.pdf AR_Rogers_259521_1958_24000_geo.tif --config GDAL_PDF_DPI 300
  10. GeoPDF (New Topos) • gdal_translate [options] in.pdf out.tiff • New

    Topos are layered • Example: • gdalinfo AR_Rogers_20110713_TM_geo.pdf - mdd LAYERS • gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES" AR_Rogers_20110713_TM_geo.pdf AR_Rogers_20110713_TM_geo.tif -- config GDAL_PDF_LAYERS_OFF "Map_Collar","Map_Frame.Projection_and_Grids" --config GDAL_PDF_DPI 300