Map packages on CRAN
| Maps may be vector-based or raster-based. The rgdal package provides bindings to GDAL-supported raster formats and OGR-supported vector formats. It contains functions to write raster files in supported formats. The package also provides PROJ.4 projection support for vector objects. The Windows binary of rgdal includes a subset of possible data source drivers; if others are needed, use FWTools conversion utilities. There are a number of other packages for accessing vector data on CRAN: maps (with mapdata and mapproj) provides access to the same kinds of geographical databases as S, RArcInfo allows ArcInfo v.7 binary files and *.e00 files to be read, and maptools and shapefiles read and write ArcGIS/ArcView shapefiles. For visualization, the colour palettes provided in the RColorBrewer package are very useful, and may be modified or extended using the colorRampPalette function provided with R. The classInt package provides functions for choosing class intervals for thematic cartography. | |
Spatial data analysis Packages on CRAN Other Packages Mailing list Links |
| mapsmaps is an implementation for R of the legacy S geographical database access functionality. It is split into maps and mapdata ; projection is available in package mapproj.maptoolsmaptools uses shapelib code to read and write ESRI shapefiles, but does not depend on linking to that library. The package also contains functions for converting objects read into R using either the maptools or the shapefiles packages to objects for plotting, and/or for use in the spdep package. It is being extended to provide functions for writing polygon boundaries for use in other software, such as WinBUGS, Mondrian, and for the tmap command in Stata, and other such export functions will follow. It also now permits shapefiles with damaged index files (apparently from Geolytics Inc.) to be read and repaired, and exported as standards-conforming shapefiles. From release 0.6-*, maptools includes all the remaining off-CRAN functions from wrapper packages in the Sourceforge repository. These include functions to interface with the PBSmapping, maps, gpclib, spatstat packages. In addition, an interface function to GSHHS databases for shoreline data is included, together with the coarse database for world maps. Finally, wrapper functions to convert RArcInfo-read v.7 ArcInfo vector data into sp class objects. |
|
| rdgalrgdal provides bindings between R and GDAL for accessing image and raster data. The package is using SourceForge as its development repository, but the freshest releases can be found on CRAN. From release 0.4-2, it depends on the sp package of spatial data classes, can read and write SpatialGridDataFrames with full support for spatial reference systems, can read (and from 0.5-1 write) OGR vector data to suitable classes, and provides full PROJ.4 projection/transformation support. It depends on GDAL 1.3.1 or later and PROJ.4 4.4.9 or later. When installing from the source package, the drivers available for vector and raster data sources will be those of the installation platform. When installing the Windows binary, they will be the subset present on the CRAN Windows build server (from 0.5-1 including drivers from the GDAL CVS of early November 2006, including KML). Should a driver not be available, install FWTools and use ogr2ogr or gdal_translate to convert your data to a format supported in rgdal. Please note that from the release of package rgdal version 0.4-3, package spproj is withdrawn and is kept in the repository only for archival purposes. Use rgdal fron CRAN, and for projection use the spTransform method which replaces the transform method from rgdal 0.4-4. OSX: The rgdal source package from CRAN can be installed on OSX by first installing PROJ.4 and GDAL, then installing sp, and finally download the source package tarball to a suitable temporary location, and install with R CMD INSTALL ... your options ... rgdal*.tar.gz. Your options give the locations, if required, of --with-gdal-config=, --with-proj-include=, and/or --with-proj-lib=, all within --configure-args='' as described in section 1.2.2 of the ''Writing R extensions'' manual. A convenient way of doing this is to install William Kyngesburye's frameworks following instructions given here. Please also note that the MacOS X FAQ 5.3 explains that you must have a recent version of Xcode tools. If you run into complie errors, check your Xcode version and refer to the FAQ (comment thanks to Prof. Brian Ripley answering a question from Thomas Adams). Dylan Beaudette has found that rgdal can be built on PowerPC 64 bit systems by: export CFLAGS="-mpowerpc64 -O2" and equivalently for CXXFLAGS, FFLAGS and FCFLAGS. There may be other ways around this, but these do work currently classIntThe classInt package provides a unified interface to choosing class intervals for thematic cartography, including Jenks' natural breaks. Chosen intervals can also be plotted over an empirical cumulative distribution function of the data to be visualised.RArcInfoRArcInfo provides an interface to functions by Daniel Morissette to read geographical information in Arc/Info V 7.x format and E00 files to import the coverages into R variables. It has a homepage with additional documentation. shapefilesshapefiles uses pure R (connections) to read ESRI shapefiles, it has a homepage with other resources describing the use of R in transportation modelling. PBSmappingPBSmapping combines a range of mapping functions with specific needs: it evolved from fisheries research conducted at the Pacific Biological Station (PBS) in Nanaimo, British Columbia, Canada. It extends the R language to include two-dimensional plotting features similar to those commonly available in a Geographic Information System (GIS). Embedded C code speeds algorithms from computational geometry, such as finding polygons that contain specified point events or converting between longitude-latitude and Universal Transverse Mercator (UTM) coordinates. It includes data for a global shoreline and other data sets in the public domain. Base graphics functionsBase graphics functions may be used to draw maps, in particular the use of the asp=1 argument to plot.window() - usually called by plot.default() and other functions is recommended when the easting and northing metrics are equal. It is possible to import PNM image files using the pixmap package, and the image() function can be used for displaying rasters (with care, because row order may be reversed and the data matrix transposed in relation to what you expect to see). Proportional symbol mapsA note by Susumu Tanimura, Chusi Kuroiwa, and Tsutomu Mizota on proportional symbol maps has been published in the Journal of Statistical Software Volume 15, 2006, Issue 5, providing a function and some examples. Work in progressPlease refer to work in progress for packages not yet on CRAN - they often depend on external libraries, and are thus harder to adapt to CRAN quality assurance criteria. |
Last modified: October 09, 2007 by Roger Bivand
