[R] Using GIS data in R

Rolf Turner rolf.turner at xtra.co.nz
Sun Nov 20 20:54:15 CET 2011

On 21/11/11 08:01, JeffND wrote:
> Hi Rolf,
> I have a similar question. I want to test whether a point with certain
> coordinates is inside
> a state, say Texas. It seems that inside.owin() only works for testing if a
> point lies in a
> regular region, say a polygon. Since Texas has irregular boundary, how do we
> achieve this?
> Or there is some alternative way we can use.
> Thanks!
> Jeff
> --
> View this message in context: http://r.789695.n4.nabble.com/Using-GIS-data-in-R-tp1748266p4089242.html
> Sent from the R help mailing list archive at Nabble.com.

It would be nice to have some context ... nabble strikes again.

But to get to your question:  How do you think the boundary of Texas
(irregular as it may be) is specified?  I expect that it is specified as
a polygon!!!  It may be *very* ``poly'' --- i.e. have a large number of
edges --- but it's still a polygon and inside.owin() will still work on it.

Have a look at the data set "nbfires" in the spatstat package.  New
Brunswick has an ``irregular boundary'' too!

Have you *tried* making your specification of Texas into an owin object?
Follow the instructions in the vignette given by:



         Rolf Turner

More information about the R-help mailing list