0% found this document useful (0 votes)
11 views29 pages

Chapter 13

The document discusses the use of the PROJ library and various R packages for computing and transforming coordinate reference systems (CRS) in geodetic surveying. It details the installation and enabling of R packages, methods for checking and assigning CRS, and calculations of Euclidean and geodesic distances between vertices. Additionally, it covers the calculation of geodesic areas for polygons using imported vector data and the differences between Euclidean and geodetic area calculations.

Uploaded by

luciana.sanches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views29 pages

Chapter 13

The document discusses the use of the PROJ library and various R packages for computing and transforming coordinate reference systems (CRS) in geodetic surveying. It details the installation and enabling of R packages, methods for checking and assigning CRS, and calculations of Euclidean and geodesic distances between vertices. Additionally, it covers the calculation of geodesic areas for polygons using imported vector data and the differences between Euclidean and geodetic area calculations.

Uploaded by

luciana.sanches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

12.

15 Computation 277

support for a wide variety of CRS and use of the PROJ library. EPSG codes can be obtained from the Internet or
by functions available in R packages, such as in rgdal (Lovelace et al., 2019a).
The syntax of PROJ4 consisted of a list of parameters, each prefixed with the + character. For example, one might
cite a UTM projection (+ proj = utm) for zone 23 (+ zone = 23) and on a WGS-84 datum (+ datum = WGS84).
Other bits of information that could be gleaned from the projection sequence were the units (meters) and the
underlying ellipsoid (WGS-84). Some of the PROJ parameters used in defining a coordinate system were described
below (Table 12.4) (Lovelace et al., 2019a):

TABLE 12.4: Parameters and description of PROJ4 to define coordinate system.

Parameter Description
+a Radius of the semi-major axis of the ellipsoid
+b Radius of the semi-minor axis of the ellipsoid
+datum Datum Name
+ellps Elipsoid Name
+lat_0 Latitude of origin
+lat_1 Latitude of first standard parallel
+lat_2 Latitude of second standard parallel
+lat_ts True Scale Latitude
+lon_0 Central Meridian
+over Longitude beyond -180 to 180, turning off distortion
+proj Projection Name
+south UTM Zone in Southern Hemisphere
+units meters, etc.
+x_0 False East
+y_0 False North
+zone UTM Zone

As computing practice, the objective was to observe some datum definitions available in the sf package, observe
EPSG codes interactively in R, check and assign a coordinate system to vertice data of vector attribute type,
determine the Euclidean distance and compare with the geodetic distance between vertices, calculate the geodetic
area of a polygon and of Brazil in SIRGAS-2000, SAD-69, Chua and Córrego Alegre 1961 ellipsoids. Finally, an
SRTM digital elevation model was used as an example of transforming a raster in WGS-84 geographic projection
to SIRGAS-2000.
The package rgdal was used to perform coordinate projection operations through the library PROJ (Bivand et al.,
2021), in order to transform coordinate vertices into cadastral vector attribute features. Polygon area calculation
was performed using the sf package (Pebesma et al., 2021). The calculation of Euclidean distance, geodetic distance
and geodetic area were performed with the lwgeom package (Pebesma et al., 2020b). The algorithms for geodesic
calculations were described in Karney (2013). Spherical area and distance calculations considering the Earth as
a sphere were also performed with the s2 package (Dunnington et al., 2021). Polygons were mapped by the R
package tmap (Tennekes, 2018; Tennekes et al., 2020). The spData package was used as a source of polygon data
with Brazilian borders (Bivand et al., 2020c). The units package was used in area unit transformation (Pebesma
et al., 2020a). The raster package was used to obtain an SRTM digital elevation model (NASA, 2013) of an area
and to transform the geodetic coordinates of the raster from WGS-84 to SIRGAS-2000 (Hijmans et al., 2020).

12.15.1 Installing R packages

The install.packages function was used to install the sf, s2, rgdal, units, lwgeom, spData, tmap, and raster
packages in the R console.

##
## install.packages("sf")
## install.packages("s2")
278 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

## install.packages("rgdal")
## install.packages("units")
## install.packages("lwgeom")
## install.packages("spData")
## install.packages("tmap")
## install.packages("raster")
##

12.15.2 Enabling R packages

The library function was used to enable the sf, s2, rgdal, units, lwgeom, spData, tmap, raster packages in the R
console.

library(sf)
library(s2)
library(rgdal)
library(units)
library(lwgeom)
library(spData)
library(tmap)
library(raster)

12.15.3 Observe available datum definitions in sf

The function sf_proj_info was used to enable the package sf.

sf_proj_info(type = "ellps")

12.15.4 View EPSG codes interactively

The EPSG codes available in the rgdal package were obtained using the make_EPSG function. Then the results were
visualized using the View function. Another way to obtain the EPSG code for a given geographic or plane coordinate
system can be through searches on internet web sites such as google.

crs_data = rgdal::make_EPSG()
View(crs_data)

12.15.5 Checking and assigning a coordinate system to point vector attribute data

Vector attribute point data used in surveying with the calculation of coordinates by the intersection method (Chapter
10) were used to check and assign a coordinate system to vertices, were imported from the Internet.

##
## download.file(url=
## "http://www.sergeo.deg.ufla.br/geomatica/downloads/pontosGeo.zip",
## destfile = "pontosGeo.zip")
##
12.15 Computation 279

The files have been unzipped by the unzip function.

## unzip(zipfile = "p.zip")
##

The directory into which data was imported was obtained with the getwd function.

## getwd()

The topographic survey data were imported with the st_read function and then we observed information about the
file, such as the name of the data columns associated with the vector file.

# Import simple feature point data


pointsGeo <- st_read("files/pontosGeo.shp")

## Reading layer `pontosGeo' from data source `G:\bookdown\surveying-with-geomatics-and-


r\files\pontosGeo.shp' using driver `ESRI Shapefile'
## Simple feature collection with 3 features and 1 field
## geometry type: POINT
## dimension: XY
## bbox: xmin: 499054.4 ymin: 7641910 xmax: 503211 ymax: 7654217
## projected CRS: WGS 84 / UTM zone 23S

pointsGeo

## Simple feature collection with 3 features and 1 field


## geometry type: POINT
## dimension: XY
## bbox: xmin: 499054.4 ymin: 7641910 xmax: 503211 ymax: 7654217
## projected CRS: WGS 84 / UTM zone 23S
## vertices geometry
## 1 A POINT (503142.1 7654217)
## 2 B POINT (503211 7654195)
## 3 P POINT (499054.4 7641910)

# Look up data column names


names(pointsGeo)

## [1] "vertices" "geometry"

The reference coordinate system (CRS) in the imported file was evaluated about the projection type and parameters,
as well as EPSG, by the st_crs function . This verified the EPSG: 32723 of the data, referring to World Geodetic
System datum, 1984 (WGS-84) and UTM zone 23 South (23S).
280 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

# Check the reference coordinate system on vector data


st_crs(pointsGeo) # get CRS

## Coordinate Reference System:


## User input: WGS 84 / UTM zone 23S
## wkt:
## PROJCRS["WGS 84 / UTM zone 23S",
## BASEGEOGCRS["WGS 84",
## DATUM["World Geodetic System 1984",
## ELLIPSOID["WGS 84",6378137,298.257223563,
## LENGTHUNIT["metre",1]]],
## PRIMEM["Greenwich",0,
## ANGLEUNIT["degree",0.0174532925199433]],
## ID["EPSG",4326]],
## CONVERSION["UTM zone 23S",
## METHOD["Transverse Mercator",
## ID["EPSG",9807]],
## PARAMETER["Latitude of natural origin",0,
## ANGLEUNIT["Degree",0.0174532925199433],
## ID["EPSG",8801]],
## PARAMETER["Longitude of natural origin",-45,
## ANGLEUNIT["Degree",0.0174532925199433],
## ID["EPSG",8802]],
## PARAMETER["Scale factor at natural origin",0.9996,
## SCALEUNIT["unity",1],
## ID["EPSG",8805]],
## PARAMETER["False easting",500000,
## LENGTHUNIT["metre",1],
## ID["EPSG",8806]],
## PARAMETER["False northing",10000000,
## LENGTHUNIT["metre",1],
## ID["EPSG",8807]]],
## CS[Cartesian,2],
## AXIS["(E)",east,
## ORDER[1],
## LENGTHUNIT["metre",1]],
## AXIS["(N)",north,
## ORDER[2],
## LENGTHUNIT["metre",1]],
## ID["EPSG",32723]]

If crs is not configured in the file of interest, we can configure crs with the st_set_crs.

## # Assign CRS
## pointsGeo <- st_set_crs(pointsGeo, 32723) # atribuir CRS
##

Another way to assign the CRS can be to describe the coordinate system in the +proj parameter.

## # Other ways of assigning CRS


## pointsGeo <- st_set_crs(pointsGeo, "+proj=utm +zone=23 +south +
## datum=WGS84 +units=m +no_defs")
##
12.15 Computation 281

Or configure the coordinate system with the proj4string function, according to the EPSG code for the coordinate
system for spatial data of sp class.

## proj4string(pointsGeo) <- CRS("+init=epsg:32723")# For sp data

12.15.6 Determine Euclidean and geodesic distance between vertices

First of all, the data were organized in rows and columns to calculate the longitude and latitude between vertices
in order to determine the Euclidean and geodesic distance between vertices 𝐴 and 𝑃 , defined by intersection survey
from UTM coordinates. Then the Pythagoras theorem was used to determine the horizontal distance between
vertices AP of 12967.96𝑚.

# Organize data in rows and columns


vertices <- c('A', 'B', 'P')
X <- c(503142.10, 503211.00, 499054.3815)
Y <- c(7654216.99, 7654195.00, 7641910.1401)

int<-data.frame(vertices, X, Y)

dx <- int$X[3] - int$X[1]


dy <- int$Y[3] - int$Y[1]

# Determine the distance between vertices A and P


HAP <- sqrt((dx^2)+(dy^2))
HAP

## [1] 12967.96

The distance calculation performed between vertices was checked with the st_distance function from the lwgeom
package, obtaining the same value of 12967.96𝑚.

# Determine Euclidean distance with the lwgeom package


st_distance(pointsGeo$geometry[1], pointsGeo$geometry[3])

## Units: [m]
## [,1]
## [1,] 12967.96

The intersection surveying data in plane coordinate system were transformed to geographic coordinate system, in
WGS-84 datum, through the st_transform function.

pointsWGS84 <- st_transform(pointsGeo,


crs= CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))

The geodesic distance between vertices 𝐴𝑃 was calculated, considering the terrestrial curvature characterized by
the WGS-84 ellipsoid, in Lavras, Minas Gerais, Brazil. The st_geod_distance function was used to calculate the
distance, obtaining the value of 12973.15𝑚. We observed that the geodetic distance was greater than the Euclidean
distance by 5.19𝑚.
282 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

# Calculate the geodesic distance between vertices A and P


st_geod_distance(pointsWGS84$geometry[1],
pointsWGS84$geometry[3], tolerance = 0, sparse = FALSE)

## Units: [m]
## [,1]
## [1,] 12973.15

s2_distance(pointsWGS84$geometry[1], pointsWGS84$geometry[3],
radius=s2_earth_radius_meters())

## [1] 13021.24

The vertices, in geographic and plane coordinate system, were mapped comparatively by means of the qtm and
tmap_arrange functions of the R package tmap (Figure 12.11).

# Map the points in geographic and plane coordinates


w1 <- qtm(pointsGeo, symbols.size = 0.1, symbols.col = "red",
title ="Plane Projection")+ tm_grid(col = "gray70") +
tm_xlab("Longitude") + tm_ylab("Latitude")
w2 <- qtm(pointsWGS84,symbols.size = 0.1, symbols.col = "red",
title ="Geographic Projection")+tm_grid(col = "gray70") +
tm_xlab("Longitude") + tm_ylab("Latitude")

current.mode <- tmap_mode("plot")


tmap_arrange(w1, w2, widths = c(1, 1))

12.15.7 Calculate geodesic area of polygon

The vector data of irradiation vertices used in a topographical survey with the calculation of coordinates by the
walking method of a closed-path polygon of a building at the Federal University of Mato Grosso, were imported
from the internet.

##
## # download training areas
## download.file(url=
## "http://www.sergeo.deg.ufla.br/geomatica/downloads/spdfIrr.zip",
## destfile = "spdfIrr.zip")
##

The files have been unzipped by the unzip function.

##
## unzip(zipfile = "spdfIrr.zip")
##

The directory into which the data was imported by the getwd function.
12.15 Computation 283

FIGURE 12.11: Comparative mapping of attribute points defined by the intersection method in the plane and
geographic projections.

## getwd()

The file was imported into R with the st_read function from the sf package and named “areaPol”.

areaPol <- st_read("files/spdfIrr.shp")

## Reading layer `spdfIrr' from data source `G:\bookdown\surveying-with-geomatics-and-


r\files\spdfIrr.shp' using driver `ESRI Shapefile'
## Simple feature collection with 1 feature and 1 field
## geometry type: POLYGON
## dimension: XY
## bbox: xmin: 600093.6 ymin: 8273776 xmax: 600112.2 ymax: 8273801
## projected CRS: WGS 84 / UTM zone 21S

The polygon area calculation based on Euclidean distances that defined the surveyed perimeter was determined
using the st_area function. The polygon area was 235.323𝑚2 .

st_area(areaPol)

## 235.323 [m^2]

The polygon, initially in plane UTM 21S projection, was transformed to WGS-84 geographic projection to calculate
the polygon geodetic area.
284 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

areaGeo <- st_transform(areaPol, 4326) #Reproject to WGS-84

The polygon geodetic area was calculated using the function st_geod_area. There was a difference between the
calculated geodetic area and the area based on Euclidean distance, of the order of 0.1300𝑚2 .

st_geod_area(areaGeo) # Calculate geodetic area

## 235.453 [m^2]

The spherical area of the polygon of the building calculated by the s2_area function presented a difference between
the geodetic area and the area based on Euclidean distance being 0.9581𝑚2 .

s2_area(areaGeo)

## [1] 236.2811

12.15.8 Calculate the geodesic area of Brazil

The polygon of Brazil was obtained from the World map, from the R package spData to calculate the geodetic area
of Brazil comparatively, in the ellipsoids SIRGAS-2000, SAD-69, Chua and Córrego Alegre 1961. The world map
with the country boundaries in each continent was mapped with the plot function (Figure 12.12).

plot(world["continent"], key.pos=1)

FIGURE 12.12: Mapping continents from cadastral map of countries in the World.

A subset of South America was conducted, to assess Brazil and the context of its neighborhood.
12.15 Computation 285

world_america <- world[world$continent == "South America",]

Maps were made of all data columns available in the archive and of the South American countries in isolation, with
the plot function (Figure 12.13).

plot(world_america, max.plot = 10) # Mapping attributes


plot(world_america["name_long"], key.pos=1, axes=T) # Mapping countries

Then a subset was made for Brazil with the [] operator.

BrazilWGS84 <- world[world$name_long == "Brazil",]

The Brazil polygon has been exported with the st_write function for later use.

##
## st_write(BrazilWGS84, dsn=
## "E:/Aulas/Topografia/Aula11/BrazilWGS84.shp",
## layer = "BrazilWGS84.shp", driver = "ESRI Shapefile")
##

The subset of Brazil was mapped against all available data in the archive and also of Brazil with other South
American countries, using the plot function (Figure 12.14).

plot(BrazilWGS84, max.plot = 10) # Mapping Brazil's attributes


plot(st_geometry(BrazilWGS84), expandBB = c(0.2, 0.2, 0.1, 1),
col = "gray", lwd = 3, axes=T) # Mapping Brazil's geometry
plot(world_america[0], add = TRUE) # Mapping all countries

The Brazil polygon was transformed into different Brazilian geographic projection reference systems in order to
perform geodetic area determination comparisons. The st_transform function was used for the different coordinate
EPSG codes.

BrazilSIRGAS<-st_transform(BrazilWGS84, 4674) # WGS-84 in SIRGAS-2000


BrazilSAD69<-st_transform(BrazilWGS84, 4618) # WGS-84 in SAD-69
BrazilChua<-st_transform(BrazilWGS84, 4224) # WGS-84 in Chua
BrazilCA<-st_transform(BrazilWGS84, 5524) # WGS-84 in Corrego Alegre-1961

The geodetic area of Brazil was calculated in 𝑚2 and 𝑘𝑚2 using the set_units function from the units package.
The geodetic areas of Brazil in the SIRGAS-2000, SAD-69, Chuá and Córrego Alegre-1961 geographic projections
were 8508557𝑘𝑚2 , 8508525𝑘𝑚2 , 8509011𝑘𝑚2 , 8509009𝑘𝑚2 , respectively. The largest area of Brazil was obtained in
the Chuá projection, followed by Córrego Alegre-1961, SIRGAS-2000 and SAD-69.

# Calculate geodetic area for SIRGAS-2000


st_geod_area(BrazilSIRGAS)

## 8.508557e+12 [m^2]
286 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

FIGURE 12.13: Attribute mapping of South American countries.


12.15 Computation 287

FIGURE 12.14: Mapping Brazil in relation to its South American neighbors.

st_geod_area(BrazilSIRGAS)/1000000

## 8508557 [m^2]

units::set_units(st_area(BrazilSIRGAS), km^2)

## 8508557 [km^2]
288 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

# Calculate geodetic area for SAD-69


st_geod_area(BrazilSAD69)

## 8.508525e+12 [m^2]

st_geod_area(BrazilSAD69)/1000000

## 8508525 [m^2]

units::set_units(st_area(BrazilSAD69), km^2)

## 8508525 [km^2]

# Calculate geodetic area for Chuá


st_geod_area(BrazilChua)

## 8.509011e+12 [m^2]

st_geod_area(BrazilChua)/1000000

## 8509011 [m^2]

units::set_units(st_area(BrazilChua), km^2)

## 8509011 [km^2]

# Calculate geodetic area for Córrego Alegre-1961


st_geod_area(BrazilCA)

## 8.509009e+12 [m^2]

st_geod_area(BrazilCA)/1000000

## 8509009 [m^2]
12.15 Computation 289

units::set_units(st_area(BrazilCA), km^2)

## 8509009 [km^2]

The subset of Brazil, on the different transformed ellipsoids, was mapped by the qtm and tmap_arrange functions
from the R package tmap (Figure 12.15).

p1 <- qtm(BrazilSIRGAS, title="SIRGAS")+ tm_grid(col = "gray70") +


tm_xlab("Longitude") + tm_ylab("Latitude") # SIRGAS-2000
p2 <- qtm(BrazilSAD69, title="SAD69") + tm_grid(col = "gray70") +
tm_xlab("Longitude")+ tm_ylab("Latitude") # SAD-69
p3 <- qtm(BrazilChua, title="Chuá")+ tm_grid(col = "gray70") +
tm_xlab("Longitude")+ tm_ylab("Latitude") # Chua
p4 <- qtm(BrazilCA, title="Corr.Aleg.")+ tm_grid(col = "gray70") +
tm_xlab("Longitude")+ tm_ylab("Latitude") # Corrego Alegre-1961

current.mode <- tmap_mode("plot")

## tmap mode set to plotting

tmap_arrange(p1, p2, p3, p4, widths = c(1, 1))


290 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

5 5
SIRGAS SAD69
0 0

-5 -5

-10 -10
Latitude

Latitude
-15 -15

-20 -20

-25 -25

-30 -30

-70 -65 -60 -55 -50 -45 -40 -35 -70 -65 -60 -55 -50 -45 -40 -35
Longitude Longitude

5 5
Chuá Corr.Aleg.
0 0

-5 -5

-10 -10
Latitude

Latitude

-15 -15

-20 -20

-25 -25

-30 -30

-70 -65 -60 -55 -50 -45 -40 -35 -70 -65 -60 -55 -50 -45 -40 -35
Longitude Longitude

12.15.9 Transform the geographic projection of raster data

In the raster data projection transformation, data were obtained from a SRTM topographic radar mission used to
determine the altitude of Lavras, state of Minas Gerais, Brazil. The getData function was used to obtain the vectors
of Brazilian municipalities, to subsequently make a subset in the region of interest.

brazilRegions3 <- getData('GADM', country='BRA', level=3)

The Brazilian districts were mapped in order to visualize the spatial distribution of vectors in the region of interest
(Figure 12.16).
12.15 Computation 291

FIGURE 12.15: Mapping Brazil in the SIRGAS-2000, SAD-69, Chuá and Córrego Alegre coordinate systems.

plot(brazilRegions3, axes=T, asp=1)

FIGURE 12.16: Mapping political boundaries of Brazilian municipalities obtained with the getData function.

A subset of the vectors at the boundary boundaries defining the city of Lavras was performed in order to generate
a subset of the raster data in that region.
292 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

lavras<-subset(brazilRegions3, NAME_2=="Lavras")

Then, Lavras city was mapped with the plot function (Figure 12.17).

plot(lavras, axes=T, col="grey92")

FIGURE 12.17: Mapping of the district of Lavras, Minas Gerais, Brazil, obtained from a subset of Brazilian
municipalities.

The vectors for the district of Lavras were converted into sf class files to export the file defined as the region of
interest in Brazil using st_as_sf function.

##
## lavras_sf<-st_as_sf(lavras)

The vectors for the district of Lavras were exported in ESRI Shapefile format with the st_write function.

##
## st_write(lavras_sf, dsn = "E:/Aulas/Topografia/Aula11/lavras_sf.shp",
## layer = "lavras_sf.shp", driver = "ESRI Shapefile")

The getData function was used to obtain the digital elevation model of the area. Due to the geographical area
position, it was necessary to obtain files referring to longitudes -45 and -46 and latitude -21.

##
## demLavras1 <- getData('SRTM', lon=-46, lat=-21, download=TRUE)
## demLavras2 <- getData('SRTM', lon=-45, lat=-21, download=TRUE)
##
12.15 Computation 293

Image mosaicking was performed using pixel averaging in regions with overlapping image data.

## demLavras<-mosaic(demLavras1, demLavras2, fun=mean)


## demLavras

We cropped and masked the image mosaic from the Lavras vectors with the crop and mask functions, respectively.

## demLavras_clip <- crop(demLavras, lavras) # Crop


## demLavras_mask=mask(demLavras_clip, lavras) # Mask
##
##

The digital elevation model mask was mapped within the Lavras boundaries with the plot function (Figure 12.18).

## plot(demLavras_mask, col=grey((0:48)/48))

FIGURE 12.18: SRTM altitude mapping in Lavras, Minas Gerais, Brazil.

The map projection of the digital elevation model at Lavras was evaluated with the crs function.

##
## crs(demLavras_mask)
##

After, the projectRaster function was used to perform the transformation of the geographic projection of the digital
elevation model from WGS-84 to SIRGAS-2000.
294 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

##
## demLavrasSirgas <- projectRaster(demLavras_mask, crs=
## "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs")
##
##

We can use parameters of the +proj function to set a value of crs to assign a map projection to the raster when it
does not exist.

##
##
## crs(demLavrasSirgas) <-
## "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs"
##

Finally, the digital elevation model was exported for further use by means of the writeRaster function.

##
## writeRaster(demLavras_mask,
## filename="E:/Aulas/Topografia/Aula11/demLavras_mask.tif",
## overwrite=TRUE)
##

12.16 Solved Exercises

12.16.1 Determine the first eccentricity of the GRS-80 ellipsoid.

A: To determine the first eccentricity of the GRS-80 ellipsoid, the parameters given in Table 12.1 were used. The
first eccentricity of the GRS-80 ellipsoid was 0.08181919.

# Data
f<- 1/298.257222101

# Calculate the first eccentricity

e<-sqrt((2*f)-(f^2))
e

## [1] 0.08181919

12.16.2 Considering the reference ellipsoid in the SIRGAS-2000 geodetic system, determine
the minor semi-axis to 6 decimal places and the second eccentricity.

A: The minor semi-axis was 6356752.314140𝑚. The second eccentricity was 0.08209444.
12.16 Solved Exercises 295

# Data
f<- 1/298.257222101
a<-6378137.0

# Calculate minor semi-axis

b<-(1-f)*a

# Calculate minor semi-axis with 6 decimal places


b6<-format(b, nsmall=6)
b6

## [1] "6356752.314140"

# Calculate the second eccentricity


ex<-sqrt(a^2-b^2)/b

12.16.3 Determine the radius of the meridian and prime vertical of a point of latitude
41∘ 18′ 15.0132"𝑁 , using parameters from the GRS-80 ellipsoid. What was the radius
of the great circle located at an azimuth of 142∘ 14′ 36" from the point? Present the
results to 6 decimal places.

A: The radius of the meridian was 6363257.346179𝑚; the radius of the prime vertical was 6387458.536282𝑚; the
radius of the great circle was 6372309.400720𝑚.

library(circular) # Enable circular Package

# Calculate e^2 for GRS-80


e2<-e^2

# Data
a<-6378137.0
phi<-41+18/60+15.0132/3600
alpha<-142+14/60+36/3600

# Calculate RM

RM<-(a*(1-e2))/(1-(e2*(sin(rad(phi)))^2))^(3/2)

# Present RM with 6 decimal places


RM6<- format(RM, nsmall=6)
RM6

## [1] "6363257.346179"
296 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

# Calculate RN
RN<-a/sqrt(1-(e2*(sin(rad(phi)))^2))

# Present RN with 6 decimal places


RN6<- format(RN, nsmall=6)
RN6

## [1] "6387458.536282"

# Calculate Ra

Ra<-(RN*RM)/((RN*(cos(rad(alpha)))^2)+(RM*(sin(rad(alpha)))^2))

Ra6<-format(Ra, nsmall=6)
Ra6

## [1] "6372309.400720"

12.16.4 Determine the radius of the meridian, the prime vertical, and the mean radius of
a point with latitude −22∘ 0′ 17.8160" in the SIRGAS-2000 geodetic system. Present
results with 6 decimal places.

A: The radius of the meridian was 6344159.215385𝑚, the radius of the prime vertical was 6381061.877162𝑚, the
average radius was 6362583.792135𝑚.

# Calculate e^2 for GRS-80


e2<-e^2

# Data
a<-6378137.0
phi<--22+17/60+0.8160/3600

# Calculate RM

RM<-(a*(1-e2))/(1-(e2*(sin(rad(phi)))^2))^(3/2)

# Present RM with 6 decimal places


RM6<- format(RM, nsmall=6)
RM6

## [1] "6344159.215385"

# Calculate RN
RN<-a/sqrt(1-(e2*(sin(rad(phi)))^2))
12.16 Solved Exercises 297

# Present RN with 6 decimal places


RN6<- format(RN, nsmall=6)
RN6

## [1] "6381061.877162"

# Calculate R0

R0<-sqrt(RN*RM)

R06<-format(R0, nsmall=6)
R06

## [1] "6362583.792135"

12.16.5 Determine the Earth’ radius for the ellipsoid GRS-80 with 20

A: The Earth’ radius was 6371000.78997413441538810730𝑚.

# Enter parameters of the ellipsoid


a<-6378137.000000000
b<-6356752.314140356

# Calculate the radius


r<-((a^2)*b)^(1/3)
r

## [1] 6371001

# Present the result with 20 decimal places


r1<-format(r, nsmall=20)
r1

## [1] "6371000.78997413441538810730"

12.16.6 Determine the tolerance of a second-order standard survey for measuring elevations
of two geodetic landmarks 25𝑘𝑚 apart.

A: The elevation tolerance was ±6.5𝑚𝑚.

L<-25
T<-1.3*(L^0.5)
T

## [1] 6.5
298 12 Coordinate Reference Systems for Geodetic Surveying with Geomatics and R

12.17 Homework

Choose one exercise presented by the teacher and solve the question with different input values. Compare the results
obtained. Perform plane, geodetic and spherical area calculation of vector attribute data of interest. Compare the
results obtained.

12.18 Resources on the Internet


As a study guide, it was requested to view slides and illustrative videos about the subject covered in the chapter
(Table 12.5).

TABLE 12.5: Slide show and video presentation on geodesy and coordinate reference systems.

Guide Address for access


1 Slides on coordinate reference systems in geodetic surveys2
2 How to define a geodetic datum?3
3 Lecture on geodetic surveying4
4 Accurate geodetic datum development plans5
5 Determining geodetic landmarks6

12.19 Research Suggestion

The development of scientific research on geomatics was stimulated through activity proposals that can be used or
adapted by the student to assess the applicability of the subject matter covered in the chapter (Table 12.6).

TABLE 12.6: Description of practical and research activities that can be used or adapted by students with
suggested research on geodesy and coordinate reference systems.

Activity Description
1 In the content on coordinate reference systems, interest may arise in doing the work based on
examples of geodetic calculations presented
2 Determine the Euclidean and geodetic distance from the intersection survey example performed
by the teacher in the previous chapter. Compare the results obtained.
3 Determine the geodetic area of a polygon surveyed in the field. Compare the results with the
area obtained from plane measurements.

2 http://www.sergeo.deg.ufla.br/geomatica/book/c12/presentation.html#/
3 https://youtu.be/kXTHaMY3cVk
4 https://youtu.be/VeBRfIu5jZ8
5 https://youtu.be/w69xc_U1Rao
6 https://youtu.be/-oUFqg1Lw1U
12.20 Learning Outcomes Assessments Strategy 299

12.20 Learning Outcomes Assessments Strategy

Perform a summary of the chapter, “Coordinate Reference Systems for Geodetic Surveying with Geomatics and R”,
on a single A4 page in order to show the student’s abilities to summarize a subject presenting key points considered
of greater importance today.
13
Cartographic Coordinate Projection Systems with Geomatics and R

13.1 Abstract

The basic problem with cartographic projections was the representation of a curved surface on a plane. The set
formed by the projection and the parameters was called the cartographic projection system. Projection parameters
can be modified using coordinate reference system definitions. The Universal Transverse Mercator (UTM) projection
was used preferentially in Geomatics after the inclusion of the UTM coordinates as a metric unit projection for
different existing ellipsoids (datum). As computation practice, definitions of cartographic projections were observed
in the sf package, available CRS codes and functions to check and assign a CRS to vector-type data. Transformations
of global projections Mollweide, cylindrical equidistant, Mercator and Robinson were mapped. The boundaries of
Brazil were mapped and the country area was calculated using Lambert’s conformal, Albers Equal Area, Mercator
and Equirectangular projections. Finally, transformations of cartographic projections were made into data with
raster geometry in the UTM system. Solved exercises were presented as a review of the theoretical and practical
content.
Keywords: cartography, cartographic projections, EPSG, UTM system.

13.2 Learning Questions


The learning questions answered while reading the chapter were:

• What cartographic representation means?


• How to classify cartographic projections?
• What is the difference between spherical, plane and Universal Transverse Mercator cartographic projections?
• How to obtain geospatial data with the R packages rnaturalearth and spData?
• How to assign, transform and map cartographic projections in R?

13.3 Learning Outcomes

The learning outcomes answered when reading the chapter were:

• Understand the concepts of cartographic representation, classification of cartographic projections and definition
of spherical, plane and Universal Transverse Mercator projections.
• Obtain geospatial data with the rnaturalearth and spData R packages;
• Assign, transform and map cartographic projections with rgdal, units, tmap and raster R packages.

301
302 13 Cartographic Coordinate Projection Systems with Geomatics and R

13.4 Introduction
Cartography was defined as the science, technique, and art of representing the Earth’s surface. In Brazil, the concept
of cartography was introduced in 1839 by Visconde de Santarém, Manoel Francisco de Barros and Souza de Mesquita
de Macedo Leitão, with the etmological significance of mapping (IBGE, 1999).
The cartographic representation of information regarding the phenomena distributed on the Earth’s surface was
carried out in two phases (IBGE, 1999):

• In the first phase (Geodesy), the points on the Earth’s surface were projected on a sphere or on a previously
selected reference ellipsoid;
• In the second phase (Mathematical Cartography), the reference sphere or ellipsoid was projected on a flat surface.

The plane representation of the Earth’s surface was a legacy attributed to Eratosthenes (280 BC to 194 BC),
Hipparchus (194 BC to 126 BC) and Marino (1st century BC).
Eratostenes was the first to calculate the dimensions of the Earth 200 years BC. Eratostenes concluded that the
Egyptian cities of Alexandria and Syene were located approximately on the same meridian. It was also observed
that on the summer solstice, the Sun was directly over Syene. Thus, at that time, the Sun, Siene and Alexandria
were on the same meridian plane and measuring the length of the arc between the two cities and the subtended
angle at the center of the Earth, it would be possible to calculate the Earth’s circumference. The angle between
the two cities and the center of the Earth was determined by the length of the shadow of a vertical rod of known
length in Alexandria (Figure 13.1) (Ghilani and Wolf, 1989; Alves and Silva, 2016).

FIGURE 13.1: Procedure used by Eratostenes to determine the Earth’s circumference.

Through this procedure, Eratostenes applied the following equation to determine the circumference of a circle (𝐶)
(Slocum et al., 2014; Ghilani and Wolf, 1989; Alves and Silva, 2016):
13.5 Cartographic Representation 303

𝑆
𝐶 = 360∘ (13.1)
𝛼

where, 𝑆 was the distance between two locations on the Earth’s surface and 𝛼, the angle that separated the two
locations that defined latitude.
The 𝛼 angle obtained by measuring a shadow in Alexandria was 7∘ 12’. The distance determination was based on
the number of days traveling by camel between the two cities in ∼ 810𝑘𝑚. Replacing these values in the equation,
the Earth’s estimated circumference was 40500𝑘𝑚.

810
𝐶 = 360∘ = 40500𝑘𝑚 (13.2)
7∘ 12’

This calculation was performed in R as follows:

C<-360*(810/(7+12/60))
C

## [1] 40500

The Earth’s circumference result was similar to the current measurements of 40075𝑘𝑚 (Alves and Silva, 2016).
Fundamental contributions to modern mathematical cartography were made by Johann Heinrich Lambert, Carl
Friedrich Gauss and Auguste Tissot. Lambert in 1772 presented and described seven cartographic projections
including Mercator cross-sectional projection, conformal conic projection and azimuthal equal-area projection. Gauss
(1827) contributed with differential geometry to analyze cartographic projections. Tissot (1860, 1881) developed
the theory of cartographic deformation (Casaca et al., 2007).
Most surveys in small areas adopted the hypothesis of flat terrain surface. However, when the survey area is large,
it becomes necessary to consider the Earth’s curvature. Calculations used to determine geodetic positions from
survey observations with distance and azimuth data were laborious, so that practical surveyors were not familiar
with these procedures. A system for specifying positions of geodetic stations using plane coordinates was desirable,
as long as calculations could be performed using simple equations of coordinate geometry (Ghilani and Wolf, 1989;
Alves and Silva, 2016).
In a plane coordinate system, a common reference datum was used for horizontal control over large areas, just as
in the geoid, with single reference point for vertical control. This procedure eliminated individual surveys based on
different reference coordinates not related to other coordinate systems. Plane coordinate systems were available for
all control points in a national reference space system and for other existing control points. These systems were
widely used as reference points to initiate surveys of different types, such as road construction projects, border
demarcation and photogrammetric mapping. With the use of plane coordinates it was possible to initiate projects
for high-speed highways starting at a control station close to another station with the same used coordinate system.
In boundary surveys, if the ends of a reference plot were in a plane coordinate system, the locations of the points
can be easy found. The positions of monuments, iron poles and other types of marks may disappear, but the original
locations could be recovered based on surveys nearby landmarks using a plane coordinate system. For this reason,
the plane coordinate system can be recommended when making new territorial subdivisions or as a reference system
for data entry in geographic information systems registration and spatial analysis (Ghilani and Wolf, 1989; Alves
and Silva, 2016) .

13.5 Cartographic Representation


The cartographic representation was represented by trace or image. The trace representation was divided into globe,
map, chart and plant (IBGE, 1999). Globe referred to a cartographic representation of natural and artificial aspects
in a planetary figure, for cultural and illustrative purposes, on spherical surfaces and small scale. Map was defined
304 13 Cartographic Coordinate Projection Systems with Geomatics and R

as the representation of the geographical, natural, cultural and artificial aspects of an area obtained from the surface
of a planetary figure, delimited by physical, political and administrative elements, intended for thematic, cultural
and illustrative use, on the plane, usually with small scale. Chart was defined as the representation of the artificial
and natural aspects of an area in a planetary surface, subdivided into sheets, delimited by conventional, parallel
and meridian lines, with scale compatible precision, on medium or large scale. Plan was a particular case of a chart
that represents an area of restricted extension, with constant scale and in which the Earth’s curvature was not
considered.
The image representation was divided into mosaic, photocchart, orthophotochart, orthophotomap, photo index and
image chart. The mosaic referred to a set of photos from a certain area, organized in such a way that the whole
set comprised a single photograph. Photochart referred to a controlled mosaic on which a cartographic treatment
was carried out. Ortofotochart referred to a photograph resulting from the transformation of an original photo as
a terrain central perspective, in orthogonal projection on a plane, georeferenced, complemented by symbols and
planimetric information. Orthophotomap referred to a set of several adjacent orthophotocharts in a given region.
Photo index referred to a set of overlapped photographs, usually on a small scale, used for quality control of aerial
surveys and to produce charts using photogrammetric methods. In this case, the scale was normally reduced 3 to
4 times in relation to the flight scale. Image chart referred to a referenced image based on identifiable points with
known coordinates, projection grids, symbology and toponymy.

13.6 Cartographic Projection Classification


The basic problem with cartographic projections was to represent a curved surface in a plane. The ideal would be
to build a chart with all the properties of representing the surface strictly similar to the Earth. This chart should
(IBGE, 1999):

• Maintain the true shape of the areas (conformal);


• Do not change the areas (equivalente);
• Maintain constant relationships between the distances from the represented points (equidistante).

As the Earth is not a plane, it was not possible to build a chart with all the desired conditions for all situations.
Cartographic representations comprise the following stages (IBGE, 1999):

• Adopt a simplified mathematical model of the Earth, in general the sphere or ellipsoid of revolution;
• Design all the elements of the Earth’s surface on the chosen model;
• Relate the points of the mathematical model with the plane representation, with a scale and coordinate system.

In mathematical cartography, the applications of the sphere and the ellipsoid in a plane and the resulting deforma-
tions were studied and classified. The relative positioning of a object on the surface (sphere or reference ellipsoid)
and on the image surface (cartographic plane) was defined by a point preferably located in the center of the region
to be represented, designated by a central point. The meridian and the parallel of the central point were called
meridian and central parallel. The cartographic projection must be bijective, that is, the images of the continuous
lines on the object surface must be equally continuous in the cartographic plane. The cartographic abscissas (𝑋)
were designated by distances to the meridian, symbolized by 𝑀 and counted on the perpendicular. The cartographic
ordinates (𝑌 ) were called perpendicular distances, symbolized by 𝑃 and counted over the meridian. In Anglo-Saxon
countries, the designations corresponding to the abscissa and ordinate were Easting and Northing, symbolized by
E and N, respectively (Casaca et al., 2007).
When the origin of the coordinates of the cartographic projection has been subjected to a translation in order to
place the region in the first quadrant to avoid negative coordinates or to minimize differences to an older coordinate
system, the new coordinates should not be symbolized by M and P, because the confusion with the distances to the
meridian and the perpendicular. This same situation, in the Anglo-Saxon countries, determined the modification of
the new coordinates E, N, by the terms of False-Easting and False-Northing (Casaca et al., 2007).
The following parameters must be specified for a cartographic projection to be operational (Casaca et al., 2007):
13.6 Cartographic Projection Classification 305

• Geodesic datum;
• Central point;
• Scale factor;
• A new origin for cartographic coordinates.

The set formed by the projection and the parameters was called the cartographic projection system (Casaca et al.,
2007).
Cartographic projections were classified by different methodologies in order to determine a better fit of the repre-
sented surface (IBGE, 1999; Fitz, 2008).

13.6.1 Classification by methods

Cartographic projections were classified according to the method into geometric and analytical:

• Geometric: The projection was based on a plane according to a point of view, based on the intersection on
the projection surface of the straight beam that passes through points of the reference surface starting from a
perspective center;
• Analytical: Mathematical formulations were used to calculate the projections.

13.6.2 Classification by deformations

Considering the impossibility of developing a spherical or ellipsoid surface on a plane without deformations, in
practice, projections were used to reduce or eliminate part of deformations according to different applications, as
the following properties (Fitz, 2008):

• Conformal or similar projections: The true shape of the represented areas was maintained by not deforming the
angles on the map;
• Equidistant projections: There was constant variation in the represented distance, without linear deformations;
• Equivalent projections: There was constant variation in the relative dimensions of the represented areas;
• Azimuthal projections: The directions and azimuths of all lines coming from the central point of the projection
were the same as the corresponded lines in the terrestrial sphere;
• Arbitrary projections: Areas, angles, distances or azimuths were not preserved in the projections.

13.6.3 Classification by point of view

The cartographic projections were classified in terms of point of view in gnomics, stereographic and orthographic
(Alves and Silva, 2016):

• Gnomic or central: The point of view was located in the center of the ellipsoid;
• Stereographic: The point of view was located at the opposite end of the projection surface;
• Orthographic: The point of view was infinite.

13.6.4 Classification by type of projection surface

Cartographic projections were classified according to the type of projection surface in plane, conical, cylindrical and
polyhedral (Alves and Silva, 2016):

• Plane: The projection surface was a plane;


• Conical: The projection surface was a cone;
• Cylindrical: The projection surface was a cylinder;
• Polyhedral: Several projection planes were brought together to form a polyhedron.

You might also like