[R-sig-Geo] SpatialLines to SpatialPolygons convertion

Kamran Safi ksafi at orn.mpg.de
Tue Mar 3 21:21:01 CET 2009


Hi all,

I was just wasting the last two days fiddling around this problem. I 
ended up using maptools and PBSmapping with SpatialLines2PolySet() and 
then PolySet2SpatialPolygons() to work around this problem. I don't know 
why this has to be so complicated. But I was also struggling with 
different projections, so you might find this solution easy...

Hope this helps.

Kami
-- 
Kamran Safi

Max Planck Institute for Ornithology
Vogelwarte Radolfzell
Schlossallee 2
78315 Radolfzell
Germany

and

Institute of Zoology
Zoological Society of London
Regent's Park
NW1 4RY London
United Kingdom


Henk Sierdsema schrieb:
> Hi Hans,
>
> Please have a look at paragraph 2.6 (page 41) on spatial polygons in the ASDAR-book. Here you will find an example of converting a shoreline into polygons.
>
> Henk
>
>
>
> Henk Sierdsema
>
> SOVON Vogelonderzoek Nederland / SOVON Dutch Centre for Field Ornithology
>
> Rijksstraatweg 178
> 6573 DG  Beek-Ubbergen
> The Netherlands
> tel: +31 (0)24 6848145
> fax: +31 (0)24 6848122
>
>
>
> -----Oorspronkelijk bericht-----
> Van: Hans-Jörg Bibiko [mailto:bibiko at eva.mpg.de]
> Verzonden: dinsdag 3 maart 2009 17:33
> Aan: R-sig-Geo at stat.math.ethz.ch
> Onderwerp: [R-sig-Geo] SpatialLines to SpatialPolygons convertion
>
>
> Hi,
>
> I have a short question.
> Is there any workaround available which tries to convert a list of  
> SpatialLines to a list of SpatialPolygons objects?
>
> In my case I have a list of Lines objects coming from a gshhs  
> (shorelines) file. The list represents 8 polygons of a given xlim/ 
> ylim. Now I'd like to convert the list into 8 polygons in order to  
> draw them filled out.
>
> I could do it 'manually' and try close these lines heuristically but  
> maybe there's already such a workaround available.
>
> Thanks for any hint in advance!
>
> --Hans
>
> PS The new maptools release is really nice :) Thanks!
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>   


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3275 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090303/bd26e82e/attachment.bin>


More information about the R-sig-Geo mailing list