<html><body><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; "><div>Thank you! I see how this works better now.. </div><div><br></div><div>To answer your query on how I created such an object, it's as you guessed -- t<span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; ">o get around violating the code when spatstat.options(checkpolygons=TRUE), which would give error message "Error in owin(poly = opls) : Polygon data contain overlaps between polygons," </span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; ">I temporarily set it to FALSE in order that my garbled polygon data would be accepted, as least for now! </span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; "><div><br></div><div>I'm not planning to assign such a garbled window to my point pattern data; for that I have a normal, single-poly window. </div><div><br></div><div>But I am seeking a way to generate a smooth estimate of a set of spatially varying occurrences -- the population of survey flights that went on within the boundary of that overall single-poly window. Idea was to address this as a key spatial covariate underlying the distribution of all my points... hope that makes sense.</div><div><br></div><div>Thanks so much for the help!</div></span></div><div>Robin</div><div><br></div></span></div><div><br>On 04 Jun, 2011,at 07:40 AM, Adrian.Baddeley@csiro.au wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">Robin W Hunnewell <a href="mailto:rhunne@mac.com" _mce_href="mailto:rhunne@mac.com">rhunne@mac.com</a> wrote:<br>
<br>
> I've used pixellate.owin() to convert an object of class "owin" to a pixel image -- the owin in question is <br>
> unusual in that it contains multiple, overlapping polygons.<br>
<br>
This is a question about the 'spatstat' package.<br>
<br>
Out of curiosity - How did you create such an object? The code should refuse to create it, unless you switched off the error checking... Overlapping polygons violate the requirements of the owin class, and this will cause trouble sooner or later. <br>
<br>
> Now I'd like to change (constrict) the frame area of a resulting "im" object by assigning <br>
> a different and smaller window to it, using pixellate.owin <br>
<br>
pixellate.owin is not designed to do that. <br>
The argument 'W' to pixellate.owin is mainly intended as a way of controlling pixel resolution. It is meant to define a pixel raster. The raster must be large enough to contain the original window.<br>
<br>
To do what you want, first convert your window to an 'im' object using pixellate.owin (without the 'W' argument), and then trim it to a smaller window using "[.im" as follows (where 'Depth' is your original window and 'ConvexW3' is the desired subwindow)<br>
<br>
A <- pixellate(Depth)<br>
B <- A[ConvexW3, drop=FALSE]<br>
C <- B[as.rectangle(ConvexW3)]<br>
<br>
Line 2 sets all pixels outside the window 'ConvexW3' to NA. It is needed only if 'ConvexW3' is not a rectangle; it's redundant if 'ConvexW3' is a rectangle. <br>
Line 3 trims the pixel raster to the smallest valid rectangle.<br>
<br>
To control the pixel resolution, for example if you want pixels to have size 'eps', replace line 1 by <br>
<br>
A <- pixellate(Depth, eps=eps)<br>
<br>
Adrian Baddeley</div></div></blockquote></div></body></html>