[GRASSLIST:9773] Converst lat/long to x,y

Michael Ash mash at econs.umass.edu
Mon Jan 9 16:01:25 EST 2006


Dear GRASSlist,

I am reposting an email to which I did not receive a response.  Here
is a very brief summary of the problem, and a longer description is
below:

I would like to transform a set of lat/long maps to a new location on
an x,y basis using the following formula,
X = Radius*cos(Lat)*Long
Y = Lat * Radius
where Lat and Long are latitude and longitude (measured in radians)
and Radius is an earth's radius.  I know that there are problems
(datum, spheroid, non-preservation of area, etc.) with this model
(which measures x as arc length along a line of latitude from the
prime meridian and y as arc length along a line of longitude from the
equator), BUT this is what I want to do.

Is there an easy way to have GRASS go through every lat/long point in
a vector map and create a matching point in an x,y map USING A
SPECIFIED FORMULA?  I do not want to use v.transform (why stretch,
when I have a formula).

Thank you.
Michael Ash






Dear GRASSlist,

I am working with raster data that was converted from a lat/long basis
to an x,y basis with the following formula:

X = INT(Rad * cos(LatR) * LongR) / Cell) -AdjustX
Y = INT(LatD / YBand) - AdjustY

where:
Rad = Earth's radius, 6366707.444 meters;
Cell = size of the grid cell: 1000 meters;
LatR = latitude of position in radians;
LongR = longitude of position in radians;
LatD = latitude of position in decimal degrees;
Yband = (180/(Radius * pi)) * CellSize;
AdjustX = 0.5 if latitude >0, -0.5 if latitude<0;
AdjustY = 0.5 if longitude >0, -0.5 if longitude<0;


(1) If I read the conversion correctly, X is the arc length along
lines of latitude from the prime meridian, and Y is the arc length
along lines of longitude from the equator.  The resulting x,y basis
maps for North America are strongly skewed from southwest to northeast
(because the X arc distance along a line of latitude is shorter for
more northern latitudes, right?) Are there any thoughts from the
GRASSLIST on the consequences of this conversion?

(2) I have several GRASS vector maps now on a lat/long basis (from the
US census) that I would like to convert to the same x,y basis, i.e.,
take every lat/long point in the map and convert it using the above
formula.  Is there a straightforward way to make this conversion in
GRASS?  I have read the documentation for v.transform (and v.proj and
several other possibilities) but it seems more complicated than I need
because it will stretch, etc., to make the transformation line up.  I
have an actual formula.  Is there any way to convert every point  on a
lat/long map to this x,y basis using the above formula?

I would like to try this conversion even if there are good GIS reasons
not to do it. Thank you very much.

Best,

Michael Ash


--
Michael Ash, Associate Professor
  of Economics and Public Policy
Department of Economics and CPPA
University of Massachusetts
Amherst, MA 01003
Tel +1-413-545-6329 Fax +1-413-545-2921
Email mash at econs.umass.edu
http://people.umass.edu/maash




More information about the grass-user mailing list