Tony,

On Wed, Sep 14, 2011 at 2:36 PM, Anthony Fischbach <afischbach@usgs.gov>wrote:

> I am producing plots of spatialPolygons over a spatialPixelDataFrame
> and wish to convert the spatialPolygons object to a spatialLines object
> as a work around of two plotting problems.
>
>

if x is a SpatialPolygons object, you can do

y <- as(x, 'SpatialLines')


Problem 1: Donut holes in the polygons are plotting as white,
> rather than as a null color that would allow the spatialPixelDataFrame
> object's colors to show through.
>
> Problem 2: I wish to set the polygon outline color so that it better
> contrasts with the color ramp of the spatialPixelDataFrame object plot.
>
>
with SpatialPolygons you can change the color of the outline:

plot(x, border='red')

Best, Robert



>
> -----
> Tony Fischbach, Wildlife Biologist
> Walrus Research Program
> Alaska Science Center
> U.S. Geological Survey
> 4210 University Drive
> Anchorage, AK 99508-4650
>
> AFischbach@usgs.gov
> http://alaska.usgs.gov/science/biology/walrus
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Coerce-spatialPolygons-to-spatialLines-tp6794570p6794570.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

