<html><body><div>Dear R-sig Geo listers,</div><div><br></div><div>sorry for my longwinded post, maybe I could try again.. </div><div><br></div><div>I've used pixellate.owin() to convert an object of class "owin" to a pixel image -- the owin in question is unusual in that it contains multiple, overlapping polygons.</div><div><br></div><div>Now I'd like to change (constrict) the frame area of a resulting "im" object by assigning a different and smaller window to it, using pixellate.owin </div><div>## S3 method for class 'owin'</div><div><div>pixellate(x, W = NULL, ...)</div></div><div>where W is Optional - Window determining the pixel raster on which the conversion should occur.</div><div><br></div><div>It works perfectly when converting a line segment pattern (pixellate.psp) to pixel image. The resulting "im" is clipped by an assigned, smaller window. But when I try the same with an owin object, it doesn't seem to work. I either get an error, when trying it out on a normal (single polygon) owin object: </div><div><br></div><div>Error in pixellate.owin() : W does not cover the domain of x</div><div><br></div><div>But when trying it out on my multi-polygon owin object, the frame area barely changes and I can't control the pixel resolution of the resulting image. See code below.</div><div>I'm sure I'm missing something basic about windows and pixellating them. If my question is not up to standards for this List, I'll stop perstering, just wanted to try again.</div><div>I'd be grateful any help, thank you!!</div><div><br></div><div><br></div><div><br></div><div>## convert line segment object to a pixel image</div><div><div>> A <- pixellate(Depth, dimyx=200)</div><div>> summary(A)</div><div>real-valued pixel image</div><div>200 x 200 pixel array (ny, nx)</div><div>... </div><div>Image is defined on the full rectangular grid</div><div>Frame area = 3336.49966365421 square kilometer </div><div><br></div><div>## now assign a smaller window to the same line segment object being converted to pixel image</div><div>> A2 <- pixellate(Depth, W=convexW3, dimyx=200)</div><div>> summary(A2)</div><div>real-valued pixel image</div><div>200 x 200 pixel array (ny, nx)</div><div>... </div><div>Image is defined on a subset of the rectangular grid</div><div>Subset area = 747.515033662265 square units </div><div><br></div></div><div><br></div><div>## All works well</div><div>## now when I try same thing to my owin object (which contains multiple polygons), the frame area stays same - if anything increasing just a tiny bit</div><div>##pixellate owin object</div><div><div>> A <- pixellate(Mowin, dimyx=200)</div><div><div>> summary(A)</div><div>real-valued pixel image</div><div>200 x 200 pixel array (ny, nx)</div><div>...</div><div>Image is defined on the full rectangular grid</div><div>Frame area = 1323.61474064852 square kilometer </div><div><br></div></div><div>## now assign a smaller window to the same owin object being converted to pixel image</div><div>> A2 <- pixellate(Mowin, W=W3, dimyx=200)</div><div>> summary(A2)</div><div>real-valued pixel image</div><div>200 x 200 pixel array (ny, nx)</div><div>...</div><div>Image is defined on the full rectangular grid</div><div>Frame area = 1325.20504128399 square kilometer </div><div><br></div></div><div><br></div><div><div><br></div></div><div><pre style="font-family: Helvetica,Arial,sans-serif; font-size: 13px" _mce_style="font-family: Helvetica,Arial,sans-serif; font-size: 13px;"><br></pre></div></body></html>