gissr is a collection of R functions which make working with spatial data easier.
The development version:
# Install dependency devtools::install_github("skgrange/threadr") # Install gissr devtools::install_github("skgrange/gissr")
R's spatial data analysis abilities are very well developed. Therefore, R can be used as an effective geographical information system (GIS). A key advantage of R in GIS applications is that the user can dip in-and-out of R's general string, numerical, and visualisation tools and apply them to spatial data.
However, the challenges I have with using R as a GIS are:
Keeping track of the multiple packages which are used,
the lack of consistency among these packages, and
the lack of tidy outputs which other areas of the R ecosystem have been so good at developing.
To overcome these points, I have written wrappers for many geographical functions which generally begin
sp_ to do particular tasks and bundled all the dependencies together as a package. Some of these functions will likely be useful for others.
Easily read shapefiles, GPX, GeoJSON, KML, GML, TAB, and File Geodatabases with
sp_read, a wrapper for
Transform projection systems with
sp_transformcan also force projections when a spatial object has none.
transform_coordinatesdoes a similar thing, but for data frames.
Transform data frames (tables) to spatial points, lines, or polygons with
Transform data frames with a well known text (WKT) variable (or just a vector) to a spatial object with
Bind/combine different spatial objects with
Unite spatial objects with
sp_unite and do the opposite with
Calculate lengths or areas of spatial objects with
Clip or crop a spatial object to an rectangular envelope with
To filter objects by other polygons, use
[ subsetting (or
Rectangular or elliptical polygons can be created with
sp_ellipse for this purpose too.
Do simple transformations to spatial objects with
Simplify spatial objects with
"Dissolve" polygons to make a single feature with
"Punch" holes in polygons with
Add positive or negative buffers with
Create enclosing polygons with
Find centroids of geometries with
"Promote" or "demote" Spatial* to Spatial*DataFrame, i.e. add or drop data slots for geometries with
Return and reset geometry IDs with
Point-in-polygon tests with
Calculate distances among spatial objects with
distance_by_haversinedoes the same thing, but with a different method, and for data frames.
Fix issues with spatial objects with
sp_fix. This function is a blatant wrap of
cleangeo::clgeo_Clean. This function is a good piece of work so make sure you have a look at the cleangeo package.
Parse vectors of degrees, minutes, and seconds into decimal degrees with
Sort/arrange points in a clockwise order with
Create Tessellation polygons with
Export spatial objects to spatial data files with
Transform spatial objects to data frames with
Create a raster layer from spatial data with
Filter/crop/mask a raster layer with a spatial polygon with
Interpolate a raster layer/surface with
Increase a raster's resolution with
Smooth a raster's values with
Extract values from raster objects using spatial data types with
ra_drill and then produce a "tidy data" version with
Transform raster objects to data frames with
get_osm_*functions to import data from OpenStreetMap.
Develop a function which can read n features in a spatial data file. This will be helpful when large data files are encountered and system memory is too small to load the entire file at once.
Get the interface between R and SpatiaLite sorted.
Concave hull function i.e. find minimum area polygon.
Add support for WKB (well-known binary).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.