@@ -17,27 +17,31 @@ is limited to:
1717
1818When compiled with OGR, functionality is increased and allows output of
1919the CRS information in the Well-Known Text (WKT) format popularised by
20- proprietary GIS . In addition, if one of the parameters * georef* , * wkt* ,
20+ PROJ and GDAL . In addition, if one of the parameters * georef* , * wkt* ,
2121* proj4* or * epsg* is specified, rather than being read from the current
2222project, the CRS information is imported from an external source as
2323follows:
2424
25- - With ** georef** =* filename* g.proj attempts to invoke GDAL and OGR in turn
26- to read a georeferenced file * filename* . The CRS information will be read
27- from this file. If the file is not georeferenced or cannot be read,
28- XY (unprojected) will be used.
25+ georef=* filename*
26+ * g.proj* attempts to invoke GDAL and OGR in turn to read a georeferenced
27+ file * filename* . The CRS information will be read from this file. If the
28+ file is not georeferenced or cannot be read, XY (unprojected) will be
29+ used.
2930
30- - When using ** wkt** =* filename* , the file * filename* should contain a CRS
31- description in WKT format with or without line-breaks (e.g. a '.prj' file).
32- If ** -** is given for the filename, the WKT description will be read from
33- stdin rather than a file.
31+ wkt=* filename* or ** -**
32+ The file * filename* should contain a CRS description in WKT format with
33+ or without line-breaks (e.g. a '.prj' file). If ** -** is given for the
34+ filename, the WKT description will be read from stdin rather than a
35+ file.
3436
35- - ** proj4** =* description* should be a CRS description in [ PROJ] ( https://proj.org/ )
37+ proj4=* description* or ** -**
38+ * description* should be a CRS description in [ PROJ] ( https://proj.org/ )
3639format, enclosed in quotation marks if there are any spaces. If ** -** is
3740given for * description* , the PROJ description will be read from stdin
3841rather than as a directly-supplied command-line parameter.
3942
40- - ** epsg** =* number* should correspond to the index number of a valid co-ordinate
43+ epsg=* number*
44+ * number* should correspond to the index number of a valid co-ordinate
4145system in the [ EPSG database] ( https://epsg.org/search/by-name ) . EPSG
4246code support is based upon a local copy of the GDAL CSV co-ordinate
4347system and datum information files, stored in the directory
@@ -95,14 +99,17 @@ co-ordinate system. This can be useful to change the datum information
9599for an existing project.
96100
97101Output is simply based on the input CRS information. g.proj does ** not**
98- attempt to verify that the co-ordinate system thus described matches an
99- existing system in use in the world. In particular, this means there are
100- no EPSG Authority codes in the WKT output.
102+ attempt to verify that the co-ordinate system thus described matches a
103+ pre-defined existing system in use in the world. In particular, this
104+ means there may be no authority names and codes in the WKT output.
101105
102106WKT format shows the false eastings and northings in the projected unit
103107(e.g. meters, feet) but in PROJ format it should always be given in
104108meters.
105109
110+ PROJJSON format is a JSON version of the WKT format, see the [ PROJJSON
111+ specification] ( https://proj.org/en/stable/specifications/projjson.html )
112+
106113The maximum size of input WKT or PROJ CRS descriptions is limited to
1071148000 bytes.
108115
@@ -116,10 +123,10 @@ Print the CRS information for the current project:
116123g.proj -p
117124```
118125
119- Print the CRS information for the current project in JSON format:
126+ Print the CRS information for the current project in PROJJSON format:
120127
121128``` sh
122- g.proj -p format=json
129+ g.proj -p format=projjson
123130```
124131
125132Print the CRS information for the current project in shell format:
@@ -134,19 +141,12 @@ Print the CRS information for the current project in WKT format:
134141g.proj -p format=wkt
135142```
136143
137- Print the CRS information for the current project in PROJ.4 format:
144+ Print the CRS information for the current project in PROJ.4 format (deprecated) :
138145
139146``` sh
140147g.proj -p format=proj4
141148```
142149
143- List the possible datum transformation parameters for the current
144- project:
145-
146- ``` sh
147- g.proj -t datumtrans=-1
148- ```
149-
150150### Create projection (PRJ) file
151151
152152Create a '.prj' file in ESRI format corresponding to the current
@@ -240,47 +240,13 @@ Reproject external vector map to current GRASS project using the OGR
240240ogr2ogr -t_srs " ` g.proj -wf` " polbnda_italy_GB_ovest.shp polbnda_italy_LL.shp
241241```
242242
243- ### Using g.proj JSON output with pandas
244-
245- Using the CRS information for the current project in JSON format with pandas:
246-
247- ``` python
248- import grass.script as gs
249- import pandas as pd
250-
251- # Run g.proj to get CRS information in JSON format.
252- proj_data = gs.parse_command(" g.proj" , flags = " p" , format = " json" )
253-
254- df = pd.DataFrame.from_dict(proj_data, orient = ' index' )
255- print (df)
256- ```
257-
258- ``` sh
259- 0
260- name Lambert Conformal Conic
261- proj lcc
262- datum nad83
263- a 6378137.0
264- es 0.006694380022900787
265- lat_1 36.16666666666666
266- lat_2 34.33333333333334
267- lat_0 33.75
268- lon_0 -79
269- x_0 609601.22
270- y_0 0
271- no_defs defined
272- unit Meter
273- units Meters
274- meters 1
275- ```
276-
277243## REFERENCES
278244
279245[ PROJ] ( https://proj.org ) : Projection/datum support library
280246[ GDAL raster library and toolset] ( https://gdal.org )
281247[ OGR vector library and toolset] ( https://gdal.org/ )
282248
283- Further reading:
249+ ### Further reading
284250
285251- [ ASPRS Grids and
286252 Datum] ( https://www.asprs.org/asprs-publications/grids-and-datums )
0 commit comments