[GRASS-dev] [GRASS GIS] #3079: shapelib/DBF driver: re-sync to GDAL/OGR needed

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
---------------------------+-------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.2.0
Component: Database | Version: svn-trunk
Keywords: dbf, shapelib | CPU: Unspecified
Platform: Unspecified |
---------------------------+-------------------------
The DBF driver is based on lib/external/shapelib which has been derived
from Shapelib provided through GDAL/OGR (ogr/ogrsf_frmts/).

The last sync was done in 2008, time to update again.

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.2.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by mlennert):

Should this be done before the 7.2 release ?

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------
Changes (by martinl):

* type: defect => task
* milestone: 7.2.0 => 7.4.0

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by mmetz):

Done in trunk r69890. Unfortunately, more fixes were now needed to make it
work outside GDAL, see updated README.

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by rouault):

I've just resync'ed shapelib CVS from GDAL and make various fixes to
compile in standalone mode (likely similar to yours). See
http://lists.maptools.org/pipermail/shapelib/2016-December/000627.html

Looking at r69890, the following is incorrect:
{{{
+#define CPL_IGNORE_RET_VAL_INT(ret_val_int) return
}}}

The purpose of this macro is to make the compiler not warn about the fact
that we don't verify the return value of a function. The correct dummy
implementation should be :
{{{
#define CPL_IGNORE_RET_VAL_INT(x) x
}}}

(see https://trac.osgeo.org/gdal/changeset/36680)

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by mmetz):

Replying to [comment:4 rouault]:
> I've just resync'ed shapelib CVS from GDAL and make various fixes to
compile in standalone mode (likely similar to yours). See
http://lists.maptools.org/pipermail/shapelib/2016-December/000627.html
>
> Looking at r69890, the following is incorrect:
> {{{
> +#define CPL_IGNORE_RET_VAL_INT(ret_val_int) return
> }}}

I noticed that too after comparing GDAL shapelib with standalone shapelib.
CPL_IGNORE_RET_VAL_INT is used only once, so I have already replaced in
r69892

{{{
     CPL_IGNORE_RET_VAL_INT(DBFFlushRecord( psDBF ));
}}}

with
{{{
     DBFFlushRecord( psDBF );
}}}

as in standalone shapelib. Thanks for reviewing the changes!

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by neteler):

The new SHAPELIB 1.4 version is out:

http://lists.maptools.org/pipermail/shapelib/2016-December/000631.html

Time to resync fixes into GRASS GIS or can we get rid of this clone?

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------
Changes (by volter):

* cc: volter (added)

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.4.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by martinl):

Status of this issue is not clear.

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.6.0
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------
Changes (by mmetz):

* milestone: 7.4.2 => 7.6.0

Comment:

Milestone for this ticket should always be trunk.

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

#3079: shapelib/DBF driver: re-sync to GDAL/OGR needed
--------------------------+---------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: task | Status: new
  Priority: major | Milestone: 7.6.2
Component: Database | Version: svn-trunk
Resolution: | Keywords: dbf, shapelib
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------

Comment (by sbl):

Maybe time to drop DBF as supported DB backend in GRASS 8/7.10?

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