Time: 30 minutes
Purpose: In this lesson we will introduce some of the key concepts associated with spatial data including:
We will also define raster vs. vector data structures.
Background: Often we need to use spatial data in our analysis - that is data that correspond to some x,y (and z) location on the Earth. however, not all spatial data are created the same. understanding the basic foundations of working with spatial data will save you a lot of time when it comes to processing the data in tools like R, QGIS and python!
At the end of this 30 minute overview you will be able to:
R
packages that can be used to work with spatial data.It may be a bit of extra effort at the beginning to learn a tool like R. However, the payoff is large once you learn the basic skills to support task automation.
Specific to spatial data, R allows you to:
In this lesson we are going to learn the basics of working with spatial data in R. Some of you may think this is the boring stuff - however understanding these concepts will allow you to do just about anything that you want with spatial data in R!
Intro to vector data - EarthDataScience.org
Attributes of vector data
There are many different spatial vector data formats. Let’s list a few:
The spatial extent of a vector dataset is determined by the min and max x,y location of ALL OF THE SPATIAL OBJECTS stored in the dataset.
NOTE: the spatial extent of an individual object can also be quantified!
Vector data often has associated attribute tables. When in a shapefile format, these look like excel spreadsheets where each object has an associated set of attributes.
in a geojson structure this may look like this:
[ {
"station_name" : "SOUTH PLATTE RIVER AT COOPER BRIDGE NEAR BALZAC",
"amount" : "262.00",
"flag" : "na",
"station_status" : "Gage temporarily anavailable",
"county" : "MORGAN",
"wd" : "1",
"dwr_abbrev" : "PLABALCO",
"data_source" : "Co. Division of Water Resources",
"http_linkage" : {
"url" : "http://www.dwr.state.co.us/SurfaceWater/data/detail_graph.aspx?ID=PLABALCO&MTYPE=DISCHRG"
},
"div" : "1",
"date_time" : "2017-02-15T09:00:00",
"stage" : "1.86",
"usgs_station_id" : "06759910",
"variable" : "DISCHRG",
"location" : {
"latitude" : "40.357498",
"needs_recoding" : false,
"longitude" : "-103.528053"
},
"station_type" : "Stream"
}
...
]
The Components of a CRS
The coordinate reference system is made up of several key components:
About raster data:
Open raster data in R - earthdatascience.org website
The spatial extent of a raster refers to the area on the earth’s surface that the raster covers.
Note that the raster spatial extent relates directly to the spatial resolution.