Book Image

Geospatial Analysis with SQL

By : Bonny P McClain
Book Image

Geospatial Analysis with SQL

By: Bonny P McClain

Overview of this book

Geospatial analysis is industry agnostic and a powerful tool for answering location questions. Combined with the power of SQL, developers and analysts worldwide rely on database integration to solve real-world spatial problems. This book introduces skills to help you detect and quantify patterns in datasets through data exploration, visualization, data engineering, and the application of analysis and spatial techniques. You will begin by exploring the fundamentals of geospatial analysis where you’ll learn about the importance of geospatial analysis and how location information enhances data exploration. Walter Tobler’s second law of geography states, “the phenomenon external to a geographic area of interest affects what goes on inside.” This quote will be the framework of the geospatial questions we will explore. You’ll then observe the framework of geospatial analysis using SQL while learning to create spatial databases and SQL queries and functions. By the end of this book, you will have an expanded toolbox of analytic skills such as PostGIS and QGIS to explore data questions and analysis of spatial information.
Table of Contents (13 chapters)
Free Chapter
1
Section 1: Getting Started with Geospatial Analytics
6
Section 2: SQL for Spatial Analytics

Exploring census data in the SQL Query Builder

For the remaining chapter, let’s explore the population dynamics in Los Angeles County—specifically, declines or increases in the Hispanic population. The folder download included a JSON file. We need to identify populations of interest from the dense JSON file you see in Figure 6.19:

Figure 6.19 – Demographic metadata JSON file Hispanic/non-Hispanic aged over 18

Figure 6.19 – Demographic metadata JSON file Hispanic/non-Hispanic aged over 18

The area highlighted in Figure 6.19 is the percent change in population from the 2010 census to the 2020 census. In addition, I captured the total population and total population: Hispanic Latino for 2020, "P0040001_2020": "P4-1: Total (2020)", "P0040002_2020": "P4-2: Hispanic or Latino (2020)".

Renaming the columns in census tables is quite a task. The codes identify data products available from the census. For example, B in the column heading in Figure 6.20 is used for detailed estimates...