Skip to Content
Mastering Geospatial Analysis with Python
book

Mastering Geospatial Analysis with Python

by Silas Toms, Paul Crickard, Eric van Rees
April 2018
Beginner to intermediate content levelBeginner to intermediate
440 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Geospatial Analysis with Python

Using a spatial filter to select features

This example uses the Natural Earth Dataset introduced in Chapter 4Data Types, Storage, and Conversion, under the Reading and writing vector data with GeoPandas section. We'll use latitude-longitude coordinates to create a spatial filter in the form of a bounding box. This box selects only the data inside of this box. This is a way to work with a subset of our data. We'll use OGR's SpatialFilterRec method, which takes four values—minx, miny, maxx and maxy, to create a bounding box. Our (random) example is to select the cities in our bounding box (which shows the state of Texas, as well as parts of Oklahoma and Mexico). To filter our results even further, we only want the cities in the US. This means ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Geospatial Analysis with Python

Learning Geospatial Analysis with Python

Joel Lawhead

Publisher Resources

ISBN: 9781788293334Supplemental Content