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

Michael Ash mash at econs.umass.edu
Fri Nov 18 00:45:12 EST 2005


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




More information about the grass-user mailing list