[R-sig-Geo] convert (lat -lon) coordinates to cartesian coordinates

Michael Sumner mdsumner at gmail.com
Mon Aug 1 01:31:31 CEST 2011


As Rolf suggests, there is spTransform in rgdal (supported by sp
package) for general coordinate transformation using the PROJ.4
library.

What  projection is appropriate for *completely* depends on what you
need to do and where your data are from (and their extent), though
there are some pretty general guidelines that can be used to make a
safe decision.

If you just want distance on the WGS84 ellipsoid there is spDistsN1 in
the sp package, but if you want to input projected coordinates into
spatstat functions you'll need to find out what projection is
appropriate from the beginning.

Let us know more about the requirements and it will be easier to make
suggestions.

Cheers, Mike.


On Mon, Aug 1, 2011 at 8:45 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> On 01/08/11 10:25, Angelo Moreno wrote:
>>
>> Hi, I have a list.In the fisrt column are the latitudes, in the second
>> column
>> are the longitudes, how could i convert this format to cartesian
>> coordinates, is that possible in R?,Thanks  a lot.
>
> It's really not that simple.  Latitude and longitude are coordinates on
> the surface of a sphere.  Cartesian coordinates are coordinates on a
> flat surface.  They are fundamentally incompatible. There are various
> ***projections*** of regions of a spherical surface onto a plain that
> provide
> approximate relationships.  How good these approximations are depends on
> the size and shape of the region on the spherical surface.
>
> There may be tools in the "sp" package which could be of use to you.
>
>    cheers,
>
>        Rolf Turner
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list