In this case “GCS_unknown” is used as a placeholder or default name for the Geographic Coordinate Reference System.
Even though the name is shown as “GCS_unknown,” the key information is in the details of the coordinate system, which is WGS 84
The WKT (Well-Known Text) representation indicates the use of WGS 84 with the associated parameters such as the datum, ellipsoid, and axis orientation.
Geographic coordinate reference systems represent points on an globe, using units of degrees longitude and latitude.
A geographic coordinate system provides a frame of reference for your data to locate features on the surface of the earth, to align your data relative to other data
They correspond to angles measured from the center of the Earth as calculated using the given ellipsoid.
A projection is necessary to create any two-dimensional map, but it results in the distortion of aspects of the Earth’s surface such as area, direction, distance, and shape.
A projected reference systems is useful for geographic analysis, because it uses linear units of measurement such as meters instead of degrees.
Projected Coordinate Systems
A projected coordinate system is a reference system for identifying locations and measuring features on a flat (map) surface
Going from a GCS to a PCS requires mathematical transformations.
To perform spatial analyses correctly, all the data has to have the same coordinate system
Types of Projected Coordinate Systems
Types of Projected Coordinate Systems
Types of Projected Coordinate Systems
Types of Projected Coordinate Systems
Types of Projected Coordinate Systems
Types of Projected Coordinate Systems
Spatial Data Classes in R
Spatial entries in GIS can be represented as a vector or as a raster
You see below how river can be represented as a vector (left) and as a raster (right)
Vector Layers
Vector layers are sets of geometries associated with non-spatial attributes
The geometries are sequences of one or more coordinates, connected to form lines or polygons
The non-spatial attributes come as a table
Vector layers can be:
points
lines
polygons
Vector Layers
Points
Points are just dots that have a coordinate pair:
(i.e. latitude - X and longitudes - Y)
Points
Here are for example all the restaurants in central Rome
Polylines
Polylines are a sequence of two or more coordinate pairs - vertices.
Roads and rivers are typically stored as polylines in GIS
Polylines
Here are for example all the roads in central Rome
Polygons
Polygons are three or more line segments whose starting and ending coordinate pairs are the same.
Countries are usually depicted as polygons
Polygons
Here are for example all the buildings in central Rome
Polygons
Here are for example all countries in the world
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Shapefiles for World
You can download shapefiles for different countries by going to https://gadm.org
Creating a Map of the US
This is what we want our final map to look like:
Loading the Shapefile for the US
library(sf)#"s2" is an enhancement of the "sf" package#It allows spatial operations with data in a#geographic coordinate system (degrees)#However, having it enabled will take#much longer computation timesf_use_s2(FALSE)library(ggplot2)#Step1: Read country shapeusa_cntry <-st_read(dsn="./data/gadm41_USA_shp/gadm41_USA_0.shp",quiet =TRUE)#Step2: Simplify linesusa_cntry<-st_simplify(usa_cntry,dTolerance =0.05)#Step3: Mapggplot()+geom_sf(data=usa_cntry)
st_simplify Use
st_simplify allows our computer to map a vector quicker
To see how this affects our output, let’s change it to a different value. The one below is 0.05
#Step1: Read country shapeusa_cntry <-st_read(dsn="./data/gadm41_USA_shp/gadm41_USA_0.shp",quiet =TRUE)#Step2: Simplify linesusa_cntry<-st_simplify(usa_cntry,dTolerance =0.05)#Step3: Mapggplot()+geom_sf(data=usa_cntry)
st_simplify Use
st_simplify allows our computer to map a vector quicker
To see how this affects our output, let’s change it to a different value. The one below is 5
#Step1: Read country shapeusa_cntry <-st_read(dsn="./data/gadm41_USA_shp/gadm41_USA_0.shp",quiet =TRUE)#Step2: Simplify linesusa_cntry<-st_simplify(usa_cntry,dTolerance =5)#Step3: Mapggplot()+geom_sf(data=usa_cntry)
Loading the Shapefile for the US
The next step is to decide on a set of coordinates that allow us to zoom onto the US