[R-sig-Geo] Re: SpatialCls
Roger Bivand
Roger.Bivand at nhh.no
Sun Jan 11 18:42:44 CET 2004
Dear Edzer,
Happy New Year!
I'm just muddling, but would it be OK to try to put my proj4R CRS class in
SpatialCls for proj4string? This may mean setting proj4string as NA until
the CRS has been set, and as.projected as NULL until proj4string is
identified as latlong or !latlong? How should we handle this with regard
to commiting to sourceforge, is this a situation where I need to do this
locally, and send you a tarball to avoid introducing changes you'd prefer
not to have?
A little question - does coordinates() preserve sdf row names as a way of
keeping point IDs stuck to both objects?
I'm a bit worried about holes too in the polygon setting, the original
compiled code in maptools for finding ring direction seems buggy, and ring
direction seems to be a typical way of flagging holes as against
boundaries for fill.
Best wishes,
Roger
On Fri, 28 Nov 2003, Edzer J. Pebesma wrote:
> Hi Barry, Roger, r-sig-geo gang,
>
> I just checked in updates to SpatialCls on
> http://sourceforge.net/projects/r-spatial/ --
> I completed documentation, added tests and examples. The
> whole package should pass R CMD check. Even the S4 classes
> are now documented, slots and all. No vignettes yet,
> still have to get into them.
>
> The interfaces used so far are:
>
> # The following three promote a data.frame to a SpatialDataFrame
>
> coordinates(meuse) = ~x+y # or
> coordinates(meuse) = c("x", "y") # or
> coordinates(meuse) = cbind(x,y)
>
> # after which
>
> coordinates(meuse)
>
> # retrieves coordinates; also:
>
> coordinates(meuse.grid) = ~x+y # followed by
> gridded(meuse.grid) = TRUE
>
> # promotes meuse.grid to a SpatialDataFrameGrid, which has
> # (and auto-detects) grid topology; it has an image method.
>
> # then,
>
> polygons(x) = list(pol1, pol2, pol3)
>
> # promotes data.frame x to a SpatialPolygons, adding the
> # polygon information to it, doing some basic checks
> # (e.g. pol1..3 should be 2column matrix with at least 4 points,
> # first and last being the same);
>
> polygons(x) # retrieves the polygon list
> data.frame(x) # retrieves the attribute values data.frame
>
> # some elementary plot, show, formula and summary methods are present.
>
> What else do we need, when it comes to interfaces/methods?
>
> Enjoy the weekend,
> --
> Edzer
>
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list