[R-sig-Geo] zerodist() fails with Projected Data
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Mon Jul 22 10:14:51 CEST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This was a bug. svn revision 1437 on r-forge has this corrected.
Thanks for the reproducible example,
On 07/21/2013 08:29 PM, Jesse Berman wrote:
> Hi All,
>
> I have run across an error where 'zerodist()' fails to identify
> duplicate points if data is projected under a geographic coordinate
> system (e.g. WGS84 or NAD83). However, it works correctly if data
> has no set projection or is projected under a local or continental
> system (e.g. Albers Equal Area or Lambert Conformal Conic). Any
> thoughts as to why this occurs (see example below)?
>
> Jesse
>
> /# GCS Projection, where zerodist() fails to identify duplicates.
> WGS84 also fails to work require(sp) longitude<-c(-75.518056,
> -76.952778, -77.032500, -75.558056, -75.558056)
> latitude<-c(39.155000, 38.897222, 38.880833, 39.739444, 39.739444)
> z<-c(12, 14, 15, 13, 19) data<-as.data.frame(cbind(longitude,
> latitude, z)) coordinates(data)=~longitude+latitude
> proj4string(data)=CRS("+proj=longlat +ellps=GRS80 +datum=NAD83
> +no_defs +towgs84=0,0,0 +units=m") # NAD83 Geographic Coordinate
> System zerodist(data)/
>
> /# Continental Projection on same dataset, where zerodist()
> identifies duplicates require(sp) longitude<-c(-75.518056,
> -76.952778, -77.032500, -75.558056, -75.558056)
> latitude<-c(39.155000, 38.897222, 38.880833, 39.739444, 39.739444)
> z<-c(12, 14, 15, 13, 19) data<-as.data.frame(cbind(longitude,
> latitude, z)) coordinates(data)=~longitude+latitude
> proj4string(data)=CRS("+proj=aea +lat_1=20 +lat_2=60 +lat_0=40
> +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m
> +no_defs") #Continental projection system for Albers Equal Area
> zerodist(data) /
>
>
>
> ----- --------------------------------------------------------
> Jesse D Berman, PhD Johns Hopkins Bloomberg School of Public
> Health Department of Environmental Health Sciences Post-Doc -- View
> this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/zerodist-fails-with-Projected-Data-tp7584211.html
>
>
Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________ 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJR7On7AAoJEM1OCHCtOnfx410H+way0NyeX/6zryng7JFibORl
tAIr28MEqYnSNF/PCQeIGZuC586YGsU5VdJGbfw1mVSN38CFVAVLct+KEj0rmoGs
+NXWiR76tvJ10jejXnNOr9RJvfrT6Nmet6Tx6WMt2hxVOP1dFb4ADe74RNz2ZX22
wf4ekjqIYPVmzF/Ojsn5EHvbFeNODoYU4Vn11ELIlzAYf6DACAqqOHEzLqe1MqIS
UqZKaysa2q+eiVCBCs1oaowICirHGizkTNu9n6p9YG21zAZCJd0qCfg3OifTg64f
wflSqzoAoBcc+F22NxTTyPcWnaWh6qhiIXH11oPNCPwJpK7mceNF/o5PqZcum7k=
=sqyM
-----END PGP SIGNATURE-----
More information about the R-sig-Geo
mailing list