[R-sig-Geo] map2SpatialPolygons' 'proj4string' in spmaps

Sebastian P. Luque spluque at gmail.com
Wed Oct 15 20:31:51 CEST 2008


On Wed, 15 Oct 2008 20:20:16 +0200 (CEST),
Roger Bivand <Roger.Bivand at nhh.no> wrote:

> On Wed, 15 Oct 2008, Sebastian P. Luque wrote:
>> On Wed, 15 Oct 2008 19:24:18 +0200 (CEST),
>> Roger Bivand <Roger.Bivand at nhh.no> wrote:

[...]

> If the fill=TRUE argument to map() is omitted, the rings are not
> built:

> se.baffin <- map("worldHires", xlim=c(-70, -60), ylim=c(62, 69),
> resolution=0, interior=FALSE, fill=TRUE, plot=FALSE) baff <-
> map2SpatialPolygons(se.baffin,
> IDs=se.baffin$names)[match("Canada:Baffin Island", se.baffin$names)]
> plot(baff, axes=TRUE)

> looks OK to me. Add the CRS later. I don't think that we know
> definitely that WGS84 was used, WDBII seems to have been around since
> 1985. Try overlaying on GE, for example, to get a feel.

Great, I'll check on this.


>> Do you know of any examples showing how one may close such rings,
>> based on a polygon?  Say we have a rectangle over the map object and
>> want to close the ring so we enclose all the land (or water)?

> By hand, you need to insert coordinates into the coords slot of the
> Polygon object of interest and re-generate it. A recent question on
> the list about houses east of a road was handled this way (stitch the
> bounding box to the road and use overlay()).

> Otherwise look at the unionSpatialPolygons() code for ideas on
> interfacing gpclib classes and methods (also in PBSmapping).

Thanks so much, I'll follow these leads!


All the best,

-- 
Seb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20081015/eb4c6eb2/attachment.bin>


More information about the R-sig-Geo mailing list