Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Learning Geospatial Analysis with Python-Second Edition
Learning Geospatial Analysis with Python-Second Edition

Learning Geospatial Analysis with Python-Second Edition: An effective guide to geographic information systems and remote sensing analysis using Python 3

eBook
₹799.99 ₹3276.99
Paperback
₹4096.99
Subscription
Free Trial
Renews at ₹800p/m

What do you get with a Packt Subscription?

Free for first 7 days. ₹800 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Learning Geospatial Analysis with Python-Second Edition

Chapter 2. Geospatial Data

One of the most challenging aspects of geospatial analysis is the data. Geospatial data already includes dozens of file formats and database structures and continues to evolve and grow to include new types of data and standards. Additionally, almost any file format can technically contain geospatial information simply by adding a location. In this chapter, we'll examine some common traits of geospatial data. Then we'll look at some of the most widely used vector data types followed by raster data types. We'll gain some insight into newer, more complex types including point cloud data and web services.

An overview of common data formats

As a geospatial analyst, you may frequently encounter the following general data types:

  • Spreadsheets and comma-separated files (CSV files) or tab-separated files (TSV files)
  • Geotagged photos
  • Lightweight binary points, lines, and polygons
  • Multi-gigabyte satellite or aerial images
  • Elevation data such as grids, point clouds, or integer-based images
  • XML files
  • JSON files
  • Databases (both servers and file databases)
  • Web services

Each format contains its own challenges for access and processing. When you perform analysis on data, usually you have to do some form of preprocessing first. You might clip or subset a satellite image of a large area down to just your area of interest, or you might reduce the number of points in a collection to just the ones meeting certain criteria in your data model. A good example of this type of preprocessing is the SimpleGIS example at the end of Chapter 1, Learning Geospatial Analysis with Python. The state dataset included just the state...

Data structures

Despite dozens of formats, geospatial data have common traits. Understanding these traits can help you approach and understand unfamiliar data formats by identifying the ingredients common to nearly all spatial data. The structure of a given data format is usually driven by its intended use. Some data is optimized for efficient storage or compression, some is optimized for efficient access, some is designed to be lightweight and readable (web formats), while other data formats seek to contain as many different data types as possible.

Interestingly, some of the most popular formats today are also some of the simplest and even lack features found in more capable and sophisticated formats. Ease of use is extremely important to geospatial analysts because so much time is spent integrating data into geographic information systems as well as exchanging data among analysts. Simple data formats facilitate these activities the best.

Common traits

Geospatial analysis is an approach applying...

Spatial indexing

Geospatial datasets are often very large files easily reaching hundreds of megabytes or even several gigabytes in size. Geospatial software can be quite slow in trying to repeatedly access large files when performing analysis. As discussed briefly in Chapter 1, Learning Geospatial Analysis with Python, spatial indexing creates a guide, which allows software to quickly locate query results without examining every single feature in the dataset. Spatial indexes allow software to eliminate possibilities and perform more detailed searches or comparisons on a much smaller subset of the data.

Indexing algorithms

Many spatial indexing algorithms are derivatives of well-established algorithms used for decades on nonspatial information. The two most common spatial indexing algorithms are Quadtree index and R-tree index.

Quadtree index

The Quadtree algorithm actually represents a series of different algorithms based on a common theme. Each node in a Quadtree index contains four children...

Overviews

Overview data is most commonly found in raster formats. Overviews are resampled, lower resolution versions of raster datasets that provide thumbnail views or simply faster loading image views at different map scales. They are also known as pyramids and the process of creating them is known as pyramiding an image. These overviews are usually preprocessed and stored with the full resolution data either embedded with the file or in a separate file. The compromise of this convenience is that the additional images add to the overall file size of the dataset; however, they speed up image viewers. Vector data also has a concept of overviews, usually to give a dataset geographic context in an overview map. However, because vector data is scalable, reduced size overviews are usually created on the fly by software using a generalization operation as mentioned in Chapter 1, Learning Geospatial Analysis with Python.

Occasionally, vector data is rasterized by converting it into a thumbnail...

Metadata

As discussed in Chapter 1, Learning Geospatial Analysis with Python, metadata is any data that describes the associated dataset. Common examples of metadata include basic elements such as the footprint of the dataset on the Earth as well as more detailed information such as spatial projection and information describing how the dataset was created. Most data formats contain the footprint or bounding box of the data on the Earth. Detailed metadata is typically stored in a separate location in a standard format such as the U.S. Federal Geographic Data Committee (FGDC) Content Standard for Digital Geospatial Metadata (CSDGM), ISO, or the newer European Union initiative, which includes metadata requirements, called the Infrastructure for Spatial Information in the European Community (INSPIRE).

An overview of common data formats


As a geospatial analyst, you may frequently encounter the following general data types:

  • Spreadsheets and comma-separated files (CSV files) or tab-separated files (TSV files)

  • Geotagged photos

  • Lightweight binary points, lines, and polygons

  • Multi-gigabyte satellite or aerial images

  • Elevation data such as grids, point clouds, or integer-based images

  • XML files

  • JSON files

  • Databases (both servers and file databases)

  • Web services

Each format contains its own challenges for access and processing. When you perform analysis on data, usually you have to do some form of preprocessing first. You might clip or subset a satellite image of a large area down to just your area of interest, or you might reduce the number of points in a collection to just the ones meeting certain criteria in your data model. A good example of this type of preprocessing is the SimpleGIS example at the end of Chapter 1, Learning Geospatial Analysis with Python. The state dataset included just the state...

Data structures


Despite dozens of formats, geospatial data have common traits. Understanding these traits can help you approach and understand unfamiliar data formats by identifying the ingredients common to nearly all spatial data. The structure of a given data format is usually driven by its intended use. Some data is optimized for efficient storage or compression, some is optimized for efficient access, some is designed to be lightweight and readable (web formats), while other data formats seek to contain as many different data types as possible.

Interestingly, some of the most popular formats today are also some of the simplest and even lack features found in more capable and sophisticated formats. Ease of use is extremely important to geospatial analysts because so much time is spent integrating data into geographic information systems as well as exchanging data among analysts. Simple data formats facilitate these activities the best.

Common traits

Geospatial analysis is an approach applying...

Spatial indexing


Geospatial datasets are often very large files easily reaching hundreds of megabytes or even several gigabytes in size. Geospatial software can be quite slow in trying to repeatedly access large files when performing analysis. As discussed briefly in Chapter 1, Learning Geospatial Analysis with Python, spatial indexing creates a guide, which allows software to quickly locate query results without examining every single feature in the dataset. Spatial indexes allow software to eliminate possibilities and perform more detailed searches or comparisons on a much smaller subset of the data.

Indexing algorithms

Many spatial indexing algorithms are derivatives of well-established algorithms used for decades on nonspatial information. The two most common spatial indexing algorithms are Quadtree index and R-tree index.

Quadtree index

The Quadtree algorithm actually represents a series of different algorithms based on a common theme. Each node in a Quadtree index contains four children...

Overviews


Overview data is most commonly found in raster formats. Overviews are resampled, lower resolution versions of raster datasets that provide thumbnail views or simply faster loading image views at different map scales. They are also known as pyramids and the process of creating them is known as pyramiding an image. These overviews are usually preprocessed and stored with the full resolution data either embedded with the file or in a separate file. The compromise of this convenience is that the additional images add to the overall file size of the dataset; however, they speed up image viewers. Vector data also has a concept of overviews, usually to give a dataset geographic context in an overview map. However, because vector data is scalable, reduced size overviews are usually created on the fly by software using a generalization operation as mentioned in Chapter 1, Learning Geospatial Analysis with Python.

Occasionally, vector data is rasterized by converting it into a thumbnail image...

Metadata


As discussed in Chapter 1, Learning Geospatial Analysis with Python, metadata is any data that describes the associated dataset. Common examples of metadata include basic elements such as the footprint of the dataset on the Earth as well as more detailed information such as spatial projection and information describing how the dataset was created. Most data formats contain the footprint or bounding box of the data on the Earth. Detailed metadata is typically stored in a separate location in a standard format such as the U.S. Federal Geographic Data Committee (FGDC) Content Standard for Digital Geospatial Metadata (CSDGM), ISO, or the newer European Union initiative, which includes metadata requirements, called the Infrastructure for Spatial Information in the European Community (INSPIRE).

File structure


The preceding elements can be stored in a variety of ways in a single file, multiple files, or database depending on the format. Additionally, this geospatial information can be stored in a variety of formats, including embedded binary headers, XML, database tables, spreadsheets/CSV, separate text, or binary files.

Human readable formats such as XML files, spreadsheets, and structured text files require only a text editor to investigate. These files are also easily parsed and processed using Python's built-in modules, data types, and string manipulation functions. Binary-based formats are more complicated. It is thus typically easier to use a third-party library to deal with binary formats.

However, you don't have to use a third-party library, especially if you just want to investigate the data at a high level. Python's built-in struct module has everything that you need. The struct module lets you read and write binary data as strings. When using the struct module, you need...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Construct applications for GIS development by exploiting Python
  • This focuses on built-in Python modules and libraries compatible with the Python Packaging Index distribution system—no compiling of C libraries necessary
  • This practical, hands-on tutorial teaches you all about Geospatial analysis in Python

Description

Geospatial Analysis is used in almost every field you can think of from medicine, to defense, to farming. This book will guide you gently into this exciting and complex field. It walks you through the building blocks of geospatial analysis and how to apply them to influence decision making using the latest Python software. Learning Geospatial Analysis with Python, 2nd Edition uses the expressive and powerful Python 3 programming language to guide you through geographic information systems, remote sensing, topography, and more, while providing a framework for you to approach geospatial analysis effectively, but on your own terms. We start by giving you a little background on the field, and a survey of the techniques and technology used. We then split the field into its component specialty areas: GIS, remote sensing, elevation data, advanced modeling, and real-time data. This book will teach you everything you need to know about, Geospatial Analysis from using a particular software package or API to using generic algorithms that can be applied. This book focuses on pure Python whenever possible to minimize compiling platform-dependent binaries, so that you don’t become bogged down in just getting ready to do analysis. This book will round out your technical library through handy recipes that will give you a good understanding of a field that supplements many a modern day human endeavors.

Who is this book for?

If you are a Python developer, researcher, or analyst who wants to perform Geospatial, modeling, and GIS analysis with Python, then this book is for you. Familarity with digital mapping and analysis using Python or another scripting language for automation or crunching data manually is appreciated

What you will learn

  • Automate Geospatial analysis workflows using Python
  • Code the simplest possible GIS in 60 lines of Python
  • Mold thematic maps with Python tools
  • Get hold of the various forms that geospatial data comes in
  • Produce elevation contours using Python tools
  • Create flood inundation models
  • Apply Geospatial analysis to find out about real-time data tracking and for storm chasing

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 31, 2015
Length: 394 pages
Edition : 1st
Language : English
ISBN-13 : 9781783552429
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. ₹800 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Dec 31, 2015
Length: 394 pages
Edition : 1st
Language : English
ISBN-13 : 9781783552429
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
₹800 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
₹4500 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₹400 each
Feature tick icon Exclusive print discounts
₹5000 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₹400 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 12,290.97
Python Geospatial Development
₹4096.99
Python Geospatial Analysis Cookbook
₹4096.99
Learning Geospatial Analysis with Python-Second Edition
₹4096.99
Total 12,290.97 Stars icon
Banner background image

Table of Contents

11 Chapters
1. Learning Geospatial Analysis with Python Chevron down icon Chevron up icon
2. Geospatial Data Chevron down icon Chevron up icon
3. The Geospatial Technology Landscape Chevron down icon Chevron up icon
4. Geospatial Python Toolbox Chevron down icon Chevron up icon
5. Python and Geographic Information Systems Chevron down icon Chevron up icon
6. Python and Remote Sensing Chevron down icon Chevron up icon
7. Python and Elevation Data Chevron down icon Chevron up icon
8. Advanced Geospatial Python Modeling Chevron down icon Chevron up icon
9. Real-Time Data Chevron down icon Chevron up icon
10. Putting It All Together Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(4 Ratings)
5 star 50%
4 star 25%
3 star 0%
2 star 0%
1 star 25%
Zack Jul 11, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This excellent book starts with a deep history of geospatial science and then dives into practical applications of the technology for common mapping problems. What I really like about this book is that it doesn't stop at "here's how to put a Google maps widget into your web application". This book goes deeper and explains how to use real geospatial analysis. In my personal experience, knowing how to use those analytic techniques opened up new possibilities in applications that greatly increased their usefulness.A lot of material is covered in this book and it would serve as an excellent primer to anyone who's been handed a mapping project but doesn't know where to start. GIS can be a bit overwhelming at first because it's really its own little world. In order to build a working app you usually wind up using several different software libraries, special file formats like shapefile, and spatial databases. This book gives an excellent overview of each and shows how to practically apply these new skills to solve real problems.I also recommend this book if you're a GIS pro but you've spent most of your career looking at the world through an Esri lens. The open source software covered is worth knowing and you may find yourself turning to it where you would normally reach for Arc*. It's amazing how simple and lightweight some of the applications are.
Amazon Verified review Amazon
John A. Maurer IV Jan 22, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
DIY GIS via Python. Why spend gobs of money on ESRI ArcGIS or Matlab when you can do it yourself for free with Python? Power to the people (er, programmer)! Go Pythonistas! This book would make a fantastic undergraduate- and/or graduate-level textbook for an alternative Python-based GIS or scientific computing class.Not only does this book lay the groundwork to sufficiently educate the reader on geospatial analysis (its history, basic terminology, etc.), it has relevant, fun examples, plentiful screenshots throughout, and an enthusiastic and inspiring tone. It provides a crystal clear breakdown of key GIS concepts, giving equal weight to both vector and raster data sources. Motivates the reader to use programming for geospatial analysis as opposed to just traditional "point-and-click" GIS software. With programming, the possibilities are practically limitless: utilities can be coded to meet specific needs rather than being limited to whatever canned set of functions a particular software package provides.Already we get our hands dirty building a simple Python GIS example in chapter 1.Chapter 2 provides a useful survey of data formats, which can otherwise feel like a dizzying and overwhelming array of options for the novitiate. The chapter helps boil this down into the various types, categorized by vector or raster, human-readable or binary. Even in a book focused primarily on Python, it is important to lay this kind of groundwork so that the reader isn’t later bogged down or confused simply by the chosen data format of a given example, etc. The author also covers Open Geospatial Consortium (OGC) web services, web mapping, and GeoJSON.Chapter 3 highlights many of the big players in today’s geotech industry in an organized fashion that helps make sense out of the chaos: an invaluable overview for newbies to bring them up to speed on a diverse technology stack. While it is not Python per se, the chapter brings the focus back to Python at the end.Chapter 4 surveys many of the important Python geo-modules with good examples of how to use them.Chapter 5 delves more deeply into a few Python modules for greater enrichment. The reader learns a whole slew of handy tricks and tips and could already easily adapt the numerous examples provided to solve many real-world GIS problems. Highlights include Shapefile manipulation, data visualization, reading Excel spreadsheets, geocoding, and parsing GPS data.While chapter 5 focuses on aspects of vector data, chapter 6 spreads the love to raster data, accomplishing many of the more common (though complicated) remote sensing (i.e. satellite data) tasks.Chapter 7 illustrates the complexities and advantages of elevation (DEM) datasets and how Python can be leveraged to process and visualize them—-a useful follow-on to the previous vector and raster chapters since DEMs are part both (and more). With contours, shaded relief maps, and color-coded rasters, there are unique ways of analyzing elevation that differ from other datasets. Another highlight for me was the inclusion of LiDAR data.Chapter 8 showcases the kind of “heavy lifting” that can be achieved with all of the skills accrued earlier in the book, including terrain routing, street routing, flood inundation models, and vegetation analysis (via NDVI). It shows off the capabilities and flexibility inherent to a Python GIS approach.Chapter 9 goes beyond the more "static" GIS paradigm and addresses time. It puts near real-time information (tracking bus locations) onto maps, both static maps and interactive ones (via Leaflet). This chapter introduces readers to a typical Web GIS workflow using REST, Web Map Service (WMS), XML, and OpenStreetMaps.The closing chapter (chapter 10) does a good job of combining lots of the previous lessons into one “grand finale”, including vector, raster, hillshades, and real time data using state of the art examples, also incorporating Google Charts and producing PDF reports in the finished product.As the proverb goes: "Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime". In a similar spirit, giving the "GIS" analyst a GUI-based software package solves a limited set of problems and leaves them hungry for the next upgrade and new buttons to press (often blindly); teach them to program, however, and they can solve any problem themselves. And they will also likely gain a better understanding of the processing that is involved along the way.
Amazon Verified review Amazon
J Parkinson Aug 12, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Great introduction to the topic. Lots of useful examples.
Amazon Verified review Amazon
John B. Nelson Nov 15, 2016
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
The easiest way to justify my one star review is with an example: The code listing starting on page 207 and extending to page 209 uses turtle graphics to draw a histogram.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.