[R-sig-Geo] How to map longitude/latitude to shapes

Dan Putler dan.putler at sauder.ubc.ca
Fri Oct 22 17:24:02 CEST 2010


Hi Dazhi,

The way to do this is use a point-in-polygon test. The sp package (which 
maptools has as a dependency) has the function point.in.polygon which 
performs a point in polygon test.

Dan

On 10/22/2010 06:40 AM, Dazhi Jiao wrote:
> Hi,
>
> I am new to spatial data analysis so sorry to ask a dummy question. I am
> trying to use R maptools to map longitude/latitude to a list of school
> districts. I have read in the shapefile and there are about 500 polygons.
> Now given a new point with longitude and latitude, how can I decide which
> polygon it belongs to?
>
> Thank you!
>
> Dazhi
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list