Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Geospatial Development By Example with Python

You're reading from   Geospatial Development By Example with Python Build your first interactive map and build location-aware applications using cutting-edge examples in Python

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785282355
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Pablo Carreira Pablo Carreira
Author Profile Icon Pablo Carreira
Pablo Carreira
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Preparing the Work Environment 2. The Geocaching App FREE CHAPTER 3. Combining Multiple Data Sources 4. Improving the App Search Capabilities 5. Making Maps 6. Working with Remote Sensing Images 7. Extract Information from Raster Data 8. Data Miner App 9. Processing Big Images 10. Parallel Processing Index

Installing GDAL and OGR

GDAL (Geospatial Data Abstraction Library) is composed of two packages that come together: OGR handles geospatial vector file formats, including coordinate system transformations and vector operations. GDAL is the raster part of the library, and in version 1.11, it comes packed with 139 drivers that can read, and some even create rasters. GDAL also comes packed with functions for raster transformations and calculations such as resizing, clipping, reprojecting, and so on.

In the following tables, there's an excerpt of the list of GDAL and OGR drivers with the most common formats that you may find:

Long format name

Code

Creation

Arc/Info ASCII Grid

AAIGrid

Yes

Arc/Info Export E00 GRID

E00GRID

No

ENVI .hdr Labelled Raster

ENVI

Yes

Generic Binary (.hdr Labelled)

GENBIN

No

Oracle Spatial GeoRaster

GEORASTER

Yes

GSat File Format

GFF

No

Graphics Interchange Format (.gif)

GIF

Yes

GMT Compatible netCDF

GMT

Yes

GRASS ASCII Grid

GRASSASCIIGrid

No

Golden Software ASCII Grid

GSAG

Yes

Golden Software Binary Grid

GSBG

Yes

Golden Software Surfer 7 Binary Grid

GS7BG

Yes

TIFF / BigTIFF / GeoTIFF (.tif)

GTiff

Yes

GXF (Grid eXchange File)

GXF

No

Erdas Imagine (.img)

HFA

Yes

JPEG JFIF (.jpg)

JPEG

Yes

NOAA Polar Orbiter Level 1b Data Set (AVHRR)

L1B

No

NOAA NGS Geoid Height Grids

NGSGEOID

No

NITF

NITF

Yes

NTv2 Datum Grid Shift

NTv2

Yes

PCI .aux Labelled

PAux

Yes

PCI Geomatics Database File

PCIDSK

Yes

PCRaster

PCRaster

Yes

Geospatial PDF

PDF

Yes

NASA Planetary Data System

PDS

No

Portable Network Graphics (.png)

PNG

Yes

R Object Data Store

R

Yes

Raster Matrix Format (*.rsw, .mtw)

RMF

Yes

RadarSat2 XML (product.xml)

RS2

No

Idrisi Raster

RST

Yes

SAGA GIS Binary format

SAGA

Yes

USGS SDTS DEM (*CATD.DDF)

SDTS

No

SGI Image Format

SGI

Yes

SRTM HGT Format

SRTMHGT

Yes

Terragen Heightfield (.ter)

TERRAGEN

Yes

USGS ASCII DEM / CDED (.dem)

USGSDEM

Yes

ASCII Gridded XYZ

XYZ

Yes

The following table describes the OGR drivers:

Format name

Code

Creation

Arc/Info Binary Coverage

AVCBin

No

Arc/Info .E00 (ASCII) Coverage

AVCE00

No

AutoCAD DXF

DXF

Yes

Comma Separated Value (.csv)

CSV

Yes

ESRI Shapefile

ESRI Shapefile

Yes

GeoJSON

GeoJSON

Yes

Géoconcept Export

Geoconcept

Yes

GeoRSS

GeoRSS

Yes

GML

GML

Yes

GMT

GMT

Yes

GPSBabel

GPSBabel

Yes

GPX

GPX

Yes

GPSTrackMaker (.gtm, .gtz)

GPSTrackMaker

Yes

Hydrographic Transfer Format

HTF

No

Idrisi Vector (.VCT)

Idrisi

No

KML

KML

Yes

Mapinfo File

MapInfo File

Yes

Microstation DGN

DGN

Yes

OpenAir

OpenAir

No

ESRI FileGDB

OpenFileGDB

No

PCI Geomatics Database File

PCIDSK

Yes

Geospatial PDF

PDF

Yes

PDS

PDS

No

PostgreSQL SQL dump

PGDump

Yes

U.S. Census TIGER/Line

TIGER

No

Note

You can find the full GDAL and OGR API documentation and the complete list of drivers at http://gdal.org/python/.

Windows

Again, we will use a wheel for the installation. Repeat the same procedure as before:

  1. Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/.
  2. Now, search for GDAL and download the file named GDAL‑1.11.3‑cp27‑none‑win32.whl.
  3. Finally, install it with pip, as we did before.

Ubuntu Linux

Perform the following steps:

  1. Go to the terminal or open a new one.
  2. Then, enter the following command:
    sudo apt-get install python-gdal
    
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image