GRASS Short Course - Notes for Part 2: Projections and GRASS Locations


Coordinates written in two notations:

PROJ4 software

Provides the 'cs2cs' tool to reproject point data (coordinate pairs [with z elevation]):
#see supported projections short version:
cs2cs -lp
#see supported projections long version:
cs2cs -lP
#see supported parameters for certain projection (example: UTM)
cs2cs -l=utm
cs2cs -l=tmerc
cs2cs -l=lcc

#see supported ellipsoids:
cs2cs -le

#see supported map units:
cs2cs -lu

#see built-in map datums:
cs2cs -ld

#see built-in prime meridians (A prime meridian may be declared indicating
#  the offset between the prime meridian of the declared coordinate system and
#  that of greenwich):
cs2cs -lm
Latitude-Longitude and WGS84 is default setting for 'cs2cs'.


Transform the following Gauss-Boaga coordinates (Monte Cimirlo, Trentino Fuso Ovest = Fuso 1)
  1. to UTM/WGS84 and
  2. to UTM/ED50.
         East         North     Elevation
	1667267.26  5104155.74 531.9

For 'cs2cs' you first need to find the related EPSG (European Petroleum Survey Group) numbers. There is a file containing several thousand projection definitions:

nedit /usr/local/share/proj/epsg
-> search EPSG number of "Monte Mario (Rome) / Italy zone 1"
   ==> 26591
-> Monte Cimirlo, Trentino is in UTM zone 32N. So we search the EPSG number of "WGS 84 / UTM zone 32N"
   ==> 32632
-> Monte Cimirlo, Trentino is in UTM zone 32N. So we search the EPSG number of "ED50 / UTM zone 32N"
   ==> 23032

Additionally you need the datum transformation parameters (because they are missing for unknown reasons in the EPSG file). You can find many European datums at: and also buy them from IGM.

#3 parm: Molodensky transformation GB to UTM/WGS84
#defined with "towgs84" parameter: x, y, z - shift only, parameters are in meters
# - skipped as 3 parameter datum transformation is not very precise.

#7 parm: Helmert transformation GB to UTM/WGS84
#defined with "towgs84" parameter: x, y, z, scale x, scale y, scale z, rotation
#                                  parameters are in meters, rotation
# We have two datums available:
# * IGM Datum for Trieste, borrowed from :
#                                      +towgs84=-85.88,-28.85,+49.67,-1.003,-2.383,-1.808,-27.82
# * Peninsular Datum from +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
#The reprojection requires 2 steps: GB -> LatLong -> UTM

echo "1667267.26 5104155.74 531.9" | cs2cs -v +init=epsg:26591 \
     +towgs84=-85.88,-28.85,+49.67,-1.003,-2.383,-1.808,-27.82 \
     +to +proj=latlong +pm=rome
11d9'46.103"E   46d4'7.746"N 735.593

echo "11d9'46.103E 46d4'7.746N 735.593" | cs2cs -v +proj=latlong \
     +to +init=epsg:32632
667261.93       5103967.78 735.59

#The same procedure in one step:
echo "1667267.26 5104155.74 531.9" | cs2cs -v +init=epsg:26591 \
     +towgs84=-85.88,-28.85,+49.67,-1.003,-2.383,-1.808,-27.82 \
     +to +proj=latlong +pm=rome | cs2cs -v +proj=latlong \
     +to +init=epsg:32632
667261.93       5103967.78 735.59
# ... this are the UTM/WGS84 coordinates.

#Now similar for UTM/ED50:
echo "1667267.26 5104155.74 531.9" | cs2cs -v +init=epsg:26591 \
     +towgs84=-85.88,-28.85,+49.67,-1.003,-2.383,-1.808,-27.82 \
     +to +proj=latlong +pm=rome | cs2cs -v +proj=latlong \
     +to +init=epsg:23032
667269.74       5104064.48 735.59
# ... this are the UTM/ED50 coordinates.
Note that the (ellipsoid) heights are identical, but the East and North coordinates vary.

Other Example: transforming from LatLong to UTM/WGS84:

echo "11d7'58.87328E 46d5'8.89033N 429.782" |cs2cs -v +proj=latlong +datum=WGS84 \
                                                      +to +init=epsg:32632
664907.82       5105792.64 429.78
# ... this are the resulting UTM/WGS84 coordinates.

Defining new LOCATIONs in GRASS

  LOCATION: new name          (e.g. latlong | gbovest | utm32)
  MAPSET: username            (your user name)
  DATABASE: don't change      (already points to 'grassdata')

Continue with ESC-ENTER

© 2003 Markus Neteler (neteler AT
Back Course HOME
Last change: $Date: 2003-11-09 23:08:46 +0100 (Sun, 09 Nov 2003) $