[R-sig-Geo] point.in.polygon() or over() help?

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu May 23 21:30:53 CEST 2013



On 05/23/2013 07:08 PM, Chris Waigl wrote:
> 
>>
>> Hi Roger- Getting closer to fixing the problem. You were correct with the
>> proj4string differing. The fish capture coordinates are "NA" and the Basins
>> are "+proj=longlat +ellps=WGS84." So now I am trying to convert the points.
>> Here is the code I input:
>>
>> cap.coords.sp<-spTransform(cap.coords.sp,CRS("+proj=longlat"))
> 
> Would this work:
> 
> proj4string(cap.coords.sp) <- "+proj=longlat +datum=WGS84"

this will only change the proj4string, but not reproject (and warn about
this fact).

You have to use spTransform with the string containing the datum.

> 
> (Or maybe "+proj=longlat +ellps=WGS84" -- not sure why I use +datum and you use +ellps.)
> 
> Best regards,
> 
> Chris Waigl
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de



More information about the R-sig-Geo mailing list