[R-sig-Geo] difficulty converting DDD to UTM): closer

Terry Griffin tgriffin at uaex.edu
Mon Jan 24 15:48:35 CET 2011



----- Original Message -----
From: "Jeffrey Stratford" <jeffrey.stratford at wilkes.edu>
To: r-sig-geo at r-project.org
Sent: Sunday, January 23, 2011 8:26:39 PM GMT -06:00 US/Canada Central
Subject: [R-sig-Geo] difficulty converting DDD to UTM): closer

Hi everyone,

 

I've gotten closer to a solution but there's still something wonky going
on.  Here's the new code I'm using 

 

dd_sosp <- read.csv("g:\\sosp\\2010\\sosp2010coord.csv", header=T)

names(dd_sosp) <- c("X","Y") 

attr(dd_sosp, "projection") <- c("LL") 

sosp.utm <- convUL(dd_sosp)

 

The output is clearly wrong:

 

> sosp.utm

           X        Y

1   430.1917 4600.661

2   424.6950 4566.313

3   432.0162 4560.321

4   430.0987 4561.664

 

Here's the raster information and the points fall should within

# class       : Extent 

# xmin        : 1620430 

# xmax        : 1699212 

# ymin        : 2182993 

# ymax        : 2264400

 

Any ideas?

 

Also, I'm not sure why I see UTM coordinates between programs.  On
Google Earth, my coordinates might be 457536.61 m E,  4543110.30 m N but
this seems to be entirely different for positions associated with the
numbers I'm giving for my raster.  

 

Thanks for your patience!  

 

*****************************************

Jeffrey A. Stratford, Ph.D.

Department of Health and Biological Sciences

84 W. South St.

Wilkes Univertsity, PA 18766

570-332-2942

http://web.wilkes.edu/jeffrey.stratford/

*****************************************




	[[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


Hi Jeffrey,

If you are willing to try rgdal rather than PBSmapping, 

library(rgdal)


dd_sosp <- read.csv("g:\\sosp\\2010\\sosp2010coord.csv", header=T)

names(dd_sosp) <- c("X","Y") 

xycoords<-cbind(dd_sosp$X,dd_sosp$Y)

utm.m<-project(xycoords, "+proj=utm +north +zone=18")

colnames(utm.m)<-c("easting","northing")

data<-cbind(utm.m,ymd.data2)

head(data)


Terry Griffin, Ph.D.
Assistant Professor - Economics
University of Arkansas - Division of Agriculture
501.671.2182
tgriffin at uaex.edu



More information about the R-sig-Geo mailing list