Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
g.proj(1)		    GRASS GIS User's Manual		     g.proj(1)

       g.proj	-  Prints  or  modifies	GRASS projection information files (in
       various co-ordinate system descriptions).
       Can also	be used	to create new GRASS locations.

       general,	projection, create location

       g.proj --help
       g.proj  [-pgdjfwetc]    [georef=file]	 [wkt=file]	[proj4=params]
       [epsg=code]    [list_codes=string]   [datum=name]   [datum_trans=index]
       [location=name]	 [--help]  [--verbose]	[--quiet]  [--ui]

	   Print projection information	in conventional	GRASS format

	   Print projection information	in shell script	style

	   Verify datum	information and	print transformation parameters

	   Print projection information	in PROJ.4 format

	   Print 'flat'	output with no linebreaks (applies to WKT  and	PROJ.4

	   Print projection information	in WKT format

	   Use ESRI-style format (applies to WKT output	only)

	   Force  override of datum transformation information in input	co-or-
	   dinate system

	   Modify current location projection files

	   Print usage summary

	   Verbose module output

	   Quiet module	output

	   Force launching GUI dialog

	   Name	of georeferenced data file to read projection information from

	   Name	of ASCII file containing a WKT projection description
	   '-' for standard input

	   PROJ.4 projection description
	   '-' for standard input

	   EPSG	projection code
	   Options: 1-1000000

	   List	codes for given	authority, e.g.	EPSG, and exit
	   Options: EPSG, ESRI,	IGNF, OGC, PROJ

	   Datum (overrides any	datum specified	in input co-ordinate system)
	   Accepts standard GRASS datum	codes, or "list" to list and exit

	   Index number	of datum transform parameters
	   "0" for unspecified or "-1" to list and exit
	   Options: -1-100
	   Default: 0

	   Name	of new location	to create

       g.proj provides a means of converting a co-ordinate system  description
       (i.e.  projection  information)	between	 various formats.  If compiled
       without OGR present, the	functionality is limited to:

	   o   Reporting the projection	information for	the current  location,
	       either in conventional GRASS (-p	flag) or PROJ (-j flag)	format

	   o   Changing	the datum, or reporting	and modifying the datum	trans-
	       formation parameters, for the current location

       When compiled with OGR, functionality is	increased and allows output of
       the  projection	information  in	the Well-Known Text (WKT) format popu-
       larised by proprietary GIS. In addition,	if one of the parameters  geo-
       ref, wkt, proj4 or epsg is specified, rather than the projection	infor-
       mation being read from the current location it is imported from an  ex-
       ternal source as	follows:

	   g.proj  attempts to invoke GDAL and OGR in turn to read a georefer-
	   enced file filename.	The projection information will	be  read  from
	   this	 file.	If the file is not georeferenced or cannot be read, XY
	   (unprojected) will be used.

       wkt=filename or -
	   The file filename should contain a projection  description  in  WKT
	   format  with	 or  without line-breaks (e.g. a '.prj'	file). If - is
	   given for the filename, the WKT description will be read from stdin
	   rather than a file.

       proj4=description or -
	   description	should be a projection description in PROJ format, en-
	   closed in quotation marks if	there are any spaces. If  -  is	 given
	   for	description,  the  PROJ	 description  will  be read from stdin
	   rather than as a directly-supplied command-line parameter.

	   number should correspond to the index number	of a valid co-ordinate
	   system  in the EPSG database. EPSG code support is based upon a lo-
	   cal copy of the GDAL	CSV co-ordinate	system and  datum  information
	   files, stored in the	directory $GISBASE/etc/proj/ogr_csv. These can
	   be updated if necessary to support future  revisions	 of  the  EPSG

       If  datum  information is incorrect or missing in the input co-ordinate
       system definition (e.g. PROJ descriptions have very limited support for
       specifying datum	names),	a GRASS	datum abbreviation can instead be sup-
       plied using the datum parameter.	This will override any datum contained
       in  the	input co-ordinate system, and discard any datum	transformation
       parameters. Enter datum=list to return a	list of	all  the  datums  sup-
       ported  by  GRASS.  Since  any existing datum transformation parameters
       will have been discarded, the datumtrans	parameter  should  in  general
       always be used in conjunction with datum.

       The -p, -j, -w, etc. flags are all functional when importing projection
       information from	an external source, meaning that g.proj	can be used to
       convert	between	representations	of the information. It is not required
       that either the input or	output be in GRASS format.

       In addition however, if the -c flag is specified,  g.proj  will	create
       new  GRASS  projection  files  (PROJ_INFO,  PROJ_UNITS,	WIND  and  DE-
       FAULT_WIND) based on the	imported information. If the location  parame-
       ter  is	specified  in addition to -c, then a new location will be cre-
       ated.  Otherwise	the projection information files in the	current	 loca-
       tion will be overwritten. The program will not warn before doing	this.

       The  final mode of operation of g.proj is to report on the datum	infor-
       mation and datum	transformation parameters associated with the co-ordi-
       nate system. The	-d flag	will report a human-readable summary of	this.

       If  the input co-ordinate system	contains a datum name but no transfor-
       mation parameters, and there is more than one  suitable	parameter  set
       available  (according to	the files datum.table and datumtransform.table
       in $GISBASE/etc/proj), g.proj will check	the value  of  the  datumtrans
       option and act according	to the following:
       -1:  List  available  parameter	sets  in  a GUI-parsable (but also hu-
       man-readable) format and	exit.
       0 (default): Continue without specifying	parameters - if	used when cre-
       ating  a	 location,  other GRASS	modules	will use the "default" (likely
       non-optimum) parameters for this	datum if necessary in the future.
       Any other number	less than or equal to the  number  of  parameter  sets
       available  for  this datum: Choose this parameter set and add it	to the
       co-ordinate system description.
       If the -t flag is specified, the	module will attempt to change the  da-
       tum  transformation  parameters using one of the	above two methods even
       if a valid parameter set	is already specified in	the input  co-ordinate
       system.	This  can be useful to change the datum	information for	an ex-
       isting location.

       Output is simply	based on the input projection information. g.proj does
       not  attempt  to	 verify	 that  the  co-ordinate	 system	thus described
       matches an existing system in use in the	 world.	 In  particular,  this
       means there are no EPSG Authority codes in the WKT output.

       WKT format shows	the false eastings and northings in the	projected unit
       (e.g. meters, feet) but in PROJ format it should	always be given	in me-

       The  maximum  size of input WKT or PROJ projection descriptions is lim-
       ited to 8000 bytes.

   Print information
       Print the projection information	for the	current	location:
       g.proj -p

       List the	possible datum transformation parameters for the current loca-
       g.proj -t datumtrans=-1

   Create projection (PRJ) file
       Create  a '.prj'	file in	ESRI format corresponding to the current loca-
       g.proj -wef > irish_grid.prj

   Read	projection from	file
       Read the	projection information from a GeoTIFF file  and	 print	it  in
       PROJ format:
       g.proj -jf georef=ASTER_DEM20020508161837.tif

       Convert the PROJ	projection description contained in a text file	to WKT
       cat proj4.description | g.proj -w proj4=-

   Create new location
       Create a	new location with the co-ordinate system referred to  by  EPSG
       code 4326 (Latitude-Longitude/WGS84), without explicitly	specifying da-
       tum transformation parameters:
       g.proj -c epsg=4326 location=latlong

       Create a	new location  with  the	 co-ordinate  system  referred	to  by
       ESRI-EPSG code 900913 (Google Mercator Projection)
       g.proj -c epsg=900913 location=google

       Create  a  new location with the	co-ordinate system referred to by EPSG
       code 29900 (Irish Grid),	selecting datum	transformation	parameter  set
       no. 2:
       # list available	datums for EPSG	code 29900
       g.proj -t datumtrans=-1 epsg=29900
       g.proj -c epsg=29900 datumtrans=2 location=irish_grid

       Create  a  new location with the	same co-ordinate system	as the current
       location, but forcing a change to datum	transformation	parameter  set
       no. 1:
       g.proj -c location=newloc -t datumtrans=1

       Create a	new location with the co-ordinate system from a	WKT definition
       stored in a text	file:
       g.proj -c wkt=irish_grid.prj location=irish_grid

       Create a	new location from a PROJ description, explicitly specifying  a
       datum and using the default datum transformation	parameters:
       g.proj -c location=spain	proj4="+proj=utm +zone=30 +ellps=intl" datum=eur50 datumtrans=0

   Using g.proj	output for GDAL/OGR tools
       Reproject external raster map to	current	GRASS projection (does not al-
       ways make sense!)  using	the GDAL 'gdalwarp' tool. We recommend to  use
       the ERDAS/Img format and	not to use the ESRI style of WKT:
       # example for 30x30 pixel resolution (enforce with -tr to avoid odd values)
       gdalwarp	-of HFA	-tr 30 30 -t_srs "`g.proj -wf`"	aster.img aster_tmerc.img

       Reproject external vector map to	current	GRASS projection using the OGR
       'ogr2ogr' tool:
       ogr2ogr -t_srs "`g.proj -wf`" polbnda_italy_GB_ovest.shp	polbnda_italy_LL.shp

       PROJ: Projection/datum support library
       GDAL raster library and toolset
       OGR vector library and toolset

       Further reading

	   o   ASPRS Grids and Datum

	   o   MapRef -	The Collection of Map Projections and  Reference  Sys-
	       tems for	Europe

	   o   Projections Transform List (PROJ)

	m.proj,	r.proj,	v.proj,	r.import,, v.import,

       Paul Kelly

       Available at: g.proj source code	(history)

       Main  index | General index | Topics index | Keywords index | Graphical
       index | Full index

       A(C) 2003-2020 GRASS Development	Team, GRASS GIS	7.8.3 Reference	Manual

GRASS 7.8.3							     g.proj(1)


Want to link to this manual page? Use this URL:

home | help