Reader small image

You're reading from  Mastering Geospatial Analysis with Python

Product typeBook
Published inApr 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781788293334
Edition1st Edition
Languages
Right arrow
Authors (3):
Silas Toms
Silas Toms
author image
Silas Toms

Silas Toms is a long-time geospatial professional and author who has previously published ArcPy and ArcGIS and Mastering Geospatial Analysis with Python. His career highlights include developing the real-time common operational picture used at Super Bowl 50, building geospatial software for autonomous cars, designing computer vision for next-gen insurance, and developing mapping systems for Zillow. He now works at Volta Charging, predicting the future of electric vehicle adoption and electric charging infrastructure.
Read more about Silas Toms

Paul Crickard
Paul Crickard
author image
Paul Crickard

Paul Crickard authored a book on the Leaflet JavaScript module. He has been programming for over 15 years and has focused on GIS and geospatial programming for 7 years. He spent 3 years working as a planner at an architecture firm, where he combined GIS with Building Information Modeling (BIM) and CAD. Currently, he is the CIO at the 2nd Judicial District Attorney's Office in New Mexico.
Read more about Paul Crickard

Eric van Rees
Eric van Rees
author image
Eric van Rees

Eric van Rees was first introduced to Geographical Information Systems (GIS) when studying Human Geography in the Netherlands. For 9 years, he was the editor-in-chief of GeoInformatics, an international GIS, surveying, and mapping publication and a contributing editor of GIS Magazine. During that tenure, he visited many geospatial user conferences, trade fairs, and industry meetings. He focuses on producing technical content, such as software tutorials, tech blogs, and innovative new use cases in the mapping industry.
Read more about Eric van Rees

View More author details
Right arrow

Chapter 7. Geoprocessing with Geodatabases

In Chapter 3, Introduction to Geospatial Databases, you learned how to install PostGIS, create a table, add data, and perform basic spatial queries. In this chapter, you will learn how to work with geospatial databases to answer questions and make maps. This chapter will have you load crime data into tables. Once you have populated your geodatabase with real-world data, you will learn how to perform common crime analysis tasks. You will learn how to map queries, query by date ranges, and perform basic geoprocessing tasks such as buffers, point in polygon, and nearest neighbor. You will learn how to add widgets to your Jupyter Notebooks to allow queries to be interactive. Lastly, you will learn how to use Python to create charts from your geospatial queries. As a crime analyst, you will make maps, but not all GIS-related tasks are map-based. Analysts use GIS data to answer questions and create reports. Executives are often more familiar with charts...

A crime dashboard


To build an interactive crime dashboard, you will need to collect data to build a database. Then, you will query the data and add widgets to allow users to modify the queries without needing to code. Lastly, you will graph and map the query results.

Building a crime database

To build the components for a crime dashboard, we will use the City of Albuquerque's open data. Albuquerque has datasets for crime incidents, as well as area commands and beats. By combining the areas with incidents, you will be able to report on two geographic areas. You could then extend the analysis using neighborhood associations or any other boundary—Census blocks, groups, or tracts, and get demographic information as well. 

Note

You can find links to the data on the main open data site located at: http://www.cabq.gov/abq-data/. Scroll to the bottom of the page and look for the Safety Data Sets heading. 

Creating the tables

We will need to create three tables to hold the crime data. We need a table for...

Summary


In this chapter, you learned how to use spatial queries to perform geoprocessing tasks. You also learned how to map and chart the results of your queries using ipyleaflet and data frames. You learned how to modify the maps and queries using interactive widgets in Jupyter. Lastly, you learned about how triggers work, and were shown a quick example of data checking using trigger. 

In the next chapter, you will learn how to perform geoprocessing tasks using QGIS. You will learn how to use toolboxes that are already included in QGIS. You will learn how to write your own toolboxes that you can use and share with other QGIS users, and you will learn how to use QGIS to map the results. The results can be saved as a QGIS project, or as one of many spatial data formats from QGIS.

 

 

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Geospatial Analysis with Python
Published in: Apr 2018Publisher: PacktISBN-13: 9781788293334
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.
undefined
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 $15.99/month. Cancel anytime

Authors (3)

author image
Silas Toms

Silas Toms is a long-time geospatial professional and author who has previously published ArcPy and ArcGIS and Mastering Geospatial Analysis with Python. His career highlights include developing the real-time common operational picture used at Super Bowl 50, building geospatial software for autonomous cars, designing computer vision for next-gen insurance, and developing mapping systems for Zillow. He now works at Volta Charging, predicting the future of electric vehicle adoption and electric charging infrastructure.
Read more about Silas Toms

author image
Paul Crickard

Paul Crickard authored a book on the Leaflet JavaScript module. He has been programming for over 15 years and has focused on GIS and geospatial programming for 7 years. He spent 3 years working as a planner at an architecture firm, where he combined GIS with Building Information Modeling (BIM) and CAD. Currently, he is the CIO at the 2nd Judicial District Attorney's Office in New Mexico.
Read more about Paul Crickard

author image
Eric van Rees

Eric van Rees was first introduced to Geographical Information Systems (GIS) when studying Human Geography in the Netherlands. For 9 years, he was the editor-in-chief of GeoInformatics, an international GIS, surveying, and mapping publication and a contributing editor of GIS Magazine. During that tenure, he visited many geospatial user conferences, trade fairs, and industry meetings. He focuses on producing technical content, such as software tutorials, tech blogs, and innovative new use cases in the mapping industry.
Read more about Eric van Rees