1g.proj(1) Grass User's Manual g.proj(1)
2
3
4
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
11 general, projection, create location
12
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
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.4 (-j flag) for‐
102 mat
103
104 · Changing the datum, or reporting and modifying the datum trans‐
105 formation parameters, for the current location
106
107 When compiled with OGR, functionality is increased and allows output of
108 the projection information in the Well-Known Text (WKT) format popu‐
109 larised by proprietary GIS. In addition, if one of the parameters geo‐
110 ref, wkt, proj4 or epsg is specified, rather than the projection infor‐
111 mation being read from the current location it is imported from an
112 external source as follows:
113
114 georef=filename
115 g.proj attempts to invoke GDAL and OGR in turn to read a georefer‐
116 enced file filename. The projection information will be read from
117 this file. If the file is not georeferenced or cannot be read, XY
118 (unprojected) will be used.
119
120 wkt=filename or -
121 The file filename should contain a projection description in WKT
122 format with or without line-breaks (e.g. a ’.prj’ file). If - is
123 given for the filename, the WKT description will be read from stdin
124 rather than a file.
125
126 proj4=description or -
127 description should be a projection description in PROJ.4 format,
128 enclosed in quotation marks if there are any spaces. If - is given
129 for description, the PROJ.4 description will be read from stdin
130 rather than as a directly-supplied command-line parameter.
131
132 epsg=number
133 number should correspond to the index number of a valid co-ordinate
134 system in the EPSG database. EPSG code support is based upon a
135 local copy of the GDAL CSV co-ordinate system and datum information
136 files, stored in the directory $GISBASE/etc/proj/ogr_csv. These can
137 be updated if necessary to support future revisions of the EPSG
138 database.
139
140 If datum information is incorrect or missing in the input co-ordinate
141 system definition (e.g. PROJ.4 descriptions have very limited support
142 for specifying datum names), a GRASS datum abbreviation can instead be
143 supplied using the datum parameter. This will override any datum con‐
144 tained in the input co-ordinate system, and discard any datum transfor‐
145 mation parameters. Enter datum=list to return a list of all the datums
146 supported by GRASS. Since any existing datum transformation parameters
147 will have been discarded, the datumtrans parameter should in general
148 always be used in conjunction with datum.
149
150 The -p, -j, -w, etc. flags are all functional when importing projection
151 information from an external source, meaning that g.proj can be used to
152 convert between representations of the information. It is not required
153 that either the input or output be in GRASS format.
154
155 In addition however, if the -c flag is specified, g.proj will create
156 new GRASS projection files (PROJ_INFO, PROJ_UNITS, WIND and
157 DEFAULT_WIND) based on the imported information. If the location param‐
158 eter is specified in addition to -c, then a new location will be cre‐
159 ated. Otherwise the projection information files in the current loca‐
160 tion will be overwritten. The program will not warn before doing this.
161
162 The final mode of operation of g.proj is to report on the datum infor‐
163 mation and datum transformation parameters associated with the co-ordi‐
164 nate system. The -d flag will report a human-readable summary of this.
165
167 If the input co-ordinate system contains a datum name but no transfor‐
168 mation parameters, and there is more than one suitable parameter set
169 available (according to the files datum.table and datumtransform.table
170 in $GISBASE/etc/proj), g.proj will check the value of the datumtrans
171 option and act according to the following:
172 -1: List available parameter sets in a GUI-parsable (but also
173 human-readable) format and exit.
174 0 (default): Continue without specifying parameters - if used when cre‐
175 ating a location, other GRASS modules will use the "default" (likely
176 non-optimum) parameters for this datum if necessary in the future.
177 Any other number less than or equal to the number of parameter sets
178 available for this datum: Choose this parameter set and add it to the
179 co-ordinate system description.
180 If the -t flag is specified, the module will attempt to change the
181 datum transformation parameters using one of the above two methods even
182 if a valid parameter set is already specified in the input co-ordinate
183 system. This can be useful to change the datum information for an
184 existing location.
185
186 Output is simply based on the input projection information. g.proj does
187 not attempt to verify that the co-ordinate system thus described
188 matches an existing system in use in the world. In particular, this
189 means there are no EPSG Authority codes in the WKT output.
190
191 WKT format shows the false eastings and northings in the projected unit
192 (e.g. meters, feet) but in PROJ format it should always be given in
193 meters.
194
195 The maximum size of input WKT or PROJ.4 projection descriptions is lim‐
196 ited to 8000 bytes.
197
199 Print information
200 Print the projection information for the current location:
201 g.proj -p
202
203 List the possible datum transformation parameters for the current loca‐
204 tion:
205 g.proj -t datumtrans=-1
206
207 Create projection (PRJ) file
208 Create a ’.prj’ file in ESRI format corresponding to the current loca‐
209 tion:
210 g.proj -wef > irish_grid.prj
211
212 Read projection from file
213 Read the projection information from a GeoTIFF file and print it in
214 PROJ.4 format:
215 g.proj -jf georef=ASTER_DEM20020508161837.tif
216
217 Convert the PROJ.4 projection description contained in a text file to
218 WKT format:
219 cat proj4.description | g.proj -w proj4=-
220
221 Create new location
222 Create a new location with the co-ordinate system referred to by EPSG
223 code 4326 (Latitude-Longitude/WGS84), without explicitly specifying
224 datum transformation parameters:
225 g.proj -c epsg=4326 location=latlong
226
227 Create a new location with the co-ordinate system referred to by
228 ESRI-EPSG code 900913 (Google Mercator Projection)
229 g.proj -c epsg=900913 location=google
230
231 Create a new location with the co-ordinate system referred to by EPSG
232 code 29900 (Irish Grid), selecting datum transformation parameter set
233 no. 2:
234 # list available datums for EPSG code 29900
235 g.proj -t datumtrans=-1 epsg=29900
236 g.proj -c epsg=29900 datumtrans=2 location=irish_grid
237
238 Create a new location with the same co-ordinate system as the current
239 location, but forcing a change to datum transformation parameter set
240 no. 1:
241 g.proj -c location=newloc -t datumtrans=1
242
243 Create a new location with the co-ordinate system from a WKT definition
244 stored in a text file:
245 g.proj -c wkt=irish_grid.prj location=irish_grid
246
247 Create a new location from a PROJ.4 description, explicitly specifying
248 a datum and using the default datum transformation parameters:
249 g.proj -c location=spain proj4="+proj=utm +zone=30 +ellps=intl" datum=eur50 datumtrans=0
250
251 Using g.proj output for GDAL/OGR tools
252 Reproject external raster map to current GRASS projection (does not
253 always make sense!) using the GDAL ’gdalwarp’ tool. We recommend to
254 use the ERDAS/Img format and not to use the ESRI style of WKT:
255 # example for 30x30 pixel resolution (enforce with -tr to avoid odd values)
256 gdalwarp -of HFA -tr 30 30 -t_srs "`g.proj -wf`" aster.img aster_tmerc.img
257
258 Reproject external vector map to current GRASS projection using the OGR
259 ’ogr2ogr’ tool:
260 ogr2ogr -t_srs "`g.proj -wf`" polbnda_italy_GB_ovest.shp polbnda_italy_LL.shp
261
263 PROJ 4: Projection/datum support library
264 GDAL raster library and toolset
265 OGR vector library and toolset
266
267 Further reading
268
269 · ASPRS Grids and Datum
270
271 · MapRef - The Collection of Map Projections and Reference Sys‐
272 tems for Europe
273
274 · Projections Transform List (PROJ4)
275
277 m.proj, r.proj, v.proj, r.import, r.in.gdal, v.import, v.in.ogr
278
280 Paul Kelly
281
283 Available at: g.proj source code (history)
284
285 Main index | General index | Topics index | Keywords index | Graphical
286 index | Full index
287
288 © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
289
290
291
292GRASS 7.8.2 g.proj(1)