SpatialPoints in R: Large Data Case Study

A common task in spatial data analysis is  extracting SpatialPoints inside a set of polygons or buffer zones.  Analysts can use standard GIS or map tools to extract a set of points within an area of interest using manual “point-and-click” routines. This method is easy, but will probably prove impractical, especially in cases involving big data.  The alternative is to train a machine to automatically extract the points in a polygon or buffer zone.  This post achieves that task and presents a case-study with R code.

Case Study – Intro

Satellite sensors provide long-term solar radiation and weather data at fixed points across the Earth’s surface.  In order to use the satellite data, it is necessary to identify and extract a specific set of SpatialPoints.  The task can be especially challenging when:

  • There are over 250 million spatial points to choose from, and
  • Irregular buffer zones or polygons define which points are relevant.

Fortunately, spatial analysis methods in R can simplify the task.  Consider the following case study:

  • A solar project developer has found 6 sites in Qatar that are suitable for future use.
  • Buffer zones are defined around each site with a 5km and 10km radius.
  • In some cases the buffer zones are stand-alone circles.  In other cases the buffer zones overlap, creating irregular shaped areas of interest
  • The developer must identify SpatialPoints within the buffer zones that represent satellite data collection points.
  • Each point contains 20 year time series data on solar radiation and other weather variables essential for estimating solar power production
  • The developer must identify all points that fall within the buffer zones.  Next, he must extract those points and their meta-data IDs to download the satellite data.

Case Study – Data Definitions and Loading

The first step is to define and download all relevant map data.  Map components will include:

  • The spatial points for the 6 potential project sites, which are defined manually;
  • The lines and polygons that form the base map for the the State of Qatar1
  • The spatial points where satellite data collection takes place2

The following R code defines the coordinates for the 6 project sites, loads the base map data and creates 5km and 10km boundaries around the project sites:

Case Study – Base Map Creation

The loaded data can next be applied to create a base map of Qatar with the 6 project sites, the satellite pixel points and the buffer zones around each project:

Base map of Qatar with SpatialPoints and buffer zones


Case Study – Extracting SpatialPoints

And finally, the satellite pixel points within the project buffer zones can be easily extracted as follow:

The method for extracting is simple and straightforward.  Index extraction is used on the satellite SpatialPoints with the [] operator, and within brackets is the name of spatial object for the 5km or 10km buffer zones.  Nothing else is required!

Show 2 footnotes

  1. Polygons that define the Qatar shoreline can be downloaded form NOAA at  http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html; polygons that define country boundaries can be downloaded from the CIA World Database II at https://www.evl.uic.edu/pape/data/WDB/; and polygons defining the administrative boundaries within the State of Qatar can be downloaded from http://www.gadm.org
  2. Data that defines the satellite sensor points for the Meteosat-1o satellite can be downloaded from https://landsaf.meteo.pt/auxiliarDataFiles.jsp
This entry was posted in Data, GDAL, GIS, Qatar RE, Solar, Spatial Analysis. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

eleven − 9 =