[GRASS-dev] [GRASS GIS] #2456: read cvs from GDAL data directory

#2456: read cvs from GDAL data directory
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Currently GRASS contains copy of several CVS files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS libraries
to read these files dynamically.

Any comments?

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

#2456: read CSV from GDAL data directory
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Description changed by martinl:

Old description:

Currently GRASS contains copy of several CVS files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS
libraries to read these files dynamically.

Any comments?

New description:

Currently GRASS contains copy of several CSV files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS libraries
to read these files dynamically.

Any comments?

--

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

+1

On Oct 20, 2014 10:18 PM, “GRASS GIS” <trac@osgeo.org> wrote:

#2456: read CSV from GDAL data directory
-------------------------±-------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
Type: task | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: unspecified
Keywords: gdal | Platform: Unspecified
Cpu: Unspecified |
-------------------------±-------------------------------------------------
Description changed by martinl:

Old description:

Currently GRASS contains copy of several CVS files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS
libraries to read these files dynamically.

Any comments?

New description:

Currently GRASS contains copy of several CSV files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS libraries
to read these files dynamically.

Any comments?


Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:1>
GRASS GIS <http://grass.osgeo.org>


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Changes (by neteler):

  * priority: normal => critical
  * component: Default => Projections/Datums

Comment:

Yes, this would be very important.

The local GDAL data directory is found like this:

{{{
ls `gdal-config --datadir`
}}}

Effectively it shows the path to "GDAL_DATA", see
  * http://trac.osgeo.org/gdal/wiki/ConfigOptions#GDAL_DATA
  *
http://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#WhatisGDAL_DATAenvironmentvariable

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

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by martinl):

For record list of affected files:

  * coordinate_axis.csv
  * ellipsoid.csv
  * gcs.csv
  * gcs.override.csv
  * gdal_datum.csv
  * gt_datum.csv
  * gt_ellips.csv
  * pcs.csv
  * pcs.override.csv
  * prime_meridian.csv
  * projop_wparm.csv
  * stateplane.csv
  * unit_of_measure.csv

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by hellik):

Replying to [ticket:2456 martinl]:
> Currently GRASS contains copy of several CSV files from GDAL
source:grass/trunk/lib/proj. It would make sense to modify GRASS libraries
to read these files dynamically.
>
> Any comments?

AFAIU winGRASS does it already(?)

e.g.

C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\env.bat

{{{
set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-7.1.svn
REM set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe

set GRASS_HTML_BROWSER=explorer

set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python27

set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set GEOTIFF_CSV=%OSGEO4W_ROOT%\share\epsg_csv

set PATH=%OSGEO4W_ROOT%\apps\msys\bin;%PATH%
}}}

but there is also

C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\proj

{{{
datum.table
datumtransform.table
desc.table
ellipse.table
ellipse.table.solar.system
FIPS.code
nad
ogr_csv
parms.table
projections
state27
state83
units.table
}}}

and C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\proj\ogr_csv

{{{
coordinate_axis.csv
ellipsoid.csv
gcs.csv
gcs.override.csv
gdal_datum.csv
gt_datum.csv
gt_ellips.csv
pcs.csv
pcs.override.csv
prime_meridian.csv
projop_wparm.csv
stateplane.csv
unit_of_measure.csv
}}}

and C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\proj\nad

{{{
alaska
conus
FL
hawaii
MD
prvi
src
stgeorge
stlrnc
stpaul
TN
WI
WO
}}}

and C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\proj\nad\src

{{{
alaska.lla
conus.lla
FL.lla
hawaii.lla
MD.lla
prvi.lla
stgeorge.lla
stlrnc.lla
stpaul.lla
TN.lla
WI.lla
WO.lla
}}}

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

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by martinl):

Replying to [comment:4 hellik]:

{{{
> set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
}}}

yes, but it has no effect, GRASS still uses local copies
source:grass/trunk/lib/proj/convert.c#L718

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by martinl):

Replying to [comment:3 martinl]:
> For record list of affected files:
> * pcs.csv

The attached patch attachment:gdal_data.diff forces GRASS to use CSV files
from GDAL. First found problem:

GRASS defines 5514 as

{{{
pcs.csv:5514,"S-JTSK / Krovak East
North",9001,4818,19952,9819,1,0,6501,8806,0,9001,8807,0,9001,8811,49.3,9110,8813,30.1717303,9110,8818,78.3,9110,8819,0.9999,9201,8833,42.3,9110
}}}

->

{{{
g.proj epsg=5514 -p
-PROJ_INFO-------------------------------------------------
name : Krovak
proj : krovak
datum : hermannskogel
ellps : bessel
lat_0 : 49.5
lon_0 : 42.5
alpha : 30.28813972222222
k : 0.9999
x_0 : 0
y_0 : 0
pm : ferro
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1
}}}

GDAL as

{{{
pcs.csv:5514,"S-JTSK / Krovak East
North",9001,4156,5510,1041,1,0,4499,1036,30.1717303,9110,8806,0,9001,8807,0,9001,8811,49.3,9110,8818,78.3,9110,8819,0.9999,9201,8833,24.5,9110
}}}

->

{{{
.proj epsg=5514 -p
-PROJ_INFO-------------------------------------------------
name : Krovak
proj : krovak
ellps : bessel
lat_0 : 49.5
lon_0 : 24.83333333333333
alpha : 30.28813972222222
k : 0.9999
x_0 : 0
y_0 : 0
towgs84 : 589,76,480,0,0,0,0
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1
}}}

The `wgs84` causes that

{{{
g.proj epsg=5514 datum_trans=-1
ERROR: No output format specified, define one of flags -p, -g, -j, or -w
}}}

will not work.

Should be:

{{{
g.proj epsg=5514 datum_trans=-1
---
1
Used in whole hermannskogel region
towgs84=653.000,-212.000,449.000
Default 3-Parameter Transformation (May not be optimum for older datums;
use this only if no more appropriate options are available.)
---
2
Used in Austria
towgs84=577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232
Accuracy approx. 1.5m
---
3
Used in Czech Republic
towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56

---
4
Used in Slovakia
towgs84=485.021,169.465,483.839,7.786342,4.397554,4.102655,0

---
5
Used in Slovenia
towgs84=426.9,142.6,460.1,4.91,4.49,-12.42,17.1
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by martinl):

Replying to [comment:6 martinl]:

> The attached patch attachment:gdal_data.diff forces GRASS to use CSV
files from GDAL. First found problem:

attachment:gdal_data.diff.gz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 7.1.0
Component: Projections/Datums | Version: unspecified
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by neteler):

Here some "historical" notes to better understand the actual concept in
GDAL:

  * http://fwarmerdam.blogspot.it/2010/03/in-last-few-weeks-i-believe-i
-have-made.html
  * Paul Kelly's comments: http://lists.osgeo.org/pipermail/grass-
dev/2010-March/049674.html

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2456#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#2456: read CSV from GDAL data directory
--------------------------------+-------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: task | Status: new
Priority: blocker | Milestone: 7.1.0
Component: Projections/Datums | Version: svn-releasebranch70
Keywords: gdal | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Changes (by neteler):

  * priority: critical => blocker
  * version: unspecified => svn-releasebranch70

Comment:

We need to solve this, promoting it to blocker.

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