"Historically, 4 packages make it possible to import, manipulate and transform spatial data:\n",
"\n",
"- The package `rgdal` [@rgdal] which is an interface between Rand the [GDAL](http://www.gdal.org/) [@GDAL] and [PROJ](https://proj.org/) [@PROJ] libraries allow you to import and export spatial data (shapefiles for example) and also to manage cartographic projections\\\n",
"- The package `sp` [@sp] provides class and methods for vector spatial data in R. It allows displaying background maps, inspectiong an attribute table etc.\\\n",
"- The package `rgeos` [@rgeos] gives access to the [GEOS](http://trac.osgeo.org/geos/) spatial operations library and therefore makes classic GIS operations available: calculation of surfaces or perimeters, calculation of distances, spatial aggregations, buffer zones, intersections, etc.\\\n",
"- The package `raster` [@raster] is dedicated to the import, manipulation and modeling of raster data.\n",
"\n",
"Today, the main developments concerning vector data have moved away from the old 3 (`sp`, `rgdal`, `rgeos`) to rely mainly on the package `sf` ([@sf], [@pebesma2018]). In this manual we will rely exclusively on this package to manipulate vector data.\n",
"\n",
"The packages `stars` [@stars] and `terra` [@terra] come to replace the package `raster` for processing raster data. We have chosen to use the package here `terra` for its proximity to the `raster`.\n",
"\n",
"## The package `sf`\n",
"\n",
"<img src=\"img/sf.gif\" align=\"right\" width=\"150\"/> The package `sf` was released in late 2016 by Edzer Pebesma (also author of `sp`). Its goal is to combine the feature of `sp`, `rgeos` and `rgdal` in a single, more ergonomic package. This package offers simple objects (following the [*simple feature*](https://en.wikipedia.org/wiki/Simple_Features) standard) which are easier to manipulate. Particular attention has been paid to the compatibility of the package with the *pipe* syntax and the operators of the `tidyverse`.\n",
"\n",
"`sf` directly uses the GDAL, GEOS and PROJ libraries.\n",
"Objects`sf` are objects in `data.frame` which one of the columns contains geometries. This column is the class of sfc (*simple feature column*) and each individual of the column is a sfg (*simple feature geometry)*. This format is very practical insofa as the data and the geometries are intrinsically linked in the same object.\n",
"\n",
"```{block2, type='linky'}\n",
"Thumbnail describing the simple feature format: \n",
" [Simple Features for R](https://r-spatial.github.io/sf/articles/sf1.html)\n",
"```\n"
],
"id": "b4f55113"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
\ No newline at end of file
%% Cell type:raw id:a9a187e6 tags:
---
bibliography: references.bib
---
%% Cell type:markdown id:b4f55113 tags:
# Introduction {#introductionx}
## Spatial in R : History and evolutions
Historically, 4 packages make it possible to import, manipulate and transform spatial data:
- The package `rgdal`[@rgdal] which is an interface between Rand the [GDAL](http://www.gdal.org/)[@GDAL] and [PROJ](https://proj.org/)[@PROJ] libraries allow you to import and export spatial data (shapefiles for example) and also to manage cartographic projections\
- The package `sp` [@sp] provides class and methods for vector spatial data in R. It allows displaying background maps, inspectiong an attribute table etc.\
- The package `rgeos`[@rgeos] gives access to the [GEOS](http://trac.osgeo.org/geos/) spatial operations library and therefore makes classic GIS operations available: calculation of surfaces or perimeters, calculation of distances, spatial aggregations, buffer zones, intersections, etc.\
- The package `raster` [@raster] is dedicated to the import, manipulation and modeling of raster data.
Today, the main developments concerning vector data have moved away from the old 3 (`sp`, `rgdal`, `rgeos`) to rely mainly on the package `sf` ([@sf], [@pebesma2018]). In this manual we will rely exclusively on this package to manipulate vector data.
The packages `stars` [@stars] and `terra` [@terra] come to replace the package `raster` for processing raster data. We have chosen to use the package here `terra` for its proximity to the `raster`.
## The package `sf`
<imgsrc="img/sf.gif"align="right"width="150"/> The package `sf` was released in late 2016 by Edzer Pebesma (also author of `sp`). Its goal is to combine the feature of `sp`, `rgeos` and `rgdal` in a single, more ergonomic package. This package offers simple objects (following the [*simple feature*](https://en.wikipedia.org/wiki/Simple_Features) standard) which are easier to manipulate. Particular attention has been paid to the compatibility of the package with the *pipe* syntax and the operators of the `tidyverse`.
`sf` directly uses the GDAL, GEOS and PROJ libraries.
[Simple Features for R](https://r-spatial.github.io/sf/)
:::
### Format of spatial objects `sf`
{fig-align="center" width="600"}
Objects`sf` are objects in `data.frame` which one of the columns contains geometries. This column is the class of sfc (*simple feature column*) and each individual of the column is a sfg (*simple feature geometry)*. This format is very practical insofa as the data and the geometries are intrinsically linked in the same object.
```{block2, type='linky'}
Thumbnail describing the simple feature format:
[Simple Features for R](https://r-spatial.github.io/sf/articles/sf1.html)