Data Handling (I/O) {#data}

As an ArcGIS user, you are probably very familiar with the two major geodata formats, raster data and vector data. shapefiles and geodatabases with feature classes are most commonly used for vector data in the ESRI World. For raster data, geotiffs and ESRI GRID files inside geodatabases are used very frequently. As you work with OpenSource GIS Tools and Data, you will come across a much richer ecosystem of data formats (which can be a blessing and a curse!).

In ArcGIS, you add a new dataset to your project using the "Add Data" button in the "Map" Pane. ArcGIS then "helps" you in various ways that R will not. For example, ArcGIS:

R provides less help when importing a dataset which can be seen as a disadvantage, but in many cases is more preferable. R interferes less and assumes an informed user who has good knowledge of the data. Just like when importing datasets using read.csv, read.delim and so on, you need to prior knowledge of your data to import it correctly: You need to know the delimiter used to separate columns, and the encoding used to store the information.

The same holds true when importing geodata in R: depending on the type of geodata, we need different packages to handle the data and different functions to import it. For handling vector data, the package sf now has replaced its predecessor sp. sf is so powerful and simple, that it has helped bring GIS workflows to non-GIS R users. For handling raster data, the package raster is still in heavy use but is in the process of being replaced by it's successor, terra.




arc2r/book documentation built on March 5, 2021, 2:10 p.m.