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. |
|
|
|
rdgal
rgdal 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. ERRATA LIST 0.6-* series (message of Jan 16, 2009) To all rgdal users! The new rgdal release (0.6-1) is not yet stable in some respects, some of which are showing up as we go. Do not update to this release for production work yet, but do update if you are willing to help sort out problems. The Windows binary from CRAN will bundle the minimal GDAL and PROJ.4 binaries, and their support files as before. The source package *no longer* bundles the GDAL or PROJ.4 support files - bundled NAD Intel-endian binary files were causing trouble on OSX PPC forunderstandable reasons. From 0.6-*, source-installed rgdal (all installs except the Windows CRAN build) will need to rely on the local platform support files. If need be, set environment variables PROJ_LIB and GDAL_DATA manually, but try first to see whether GDAL and PROJ.4 autodetect correctly. Expect rapid releases for the next few days until things stabilise. I apologise for doing this "live", but it is well-nigh impossible to pre-test the networked build systems used to distribute software in any other way. Reports of problems with the 0.6-* series will be very helpful.
Problems known: 1) make_EPSG() only working on Windows CRAN binary (Jan 16, 2009, resolved in 0.6-3 submitted to CRAN Jan 17, 2009, now uses platform support file in all other cases). 2) Users installing PROJ.4 from RPM files on Linux and installing the source rgdal package now need to have the proj*, proj-devel*, proj-epsg*, and proj-nad* rpm files installed (Jan 19, 2009, check added to ./configure, 0.6-4) 3) Users installing PROJ.4 from the Linux Debian proj package from edge-backports, lenny, or sid will see that ./configure gives a warning that proj/conus is not found. The Debian proj package for 4.6.1 (at least) is missing the NAD and other grid datum transformation files, and until they are reinstated by the Debian package builder, the only resolution for users needing grid datum transformation files is to install PROJ.4 from source (Jan 20, 2009)
-------------------------------------------------------------- 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
classInt
The 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. PBSmapping
PBSmapping 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 maps
A 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: January 20, 2009 by Roger Bivand


