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

Creating a spatial database

In Chapter 1, Introducing the Fundamentals of Geospatial Analytics, maybe you created a database. If you were simply following along, you will need to create a database for working through the examples in the book. As a refresher, let’s create another to hold the data for this chapter. You will use this database to explore the components of working with PostGIS and spatial data.

This is how you do it:

  1. Simply right-click the database name you created and scroll to Query Tool. Figure 2.1 shows the other options available. You will explore these in later chapters, but for now, Delete/Drop is how you delete a database, Refresh will update the database (important when we add files in QGIS), and View/Edit Data will render a table in your console. If you simply want to see the column headings, a quick look at Properties is helpful:
Figure 2.1 – Database options in pgAdmin

Figure 2.1 – Database options in pgAdmin

  1. Navigate to your Browser...