[R] "Maps in R"

About this list Date view Thread view Subject view Author view Other groups

Subject: [R] "Maps in R"
From: Baz (B.Rowlingson@lancaster.ac.uk)
Date: Tue 22 Feb 2000 - 21:17:48 EST


Message-ID: <38B2705C.AFAFD8C6@lancs.ac.uk>

 I've just spent a couple of idle weekends getting a version of the
S-plus 'maps' library working under R.

 For those unfamiliar with the maps library, it lets you map a
geographical region, split into areas, and optionally colour-fill
those areas according to some variable. For example:

R> library(maps)
R> map("state",c("california","nevada","washington"))

 draws a line map of those three states.

R> map("uk",fill=T,color=pop.colour)

 draws a map of the uk with counties coloured by the pop.colour
vector.

 The system also supports map projections. You can do this:

R> map("state",proj="merc")

 to draw the map on a mercator projection. I have used the USGS
PROJ4.2 projection library, and so there are many projections
and options available. I've also added a Great Britain Ordnance
Survey grid projection to PROJ4.2, for use with maps of this
area.

 You can also do inverse projections - plot a map with a projection,
get locations with locator(), and then inverse-project them to get
back to lat-long coordinates.

 That's all the good news. The bad news is that there's a few problems
here and there, mainly related to lines that cross the +180/-180
boundary
and to certain projections - an azimuthal projection (i.e. as you would
see the earth from space) of the world map doesn't do hidden-line
removal of the far side, it just crashes!

 So I'm looking for interested parties to have a play with the code.
Preferably people with some experience of the S/Splus maps library, or
anyone with a geographical interest. It may even be worth starting from
scratch again and building an R-GIS package from the ground up...

 Email me with your interest.

Barry Rowlingson
Maths and Stats
Lancaster University
Lancaster, UK
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Mon 17 Jul 2000 - 12:33:09 EST