1g.proj(1)                   GRASS GIS User's Manual                  g.proj(1)
2
3
4

NAME

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

KEYWORDS

11       general, projection, create location
12

SYNOPSIS

14       g.proj
15       g.proj --help
16       g.proj  [-pgdjfwetc]    [georef=file]     [wkt=file]     [proj4=params]
17       [epsg=code]    [list_codes=string]   [datum=name]   [datum_trans=index]
18       [location=name]   [--help]  [--verbose]  [--quiet]  [--ui]
19
20   Flags:
21       -p
22           Print projection information in conventional GRASS format
23
24       -g
25           Print projection information in shell script style
26
27       -d
28           Verify datum information and print transformation parameters
29
30       -j
31           Print projection information in PROJ.4 format
32
33       -f
34           Print ’flat’ output with no linebreaks (applies to WKT  and  PROJ.4
35           output)
36
37       -w
38           Print projection information in WKT format
39
40       -e
41           Use ESRI-style format (applies to WKT output only)
42
43       -t
44           Force   override  of  datum  transformation  information  in  input
45           co-ordinate system
46
47       -c
48           Modify current location projection files
49
50       --help
51           Print usage summary
52
53       --verbose
54           Verbose module output
55
56       --quiet
57           Quiet module output
58
59       --ui
60           Force launching GUI dialog
61
62   Parameters:
63       georef=file
64           Name of georeferenced data file to read projection information from
65
66       wkt=file
67           Name of ASCII file containing a WKT projection description
68           ’-’ for standard input
69
70       proj4=params
71           PROJ.4 projection description
72           ’-’ for standard input
73
74       epsg=code
75           EPSG projection code
76           Options: 1-1000000
77
78       list_codes=string
79           List codes for given authority, e.g. EPSG, and exit
80           Options: EPSG, ESRI, IGNF, OGC, PROJ
81
82       datum=name
83           Datum (overrides any datum specified in input co-ordinate system)
84           Accepts standard GRASS datum codes, or "list" to list and exit
85
86       datum_trans=index
87           Index number of datum transform parameters
88           "0" for unspecified or "-1" to list and exit
89           Options: -1-100
90           Default: 0
91
92       location=name
93           Name of new location to create
94

DESCRIPTION

96       g.proj provides a means of converting a co-ordinate system  description
97       (i.e.  projection  information)  between  various formats.  If compiled
98       without OGR present, the functionality is limited to:
99
100           ·   Reporting the projection information for the current  location,
101               either in conventional GRASS (-p flag) or PROJ (-j flag) format
102
103           ·   Changing the datum, or reporting and modifying the datum trans‐
104               formation parameters, for the current location
105
106       When compiled with OGR, functionality is increased and allows output of
107       the  projection  information  in the Well-Known Text (WKT) format popu‐
108       larised by proprietary GIS. In addition, if one of the parameters  geo‐
109       ref, wkt, proj4 or epsg is specified, rather than the projection infor‐
110       mation being read from the current location  it  is  imported  from  an
111       external source as follows:
112
113       georef=filename
114           g.proj  attempts to invoke GDAL and OGR in turn to read a georefer‐
115           enced file filename. The projection information will be  read  from
116           this  file.  If the file is not georeferenced or cannot be read, XY
117           (unprojected) will be used.
118
119       wkt=filename or -
120           The file filename should contain a projection  description  in  WKT
121           format  with  or  without line-breaks (e.g. a ’.prj’ file). If - is
122           given for the filename, the WKT description will be read from stdin
123           rather than a file.
124
125       proj4=description or -
126           description  should  be  a  projection  description in PROJ format,
127           enclosed in quotation marks if there are any spaces. If - is  given
128           for  description,  the  PROJ  description  will  be read from stdin
129           rather than as a directly-supplied command-line parameter.
130
131       epsg=number
132           number should correspond to the index number of a valid co-ordinate
133           system  in  the  EPSG  database.  EPSG code support is based upon a
134           local copy of the GDAL CSV co-ordinate system and datum information
135           files, stored in the directory $GISBASE/etc/proj/ogr_csv. These can
136           be updated if necessary to support future  revisions  of  the  EPSG
137           database.
138
139       If  datum  information is incorrect or missing in the input co-ordinate
140       system definition (e.g. PROJ descriptions have very limited support for
141       specifying datum names), a GRASS datum abbreviation can instead be sup‐
142       plied using the datum parameter. This will override any datum contained
143       in  the  input co-ordinate system, and discard any datum transformation
144       parameters. Enter datum=list to return a list of all  the  datums  sup‐
145       ported  by  GRASS.  Since  any existing datum transformation parameters
146       will have been discarded, the datumtrans parameter  should  in  general
147       always be used in conjunction with datum.
148
149       The -p, -j, -w, etc. flags are all functional when importing projection
150       information from an external source, meaning that g.proj can be used to
151       convert  between representations of the information. It is not required
152       that either the input or output be in GRASS format.
153
154       In addition however, if the -c flag is specified,  g.proj  will  create
155       new   GRASS   projection   files   (PROJ_INFO,   PROJ_UNITS,  WIND  and
156       DEFAULT_WIND) based on the imported information. If the location param‐
157       eter  is  specified in addition to -c, then a new location will be cre‐
158       ated.  Otherwise the projection information files in the current  loca‐
159       tion will be overwritten. The program will not warn before doing this.
160
161       The  final mode of operation of g.proj is to report on the datum infor‐
162       mation and datum transformation parameters associated with the co-ordi‐
163       nate system. The -d flag will report a human-readable summary of this.
164

NOTES

166       If  the input co-ordinate system contains a datum name but no transfor‐
167       mation parameters, and there is more than one  suitable  parameter  set
168       available  (according to the files datum.table and datumtransform.table
169       in $GISBASE/etc/proj), g.proj will check the value  of  the  datumtrans
170       option and act according to the following:
171       -1:   List  available  parameter  sets  in  a  GUI-parsable  (but  also
172       human-readable) format and exit.
173       0 (default): Continue without specifying parameters - if used when cre‐
174       ating  a  location,  other GRASS modules will use the "default" (likely
175       non-optimum) parameters for this datum if necessary in the future.
176       Any other number less than or equal to the  number  of  parameter  sets
177       available  for  this datum: Choose this parameter set and add it to the
178       co-ordinate system description.
179       If the -t flag is specified, the module  will  attempt  to  change  the
180       datum transformation parameters using one of the above two methods even
181       if a valid parameter set is already specified in the input  co-ordinate
182       system.  This  can  be  useful  to  change the datum information for an
183       existing location.
184
185       Output is simply based on the input projection information. g.proj does
186       not  attempt  to  verify  that  the  co-ordinate  system thus described
187       matches an existing system in use in the  world.  In  particular,  this
188       means there are no EPSG Authority codes in the WKT output.
189
190       WKT format shows the false eastings and northings in the projected unit
191       (e.g. meters, feet) but in PROJ format it should  always  be  given  in
192       meters.
193
194       The  maximum  size of input WKT or PROJ projection descriptions is lim‐
195       ited to 8000 bytes.
196

EXAMPLES

198   Print information
199       Print the projection information for the current location:
200       g.proj -p
201
202       List the possible datum transformation parameters for the current loca‐
203       tion:
204       g.proj -t datumtrans=-1
205
206   Create projection (PRJ) file
207       Create  a ’.prj’ file in ESRI format corresponding to the current loca‐
208       tion:
209       g.proj -wef > irish_grid.prj
210
211   Read projection from file
212       Read the projection information from a GeoTIFF file  and  print  it  in
213       PROJ format:
214       g.proj -jf georef=ASTER_DEM20020508161837.tif
215
216       Convert the PROJ projection description contained in a text file to WKT
217       format:
218       cat proj4.description | g.proj -w proj4=-
219
220   Create new location
221       Create a new location with the co-ordinate system referred to  by  EPSG
222       code  4326  (Latitude-Longitude/WGS84),  without  explicitly specifying
223       datum transformation parameters:
224       g.proj -c epsg=4326 location=latlong
225
226       Create a new location  with  the  co-ordinate  system  referred  to  by
227       ESRI-EPSG code 900913 (Google Mercator Projection)
228       g.proj -c epsg=900913 location=google
229
230       Create  a  new location with the co-ordinate system referred to by EPSG
231       code 29900 (Irish Grid), selecting datum transformation  parameter  set
232       no. 2:
233       # list available datums for EPSG code 29900
234       g.proj -t datumtrans=-1 epsg=29900
235       g.proj -c epsg=29900 datumtrans=2 location=irish_grid
236
237       Create  a  new location with the same co-ordinate system as the current
238       location, but forcing a change to datum  transformation  parameter  set
239       no. 1:
240       g.proj -c location=newloc -t datumtrans=1
241
242       Create a new location with the co-ordinate system from a WKT definition
243       stored in a text file:
244       g.proj -c wkt=irish_grid.prj location=irish_grid
245
246       Create a new location from a PROJ description, explicitly specifying  a
247       datum and using the default datum transformation parameters:
248       g.proj -c location=spain proj4="+proj=utm +zone=30 +ellps=intl" datum=eur50 datumtrans=0
249
250   Using g.proj output for GDAL/OGR tools
251       Reproject  external  raster  map  to current GRASS projection (does not
252       always make sense!)  using the GDAL ’gdalwarp’ tool.  We  recommend  to
253       use the ERDAS/Img format and not to use the ESRI style of WKT:
254       # example for 30x30 pixel resolution (enforce with -tr to avoid odd values)
255       gdalwarp -of HFA -tr 30 30 -t_srs "`g.proj -wf`" aster.img aster_tmerc.img
256
257       Reproject external vector map to current GRASS projection using the OGR
258       ’ogr2ogr’ tool:
259       ogr2ogr -t_srs "`g.proj -wf`" polbnda_italy_GB_ovest.shp polbnda_italy_LL.shp
260

REFERENCES

262       PROJ: Projection/datum support library
263       GDAL raster library and toolset
264       OGR vector library and toolset
265
266       Further reading
267
268           ·   ASPRS Grids and Datum
269
270           ·   MapRef - The Collection of Map Projections and  Reference  Sys‐
271               tems for Europe
272
273           ·   Projections Transform List (PROJ)
274

SEE ALSO

276        m.proj, r.proj, v.proj, r.import, r.in.gdal, v.import, v.in.ogr
277

AUTHOR

279       Paul Kelly
280

SOURCE CODE

282       Available at: g.proj source code (history)
283
284       Main  index | General index | Topics index | Keywords index | Graphical
285       index | Full index
286
287       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
288
289
290
291GRASS 7.8.5                                                          g.proj(1)
Impressum