[GRASS5] g.proj

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu Aug 28 06:29:53 EDT 2003


Hello
I've added some new functions to the proj library in the 5.7.x CVS tree,
the idea being that all the handling of the datum.table, ellipse.table and
datumtransform.table files can be done from within here instead of in GIS
lib.

A new module that uses these functions is also there, g.proj. The idea is
that eventually this will be a replacement for g.setproj. Currently it
only replaces g.projinfo. The most interesting new feature is that it can
output the projection information for the current location in WKT format
(like a '.prj' file), which was a requested feature. It makes use of GDAL
/ OGR for this but if not available the rest should just compile, leaving
out the functions that need OGR. It writes to stdout so it can be
re-directed to a file.

Testing and feedback welcome; sample output below.

Mapset <PERMANENT> in Location <sjpnew>
GRASS 5.1.0-cvs > g.proj help

Usage:
 g.proj [-pjwef]

Flags:
  -p   Print projection information for current location
  -j   Print projection information for current location in PROJ.4 format
  -w   Print projection information for current location in WKT ('.prj')
format
  -e   Use ESRI-style format (applies to WKT output only)
  -f   Print 'flat' output with no linebreaks

Mapset <PERMANENT> in Location <sjpnew>
GRASS 5.1.0-cvs > g.proj -p
-PROJ_INFO-------------------------------------------------
name       : Transverse Mercator
datum      : ire65
datumparams: towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15
proj       : tmerc
ellps      : modif_airy
a          : 6377563.3959999997
es         : 0.0066705400
f          : 299.3249646000
lat_0      : 53.5000000000
lon_0      : -8.0000000000
k_0        : 1.0000350000
x_0        : 200000.0000000000
y_0        : 250000.0000000000
-PROJ_UNITS------------------------------------------------
unit       : metre
units      : metres
meters     : 1.0000000000

Mapset <PERMANENT> in Location <sjpnew>
GRASS 5.1.0-cvs > g.proj -j
+proj=tmerc
+lat_0=53.5000000000
+lon_0=-8.0000000000
+k_0=1.0000350000
+x_0=200000.0000000000
+y_0=250000.0000000000
+a=6377340.189
+rf=299.3249646
+towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15

Mapset <PERMANENT> in Location <sjpnew>
GRASS 5.1.0-cvs > g.proj -w
PROJCS["Transverse Mercator",
    GEOGCS["modif_airy",
        DATUM["TM65",
            SPHEROID["modif_airy",6377340.189,299.3249646],
            TOWGS84[482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",53.5],
    PARAMETER["central_meridian",-8],
    PARAMETER["scale_factor",1.000035],
    PARAMETER["false_easting",200000],
    PARAMETER["false_northing",250000],
    UNIT["metre",1]]




More information about the grass-dev mailing list