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.
Using GIS data in R
5 messages · JeffND, Rolf Turner, Zuofeng Shang
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:
vignette("shapefiles")
cheers,
Rolf Turner
Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not very clear. The context is as follows. I have a set of locations with coordinates (latitude and longitude) from Texas region. Some of the locations are within Texas while some of them are not. I am trying to find those locations within Texas by looking at if the coordinate of each location is within the boundary of Texas. Now I agree with you that the boundary of Texas is polygon although it looks like "irregular". I find your previous post very helpful. inside.owin() will do the job but I have to figure out the boundary (as a polygon) of Texas. Since I do not have the shapefile of Texas, this will be difficult for me. I am not sure if the shapefile of the US states are available in R. If it not, how can I get the shapefiles? Thanks a lot for kind help! Best regards, Jeff
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:
vignette("shapefiles")
cheers,
Rolf Turner
On 21/11/11 10:19, Zuofeng Shang wrote:
Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not very clear. The context is as follows. I have a set of locations with coordinates (latitude and longitude) from Texas region. Some of the locations are within Texas while some of them are not. I am trying to find those locations within Texas by looking at if the coordinate of each location is within the boundary of Texas. Now I agree with you that the boundary of Texas is polygon although it looks like "irregular". I find your previous post very helpful. inside.owin() will do the job but I have to figure out the boundary (as a polygon) of Texas. Since I do not have the shapefile of Texas, this will be difficult for me. I am not sure if the shapefile of the US states are available in R. If it not, how can I get the shapefiles? Thanks a lot for kind help!
This is not my area of expertise (if indeed I have such an area at all!
:-) ) but
I'm sure that maps of the states of the USA --- including Texas, even!
--- are readily available
from various sources. I.e. from various GIS's or perhaps from the
"maps" package.
With a bit of luck someone on the list will chime in with something more
specific.
Or you could try asking "how/where can I get a shapefile specifying the
boundary
of Texas" on the R-Sig-Geo list.
HTH
cheers,
Rolf
Many thanks Rolf! Your help is highly appreciated since it helps me understand the clue of solving my problem. Have a wonderful Sunday! Jeff ? 2011/11/20 15:52, Rolf Turner ??:
On 21/11/11 10:19, Zuofeng Shang wrote:
Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not very clear. The context is as follows. I have a set of locations with coordinates (latitude and longitude) from Texas region. Some of the locations are within Texas while some of them are not. I am trying to find those locations within Texas by looking at if the coordinate of each location is within the boundary of Texas. Now I agree with you that the boundary of Texas is polygon although it looks like "irregular". I find your previous post very helpful. inside.owin() will do the job but I have to figure out the boundary (as a polygon) of Texas. Since I do not have the shapefile of Texas, this will be difficult for me. I am not sure if the shapefile of the US states are available in R. If it not, how can I get the shapefiles? Thanks a lot for kind help!
This is not my area of expertise (if indeed I have such an area at all!
:-) ) but
I'm sure that maps of the states of the USA --- including Texas, even!
--- are readily available
from various sources. I.e. from various GIS's or perhaps from the
"maps" package.
With a bit of luck someone on the list will chime in with something more
specific.
Or you could try asking "how/where can I get a shapefile specifying the
boundary
of Texas" on the R-Sig-Geo list.
HTH
cheers,
Rolf
--