Book Image

Mastering Geospatial Analysis with Python

By : Silas Toms, Paul Crickard, Eric van Rees
Book Image

Mastering Geospatial Analysis with Python

By: Silas Toms, Paul Crickard, Eric van Rees

Overview of this book

Python comes with a host of open source libraries and tools that help you work on professional geoprocessing tasks without investing in expensive tools. This book will introduce Python developers, both new and experienced, to a variety of new code libraries that have been developed to perform geospatial analysis, statistical analysis, and data management. This book will use examples and code snippets that will help explain how Python 3 differs from Python 2, and how these new code libraries can be used to solve age-old problems in geospatial analysis. You will begin by understanding what geoprocessing is and explore the tools and libraries that Python 3 offers. You will then learn to use Python code libraries to read and write geospatial data. You will then learn to perform geospatial queries within databases and learn PyQGIS to automate analysis within the QGIS mapping suite. Moving forward, you will explore the newly released ArcGIS API for Python and ArcGIS Online to perform geospatial analysis and create ArcGIS Online web maps. Further, you will deep dive into Python Geospatial web frameworks and learn to create a geospatial REST API.
Table of Contents (23 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
7
Geoprocessing with Geodatabases
Index

Summary


In this chapter, we learned how to use the Flask MVC web framework and some of the available component modules that add extra functionality. These modules include the SQLAlchemy ORM, the GeoAlchemy2 ORM for geospatial queries, WTForms for processing of web data, and the Jinja2 templating system for creating web page templates. We created database tables, added data tables and tables relationships, and created a web application that utilized geospatial and relationship queries to generate dynamic web pages.

A fun challenge, building on the code reviewed here, would be to explore adding editing capabilities to the Arena application, allowing the user to move the arenas into their correct location if the data is out of date. Explore the GeoAlchemy2 ORM documentation for more advanced capabilities.

In the next chapter, we will review a similar MVC web framework, Django, and its GeoDjango spatial component. With more batteries included philosophy, Django solves the same problems inherent...