[R] Plot/manage spatial boundary data

From: David Forrest <drf5n_at_maplepark.com>
Date: Fri 10 Jun 2005 - 09:30:59 EST


I have some disconnected boundary data from a finite element ocean model and I'd like to make a plot.

Maptools looks promising, but since my data is not in a shapefile or a map, I'm unclear on what the best way to approach the problem.

>geom[1:10,]

         lon lat depth

1  -75.42481 35.58192 16.172
2  -75.40726 35.58567 18.045
3  -75.41351 35.60312 17.333
4  -75.38888 35.58959 20.787
5  -75.39495 35.60706 19.834
6  -75.36964 35.59370 20.950
7  -75.37556 35.61159 20.941
8  -75.35530 35.61660 23.107
9  -75.34950 35.59800 22.960
10 -75.33418 35.62194 23.934


>island1<-c(2,3,4,2)
>water<-c(1,3,5,7,8,10)
> land<-c(1,2,4,6,9,10)
> plot(geom$lon[land],geom$lat[land],pch='.',t='l')
 lines(geom$lon[water],geom$lat[water],pch='.',t='l',col="blue")  lines(geom$lon[island1],geom$lat[island1],pch='.',t='l',col="green")

The above is toy-sized: dim(geom) is on the order of 120000,3 and there are about 30 different islands. Maptools seems devoted to shapefiles, and it is unclear how to create 'polylists'.

Is there a good way to manage and graph data defined on irregular grids?

Dave

-- 
 Dr. David Forrest
 drf@vims.edu                                    (804)684-7900w
 drf5n@maplepark.com                             (804)642-0662h
                                   http://maplepark.com/~drf5n/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 10 09:35:10 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:28 EST