Geoprocessing with Python / Edition 1

Geoprocessing with Python / Edition 1

by Chris Garrard
ISBN-10:
1617292141
ISBN-13:
9781617292149
Pub. Date:
05/23/2016
Publisher:
Manning
ISBN-10:
1617292141
ISBN-13:
9781617292149
Pub. Date:
05/23/2016
Publisher:
Manning
Geoprocessing with Python / Edition 1

Geoprocessing with Python / Edition 1

by Chris Garrard
$49.99
Current price is , Original price is $49.99. You
$49.99 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores
  • SHIP THIS ITEM

    Temporarily Out of Stock Online

    Please check back later for updated availability.


Overview

Summary

Geoprocessing with Python teaches you how to use the Python programming language, along with free and open source tools, to read, write, and process geospatial data.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

This book is about the science of reading, analyzing, and presenting geospatial data programmatically, using Python. Thanks to dozens of open source Python libraries and tools, you can take on professional geoprocessing tasks without investing in expensive proprietary packages like ArcGIS and MapInfo. The book shows you how.

About the Book

Geoprocessing with Python teaches you how to access available datasets to make maps or perform your own analyses using free tools like the GDAL, NumPy, and matplotlib Python modules. Through lots of hands-on examples, you’ll master core practices like handling multiple vector file formats, editing geometries, applying spatial and attribute filters, working with projections, and performing basic analyses on vector data. The book also covers how to manipulate, resample, and analyze raster data, such as aerial photographs and digital elevation models.

What's Inside
  • Geoprocessing from the ground up
  • Read, write, process, and analyze raster data
  • Visualize data with matplotlib
  • Write custom geoprocessing tools
  • Three additional appendixes available online

About the Reader

To read this book all you need is a basic knowledge of Python or a similar programming language.

About the Author
Chris Garrard works as a developer for Utah State University and teaches a graduate course on Python programming for GIS.
Table of Contents

  1. Introduction
  2. Python basics
  3. Reading and writing vector data
  4. Working with different vector file formats
  5. Filtering data with OGR
  6. Manipulating geometries with OGR
  7. Vector analysis with OGR
  8. Using spatial reference systems
  9. Reading and writing raster data
  10. Working with raster data
  11. Map algebra with NumPy and SciPy
  12. Map classification
  13. Visualizing data

    1. Appendixes

  • A - Installation
  • B - References
  • C - OGR - online only
  • D - OSR - online only
  • E - GDAL - online only

Product Details

ISBN-13: 9781617292149
Publisher: Manning
Publication date: 05/23/2016
Edition description: 1st Edition
Pages: 360
Product dimensions: 7.40(w) x 9.20(h) x 1.00(d)

About the Author

Chris Garrard works as a developer for Utah State University and teaches a graduate course on Python programming for GIS.

Table of Contents

Preface xi

Acknowledgments xiii

About this book xiv

About the author xvii

About the cover illustration xviii

1 Introduction 1

1.1 Why use Python and open source? 2

1.2 Types of spatial data 3

1.3 What is geoprocessing? 7

1.4 Exploring your data 10

1.5 Summary 14

2 Python basics 15

2.1 Writing and executing code 16

2.2 Basic structure of a script 17

2.3 Variables 18

2.4 Data types 20

Booleans 20

Numeric types 20

Strings 22

Lists and tuples 24

Sets 26

Dictionaries 26

2.5 Control flow 27

If statements 27

While statements 29

For statements 29

Break, continue, and else 30

2.6 Functions 31

2.7 Classes 32

2.8 Summary 34

3 Reading and writing vector data 35

3.1 Introduction to vector data 36

3.2 Introduction to OGR 41

3.3 Reading vector data 44

Accessing specific features 47

Viewing your data 49

3.4 Getting metadata about the data 51

3.5 Writing vector data 54

Creating new data sources 59

Creating new fields 61

3.6 Updating existing data 63

Changing the layer definition 63

Adding, updating, and deleting features 64

3.7 Summary 66

4 Working with different vector file formats 67

4.1 Vector file formats 68

File-based formats such as shapefiles and geoJSON 68

Multi-user database formats such as PostGIS 71

4.2 Working with more data formats 71

SpatiaLite 72

PostGIS 73

Folders as data sources (shapefiles and CSV) 74

Esri file geodatabases 74

Web feature services 76

4.3 Testing format capabilities 84

4.4 Summary 87

5 Filtering data with OGR 88

5.1 Attribute filters 89

5.2 Spatial filters 93

5.3 Using SQL to create temporary layers 99

5.4 Taking advantage of filters 103

5.5 Summary 104

6 Manipulating geometries with OGR 105

6.1 Introduction to geometries 106

6.2 Working with points 107

Creating and editing single points 108

Creating and editing multipoints: multiple points as one geometry 110

6.3 Working with lines 112

Creating and editing single lines 114

Creating and editing multilines: multiple lines as one geometry 118

6.4 Working with polygons 120

Creating and editing single polygons 122

Creating and editing multipolygons: multiple polygons as one geometry 124

Creating and editing polygons with holes: donuts 126

6.5 Summary 128

7 Vector analysis with OGR 129

7.1 Overlay tools: what's on top of what? 130

7.2 Proximity tools: how far apart are things? 136

7.3 Example: locating areas suitable for wind farms 140

7.4 Example: animal tracking data 144

7.5 Summary 152

8 Using spatial reference systems 153

8.1 Introduction to spatial reference systems 154

8.2 Using spatial references with OSR 159

Spatial reference objects 159

Creating spatial reference objects 161

Assigning an SRS to data 163

Reprojecting geometries 164

Reprojecting an entire layer 167

8.3 Using spatial references with pyproj 168

Transforming coordinates between spatial reference systems 169

Great-circle calculations 171

8.4 Summary 172

9 Reading and writing raster data 173

9.1 Introduction to raster data 174

9.2 Introduction to GDAL 181

9.3 Reading partial datasets 187

Using real-world coordinates 193

Resampling data 196

9.4 Byte sequences 200

9.5 Subdatasets 203

9.6 Web map services 204

9.7 Summary 207

10 Working with raster data 208

10.1 Ground control points 209

10.2 Converting pixel coordinates to another image 213

10.3 Color tables 215

Transparency 217

10.4 Histograms 218

10.5 Attribute tables 221

10.6 Virtual raster format 223

Subsetting 225

Creating troublesome formats 227

Reprojecting images 228

10.7 Callback functions 230

10.8 Exceptions and error handlers 232

10.9 Summary 236

11 Map algebra with NumPy and SciPy 237

11.1 Introduction to NumPy 238

11.2 Map algebra 242

Local analyses 243

Focal analyses 247

Zonal analyses 258

Global analyses 263

11.3 Resampling data 267

11.4 Summary 275

12 Map classification 276

12.1 Unsupervised classification 278

12.2 Supervised classification 280

Accuracy assessments 284

12.3 Summary 286

13 Visualizing data 287

13.1 Matplotlib 288

Plotting vector data 288

Plotting raster data 300

Plotting 3D data 305

13.2 Mapnik 307

Drawing vector data 308

Storing information as XML 314

Drawing raster data 316

Summary 318

Appendix A Installation 319

Appendix B References 327

Index 331

From the B&N Reads Blog

Customer Reviews