1g.proj(1)                     Grass 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]     [datum=name]     [datum_trans=index]    [location=name]
18       [--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       datum=name
79           Datum (overrides any datum specified in input co-ordinate system)
80           Accepts standard GRASS datum codes, or "list" to list and exit
81
82       datum_trans=index
83           Index number of datum transform parameters
84           "0" for unspecified or "-1" to list and exit
85           Options: -1-100
86           Default: 0
87
88       location=name
89           Name of new location to create
90

DESCRIPTION

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

NOTES

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

EXAMPLES

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

REFERENCES

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

SEE ALSO

273        m.proj, r.proj, v.proj, r.import, r.in.gdal, v.import, v.in.ogr
274

AUTHOR

276       Paul Kelly
277
278       Last changed: $Date: 2016-05-28 08:54:25 +0200 (Sat, 28 May 2016) $
279

SOURCE CODE

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