Skip to content
Prev 17316 / 29559 Next

converting latitude and longitude to UTM

To get started, try the following:

require(sp)

bbox(NYC2)
bbox(NYBorough)
range(myfile$X)
range(myfile$Y)

and see if the ranges of X,Y are even close to the coordinate ranges of
your shapefiles.

Then try

coordinates(myfile) <- c('X','Y')
bbox(myfile)
plot(myfile)

If the problem is what you suspect, i.e., lat/long vs. UTM (which seems
likely), then you will have to start learning about how to specify
coordinate systems in R. It's a much bigger topic than I can go into here.
See the help for
  ?proj4string
  ?spTransform   (as suggested by Mike Sumner in another response)


You will need the rgdal package for spTransform.

For what it's worth, I use Quantum GIS (QGIS) when I need to find out
information about a particular projection.

-Don
Message-ID: <5E1B812FAC2C4A49B3D99593B5A5219125F663@PRDEXMBX-08.the-lab.llnl.gov>
In-Reply-To: <0F5A69EADAE27F44B09561937B83C3A45954AC641F@MDMBX.PIRE.org>