[R-sig-Geo] Automatic geographical projection parameters setting

Pascal Oettli kridox at ymail.com
Wed May 29 10:15:30 CEST 2013


Hello,

Something like that?

 > LONG <- 20
 > LAT <- 5

 > crs.args <- paste("+proj=laea +lat_0=",LAT," +lon_0=",LONG," +x_0=0 
+y_0=0 +ellps=WGS84 +units=m +no_defs",sep="")

 > CRS("+proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +ellps=WGS84 
+units=m +no_defs")
CRS arguments:
  +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +ellps=WGS84 +units=m 
+no_defs

 > CRS(crs.args)
CRS arguments:
  +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +ellps=WGS84 +units=m 
+no_defs

Regards,
Pascal


On 05/29/2013 04:58 PM, Francesco Carotenuto wrote:
> Hi
> to all,
> I
> need to automatically set the geographical coordinates of the projection’s
> centre to project different polygons in different territories. My problem is the
> following.
> By
> using spTransform(xy, CRS("+proj=laea +lat_0=LAT +lon_0=LONG +x_0=0 +y_0=0
> +ellps=WGS84 +units=m +no_defs")),  I would like to set  +lat_0 and +long_0 as objects (here “LAT” and
> “LONG”) that I automatically generated. Unfortunately, this function doesn’t
> read objects (even if “as.numeric”) but only numerical values set manually. Is
> there a way to set these coordinates as objects?
> Many
> thanks.
> 	[[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list