[GRASS-dev] [GRASS GIS] #3215: The eval of g.proj -g fails due to white space in projection name string

#3215: The eval of g.proj -g fails due to white space in projection name string
-------------------------+---------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.2.0
Component: LibGIS | Version: svn-releasebranch70
Keywords: g.proj | CPU: Unspecified
Platform: Unspecified |
-------------------------+---------------------------------
Shell parsing of g.proj -g output fails:

{{{
# test case:
GRASS 7.2.0svn (nc_spm_08_grass7):~ > g.proj -g
name=Lambert Conformal Conic
proj=lcc
datum=nad83
a=6378137.0
es=0.006694380022900787
lat_1=36.16666666666666
lat_2=34.33333333333334
lat_0=33.75
lon_0=-79
x_0=609601.22
y_0=0
no_defs=defined
epsg=3358
unit=Meter
units=Meters
meters=1

eval `g.proj -g`
bash: Conformal: command not found
}}}

Quoting of the "name" key of the proj4 struct is needed in
general/g.proj/output.c but I don't know how to implement that properly.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215&gt;
GRASS GIS <https://grass.osgeo.org>

#3215: The eval of g.proj -g fails due to white space in projection name string
--------------------------+---------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: LibGIS | Version: svn-releasebranch70
Resolution: | Keywords: g.proj
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Changes (by martinl):

* Attachment "g-proj-quote.diff" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215&gt;
GRASS GIS <https://grass.osgeo.org>

#3215: The eval of g.proj -g fails due to white space in projection name string
--------------------------+---------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: LibGIS | Version: svn-releasebranch70
Resolution: | Keywords: g.proj
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by martinl):

Please try out attachment:g-proj-quote.diff, are there any other items
which could contain spaces?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3215: The eval of g.proj -g fails due to white space in projection name string
--------------------------+---------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: LibGIS | Version: svn-releasebranch70
Resolution: | Keywords: g.proj
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by neteler):

Works, thanks for the NRT patch :slight_smile:

According to lib/gis/units.c there might be some units like FOOT US and
more.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3215: The eval of g.proj -g fails due to white space in projection name string
--------------------------+---------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.1
Component: LibGIS | Version: svn-releasebranch70
Resolution: | Keywords: g.proj
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by mlennert):

What is the status of this ticket ? Can the patch be applied ?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3215: The eval of g.proj -g fails due to white space in projection name string
--------------------------+---------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.6.2
Component: LibGIS | Version: svn-releasebranch70
Resolution: | Keywords: g.proj
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Changes (by neteler):

* milestone: 7.2.4 => 7.6.2

Comment:

@MartinL: please apply the patch to trunk

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3215#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>