[R-sig-Geo] Plotting a projected map in UTM coordinates
Tom Gottfried
tom.gottfried at tum.de
Sun Mar 25 08:33:11 CEST 2012
Manuel,
you actually don't project your map to UTM. You just assign another CRS.
Use spTransform() for projection.
HTH,
Tom
Am 25.03.2012 05:10, schrieb Manuel Spínola:
> Dear list members,
>
> I am projecting a map to UTM but when I plot the map the axes display
> geographic coordinates, do you know why?
>
>> cr =
> readOGR(dsn="/Users/manuelspinola/Documents/ProyectosRespacial/EvalHab_reporte",
> layer="Cr_wgs84_meso")
> OGR data source with driver: ESRI Shapefile
> Source:
> "/Users/manuelspinola/Documents/ProyectosRespacial/EvalHab_reporte", layer:
> "Cr_wgs84_meso"
> with 1 features and 6 fields
> Feature type: wkbPolygon with 2 dimensions
>> summary(cr)
> Object of class SpatialPolygonsDataFrame
> Coordinates:
> min max
> x -85.951890 -82.55642
> y 8.043422 11.22162
> Is projected: FALSE
> proj4string :
> [+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]
> Data attributes:
> AREA PERIMETER LIMITES_PA LIMITES__1 ID
> Min. :4.211 Min. :20.71 Min. :520 Min. :519 Min. :2
> 1st Qu.:4.211 1st Qu.:20.71 1st Qu.:520 1st Qu.:519 1st Qu.:2
> Median :4.211 Median :20.71 Median :520 Median :519 Median :2
> Mean :4.211 Mean :20.71 Mean :520 Mean :519 Mean :2
> 3rd Qu.:4.211 3rd Qu.:20.71 3rd Qu.:520 3rd Qu.:519 3rd Qu.:2
> Max. :4.211 Max. :20.71 Max. :520 Max. :519 Max. :2
> PAIS
> COSTA RICA:1
>
> proj4string(cr)<-CRS("+proj=tmerc +lon_0=-84 +lat_0=0 +x_0=500000 +k=0.9999
> +datum=WGS84")
>
>> summary(cr)
> Object of class SpatialPolygonsDataFrame
> Coordinates:
> min max
> x -85.951890 -82.55642
> y 8.043422 11.22162
> Is projected: TRUE
> proj4string :
> [+proj=tmerc +lon_0=-84 +lat_0=0 +x_0=500000 +k=0.9999 +datum=WGS84
> +ellps=WGS84 +towgs84=0,0,0]
> Data attributes:
> AREA PERIMETER LIMITES_PA LIMITES__1 ID
> Min. :4.211 Min. :20.71 Min. :520 Min. :519 Min. :2
> 1st Qu.:4.211 1st Qu.:20.71 1st Qu.:520 1st Qu.:519 1st Qu.:2
> Median :4.211 Median :20.71 Median :520 Median :519 Median :2
> Mean :4.211 Mean :20.71 Mean :520 Mean :519 Mean :2
> 3rd Qu.:4.211 3rd Qu.:20.71 3rd Qu.:520 3rd Qu.:519 3rd Qu.:2
> Max. :4.211 Max. :20.71 Max. :520 Max. :519 Max. :2
> PAIS
> COSTA RICA:1
>
> Best,
>
> Manuel
>
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Technische Universität München
Department für Pflanzenwissenschaften
Lehrstuhl für Grünlandlehre
Alte Akademie 12
85350 Freising / Germany
Phone: ++49 (0)8161 715324
Fax: ++49 (0)8161 713243
email: tom.gottfried at wzw.tum.de
http://www.wzw.tum.de/gruenland
More information about the R-sig-Geo
mailing list