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
Section 1: Getting Started with Geospatial Analytics
Section 2: SQL for Spatial Analytics

Preparing data

So far, you have learned how to download data directly from Open Street Map and begin asking data questions. When you prefer to work with a smaller dataset, instead of downloading larger files directly to your computer, you can also create datasets directly from the map canvas and write SQL queries entirely in QGIS.

QGIS has a training dataset but it is not too complicated to substitute the default set with something of more interest. We can select a region of interest from the canvas and explore different layers by using a QGIS plugin known as QuickOSM.

There is also a plugin for uploading data into the QGIS canvas for exploring our region of interest.

Creating a dataset using the Open Street Map plugin

Here is how to install the QuickOSM plugin:

  1. To install the QuickOSM plugin, navigate to the menu at the top of the canvas and search for QuickOSM in the pane, as shown in Figure 5.1. As you can see, I already have the plugin installed; you will notice...