[Git][debian-gis-team/gdal-grass][ubuntu/trusty] 119 commits: Update Vcs-* URLs to use HTTPS.

Sebastiaan Couwenberg gitlab at salsa.debian.org
Sun Jan 28 19:24:34 UTC 2018


Sebastiaan Couwenberg pushed to branch ubuntu/trusty at Debian GIS Project / gdal-grass


Commits:
7d947d3c by Bas Couwenberg at 2016-01-24T20:14:04+01:00
Update Vcs-* URLs to use HTTPS.

- - - - -
a2310d62 by Bas Couwenberg at 2016-02-06T15:58:41+01:00
Merge branch 'master' into experimental

Conflicts:
	debian/control

- - - - -
028545e5 by Bas Couwenberg at 2016-02-06T16:16:17+01:00
Merge tag 'upstream/1.11.4' into experimental

Upstream version 1.11.4

- - - - -
e50e1be1 by Bas Couwenberg at 2016-02-06T16:18:07+01:00
New upstream release.

- - - - -
d9863bf9 by Bas Couwenberg at 2016-02-06T16:19:14+01:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
b53425a9 by Bas Couwenberg at 2016-02-07T14:24:30+01:00
Bump Standards-Version to 3.9.7, no changes.

- - - - -
0775b1b9 by Bas Couwenberg at 2016-07-04T02:18:49+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
f3c5b03e by Bas Couwenberg at 2016-07-04T02:21:45+02:00
Imported Upstream version 2.1.1~rc1
- - - - -
32fcb7ed by Bas Couwenberg at 2016-07-04T02:21:47+02:00
Merge tag 'upstream/2.1.1_rc1' into experimental-2.1

Upstream version 2.1.1~rc1

- - - - -
17ee22e3 by Bas Couwenberg at 2016-07-04T02:25:48+02:00
New upstream release candidate.

- - - - -
4c364696 by Bas Couwenberg at 2016-07-04T22:04:34+02:00
Move control file generation to separate templates target.

- - - - -
5fc618d5 by Bas Couwenberg at 2016-07-04T22:04:34+02:00
Set distribution to experimental.

- - - - -
f172992b by Bas Couwenberg at 2016-07-13T11:23:50+02:00
Imported Upstream version 2.1.1
- - - - -
ab1b3130 by Bas Couwenberg at 2016-07-13T11:23:51+02:00
Merge tag 'upstream/2.1.1' into experimental-2.1

Upstream version 2.1.1

- - - - -
559f6035 by Bas Couwenberg at 2016-07-13T11:26:09+02:00
New upstream release.

- - - - -
6a3264de by Bas Couwenberg at 2016-07-13T11:26:26+02:00
Update watch file to use HTTPS for trac.osgeo.org.

- - - - -
8634159e by Bas Couwenberg at 2016-07-13T12:11:43+02:00
Set distribution to experimental.

- - - - -
f4f851cc by Bas Couwenberg at 2016-07-13T16:29:04+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit 0775b1b933e6aa86f7d752d600f0c8ce07b9ef56.

- - - - -
208cea96 by Bas Couwenberg at 2016-07-13T16:30:08+02:00
Move from experimental to unstable.

- - - - -
7ab7f546 by Bas Couwenberg at 2016-08-06T21:38:33+02:00
Add metapackage to pull in the version specific binary package.

- - - - -
c61b6ef6 by Bas Couwenberg at 2016-08-06T23:04:36+02:00
Set distribution to experimental.

- - - - -
c5e25344 by Bas Couwenberg at 2016-08-10T15:04:19+02:00
Move from experimental to unstable.

- - - - -
cca9c46f by Bas Couwenberg at 2016-10-02T22:30:06+02:00
Bump minimum GRASS version to 7.0.5.

- - - - -
226cf23a by Bas Couwenberg at 2016-10-02T22:30:38+02:00
Set distribution to unstable.

- - - - -
901891f2 by Bas Couwenberg at 2016-10-14T18:22:20+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
31ed6790 by Bas Couwenberg at 2016-10-14T18:23:58+02:00
Imported Upstream version 2.1.2~rc1
- - - - -
47274566 by Bas Couwenberg at 2016-10-14T18:23:59+02:00
Merge tag 'upstream/2.1.2_rc1' into experimental-2.1

Upstream version 2.1.2~rc1

- - - - -
b925818e by Bas Couwenberg at 2016-10-14T18:26:32+02:00
New upstream release candidate.

- - - - -
c145dd01 by Bas Couwenberg at 2016-10-14T19:40:36+02:00
Set distribution to experimental.

- - - - -
f42c6ce3 by Bas Couwenberg at 2016-10-27T20:16:22+02:00
Merge tag 'upstream/2.1.2' into experimental-2.1

Upstream version 2.1.2

- - - - -
90bcbaf2 by Bas Couwenberg at 2016-10-27T20:16:22+02:00
Imported Upstream version 2.1.2
- - - - -
32234921 by Bas Couwenberg at 2016-10-27T20:16:56+02:00
New upstream release.

- - - - -
f91f059e by Bas Couwenberg at 2016-10-27T20:20:25+02:00
Set distribution to experimental.

- - - - -
f37766ac by Bas Couwenberg at 2016-10-28T00:06:36+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
ba75d226 by Bas Couwenberg at 2016-10-28T00:08:22+02:00
Move from experimental to unstable.

- - - - -
f20a4423 by Bas Couwenberg at 2016-10-28T16:20:40+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
80af2292 by Bas Couwenberg at 2016-10-28T16:22:11+02:00
Bump minimum GRASS version to 7.2.0~rc1.

- - - - -
a813793a by Bas Couwenberg at 2016-10-28T16:30:30+02:00
Set distribution to experimental.

- - - - -
caeca5d1 by Bas Couwenberg at 2016-12-28T19:44:40+01:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit f20a442352648d6101cdaf909b5e7f59d66dbc95.

- - - - -
1260020c by Bas Couwenberg at 2016-12-28T19:45:48+01:00
Bump minimum GRASS version to 7.2.0.

- - - - -
5281bf4a by Bas Couwenberg at 2016-12-28T19:46:43+01:00
Set distribution to unstable.

- - - - -
c6b0b81c by Bas Couwenberg at 2017-01-16T19:14:50+01:00
Update rpath patch for GRASS 7.2.

- - - - -
1e6bfaac by Bas Couwenberg at 2017-01-16T19:15:29+01:00
Set distribution to unstable.

- - - - -
112a2f56 by Bas Couwenberg at 2017-01-17T01:50:19+01:00
Add patch to link GRASS 7.2 libraries.

- - - - -
4b65e8e6 by Bas Couwenberg at 2017-01-17T01:50:34+01:00
Set distribution to unstable.

- - - - -
9b9444db by Bas Couwenberg at 2017-01-17T09:03:38+01:00
Mark grass72.patch as Applied-Upstream.

- - - - -
86e95e08 by Bas Couwenberg at 2017-01-20T10:38:46+01:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
1591ed69 by Bas Couwenberg at 2017-01-20T10:39:07+01:00
Imported Upstream version 2.1.3~rc1
- - - - -
0f4b2a9c by Bas Couwenberg at 2017-01-20T10:39:08+01:00
Merge tag 'upstream/2.1.3_rc1' into experimental-2.1

Upstream version 2.1.3~rc1

- - - - -
245a6d9d by Bas Couwenberg at 2017-01-20T10:43:35+01:00
New upstream release candidate.

- - - - -
83f6ba74 by Bas Couwenberg at 2017-01-20T10:44:32+01:00
Drop grass72.patch, applied upstream. Refresh remaining patch.

- - - - -
1e4a3c7e by Bas Couwenberg at 2017-01-20T11:41:35+01:00
Set distribution to experimental.

- - - - -
aa6f8a68 by Bas Couwenberg at 2017-01-21T12:15:15+01:00
Rename library package to libgdal-grass, drop now obsolete metapackage.

- - - - -
e1fa5013 by Bas Couwenberg at 2017-01-21T12:20:31+01:00
Set distribution to experimental.

- - - - -
f9fb5f0b by Bas Couwenberg at 2017-01-26T21:10:58+01:00
Add Breaks/Replaces for old version specific binary packages.

- - - - -
ea211461 by Bas Couwenberg at 2017-01-26T21:11:20+01:00
Set distribution to experimental.

- - - - -
d114d98e by Bas Couwenberg at 2017-01-27T13:10:30+01:00
Imported Upstream version 2.1.3
- - - - -
e241a13f by Bas Couwenberg at 2017-01-27T13:10:31+01:00
Merge tag 'upstream/2.1.3' into experimental-2.1

Upstream version 2.1.3

- - - - -
67a241c3 by Bas Couwenberg at 2017-01-27T13:12:10+01:00
New upstream release.

- - - - -
2be83a53 by Bas Couwenberg at 2017-01-27T13:12:25+01:00
Set distribution to experimental.

- - - - -
9cbed33b by Bas Couwenberg at 2017-04-02T23:43:10+02:00
Enable PIE hardening flags.

- - - - -
1d56cec0 by Bas Couwenberg at 2017-04-02T23:43:34+02:00
Set distribution to unstable.

- - - - -
3e81a618 by Bas Couwenberg at 2017-04-03T01:18:36+02:00
Merge branch 'experimental-2.1' into experimental

Conflicts:
	debian/changelog
	debian/control
	debian/control.in
	debian/gbp.conf
	debian/libgdal1-1.11.4-grass.lintian-overrides

- - - - -
b27fd996 by Bas Couwenberg at 2017-04-03T01:20:59+02:00
Merge tag 'debian/2.1.2-5' into experimental

Conflicts:
	debian/changelog

- - - - -
0735fb84 by Bas Couwenberg at 2017-04-03T01:22:01+02:00
Merge changes from libgdal-grass (2.1.2-5).

- - - - -
da1079cb by Bas Couwenberg at 2017-04-03T01:22:36+02:00
Set distribution to experimental.

- - - - -
6fe5c244 by Bas Couwenberg at 2017-04-14T17:14:58+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
657d90a9 by Bas Couwenberg at 2017-04-14T17:22:32+02:00
Merge tag 'upstream/2.2.0_beta1' into experimental-2.2

Upstream version 2.2.0~beta1

- - - - -
2757bea2 by Bas Couwenberg at 2017-04-14T17:22:32+02:00
Imported Upstream version 2.2.0~beta1
- - - - -
ca66ed93 by Bas Couwenberg at 2017-04-14T17:24:44+02:00
New upstream beta release.

- - - - -
3a3bc1a0 by Bas Couwenberg at 2017-04-15T12:17:41+02:00
Drop Breaks/Replaces for old binary packages, 2.2 subdirectory now used.

- - - - -
d77917b9 by Bas Couwenberg at 2017-04-15T12:17:57+02:00
Set distribution to experimental.

- - - - -
41a727cb by Bas Couwenberg at 2017-04-23T16:09:55+02:00
Imported Upstream version 2.2.0~beta2
- - - - -
0950a611 by Bas Couwenberg at 2017-04-23T16:09:56+02:00
Merge tag 'upstream/2.2.0_beta2' into experimental-2.2

Upstream version 2.2.0~beta2

- - - - -
0cb4f0fc by Bas Couwenberg at 2017-04-23T16:10:45+02:00
New upstream beta release.

- - - - -
7b610174 by Bas Couwenberg at 2017-04-28T18:45:49+02:00
Imported Upstream version 2.2.0~rc1
- - - - -
22bb8f12 by Bas Couwenberg at 2017-04-28T18:45:51+02:00
Merge tag 'upstream/2.2.0_rc1' into experimental-2.2

Upstream version 2.2.0~rc1

- - - - -
d2f66871 by Bas Couwenberg at 2017-04-28T18:46:25+02:00
New upstream release candidate.

- - - - -
e66d553c by Bas Couwenberg at 2017-05-03T19:02:13+02:00
Bump minimum GRASS version to 7.2.1.

- - - - -
5d379bbc by Bas Couwenberg at 2017-05-09T18:22:57+02:00
Imported Upstream version 2.2.0
- - - - -
2026ac3c by Bas Couwenberg at 2017-05-09T18:22:58+02:00
Merge tag 'upstream/2.2.0' into experimental-2.2

Upstream version 2.2.0

- - - - -
3e3cfe3b by Bas Couwenberg at 2017-05-09T18:23:50+02:00
New upstream release.

- - - - -
f8d80531 by Bas Couwenberg at 2017-05-09T18:24:21+02:00
Set distribution to experimental.

- - - - -
3ceb4361 by Bas Couwenberg at 2017-06-04T19:49:51+02:00
Disable PIE on Ubuntu where it's still problematic.

- - - - -
ad6ba111 by Bas Couwenberg at 2017-06-18T19:45:11+02:00
Bump minimum GRASS version to 7.2.1.

- - - - -
ae6eeea6 by Bas Couwenberg at 2017-06-18T19:46:07+02:00
Bump Standards-Version to 4.0.0, no changes.

- - - - -
3ca0e20e by Bas Couwenberg at 2017-06-18T19:46:33+02:00
Add autopkgtest to test installability.

- - - - -
89d602bd by Bas Couwenberg at 2017-06-18T19:46:44+02:00
Set distribution to unstable.

- - - - -
7b98dcac by Bas Couwenberg at 2017-06-18T19:47:45+02:00
Bump Standards-Version to 4.0.0, no changes.

- - - - -
e2bc8d99 by Bas Couwenberg at 2017-06-18T19:48:02+02:00
Add autopkgtest to test installability.

- - - - -
bec5ab81 by Bas Couwenberg at 2017-06-23T17:05:37+02:00
New upstream version 2.2.1~rc1
- - - - -
cef8c0ab by Bas Couwenberg at 2017-06-23T17:05:40+02:00
Merge tag 'upstream/2.2.1_rc1' into experimental-2.2

Upstream version 2.2.1~rc1

- - - - -
eaf2a979 by Bas Couwenberg at 2017-06-23T17:06:29+02:00
New upstream release candidate.

- - - - -
4a67dd4f by Bas Couwenberg at 2017-06-23T17:07:47+02:00
Set distribution to experimental.

- - - - -
e40aa7c9 by Bas Couwenberg at 2017-06-30T13:01:37+02:00
New upstream version 2.2.1
- - - - -
2121f57d by Bas Couwenberg at 2017-06-30T13:01:38+02:00
Merge tag 'upstream/2.2.1' into experimental-2.2

Upstream version 2.2.1

- - - - -
518194d2 by Bas Couwenberg at 2017-06-30T13:02:04+02:00
New upstream release.

- - - - -
e44027e2 by Bas Couwenberg at 2017-06-30T15:05:09+02:00
Set distribution to experimental.

- - - - -
0dd596ff by Bas Couwenberg at 2017-07-10T18:29:50+02:00
Merge branch 'experimental-2.2'

- - - - -
41f679b5 by Bas Couwenberg at 2017-07-10T18:30:30+02:00
Update branches in gbp.conf.

- - - - -
bb85e13b by Bas Couwenberg at 2017-07-10T18:31:14+02:00
Move from experimental to unstable.

- - - - -
0f490f69 by Bas Couwenberg at 2017-09-16T02:14:07+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
e8fa17cf by Bas Couwenberg at 2017-09-16T02:18:00+02:00
New upstream version 2.2.2~rc1
- - - - -
5667dfca by Bas Couwenberg at 2017-09-16T02:18:02+02:00
Merge tag 'upstream/2.2.2_rc1' into experimental-2.2

Upstream version 2.2.2~rc1

- - - - -
5f45ac51 by Bas Couwenberg at 2017-09-16T02:21:42+02:00
New upstream release candidate.

- - - - -
2c70dd43 by Bas Couwenberg at 2017-09-16T02:22:11+02:00
Set distribution to experimental.

- - - - -
c04ce2ce by Bas Couwenberg at 2017-09-16T17:14:15+02:00
Bump minimum GRASS version to 7.2.2.

- - - - -
c479ce24 by Bas Couwenberg at 2017-09-16T17:14:19+02:00
Set distribution to unstable.

- - - - -
e7821d91 by Bas Couwenberg at 2017-09-16T17:34:38+02:00
Merge tag 'debian/2.2.1-2' into experimental-2.2

- - - - -
da8dda89 by Bas Couwenberg at 2017-09-22T15:04:14+02:00
Bump Standards-Version to 4.1.0, no changes.

- - - - -
7932c3ee by Bas Couwenberg at 2017-09-22T15:06:24+02:00
New upstream version 2.2.2
- - - - -
e6c97071 by Bas Couwenberg at 2017-09-22T15:06:26+02:00
Merge tag 'upstream/2.2.2' into experimental-2.2

Upstream version 2.2.2

- - - - -
f8a54574 by Bas Couwenberg at 2017-09-22T15:06:52+02:00
New upstream release.

- - - - -
4eb8e304 by Bas Couwenberg at 2017-09-22T15:07:20+02:00
Bump Standards-Version in control.in too.

- - - - -
6742682b by Bas Couwenberg at 2017-09-22T15:07:46+02:00
Set distribution to experimental.

- - - - -
db4898e4 by Bas Couwenberg at 2017-10-02T12:47:09+02:00
Bump Standards-Version to 4.1.1, no changes.

- - - - -
d7a79977 by Bas Couwenberg at 2017-10-03T20:01:53+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit 0f490f69628dae2144359ef925ecfd8513eade98.

- - - - -
73e208e1 by Bas Couwenberg at 2017-10-03T20:02:46+02:00
Set distribution to unstable.

- - - - -
8cfef0c0 by Martin Landa at 2018-01-28T20:22:22+01:00
Rebuild 2.2.2 for trusty

- - - - -


21 changed files:

- Makefile.in
- README
- VERSION
- aclocal.m4
- configure
- configure.in
- debian/changelog
- debian/control
- debian/control.in
- − debian/libgdal20-2.1.0-grass.lintian-overrides
- debian/lintian-overrides
- − debian/patches/grass72.patch
- debian/patches/rpath
- debian/patches/series
- debian/rules
- + debian/tests/control
- grass57dataset.cpp
- ogrgrass.h
- ogrgrassdatasource.cpp
- ogrgrassdriver.cpp
- ogrgrasslayer.cpp


Changes:

=====================================
Makefile.in
=====================================
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,8 +14,6 @@ LD_SHARED	=	@LD_SHARED@
 
 LIBS	=	@LIBS@
 
-GRASSTABLES_DIR = @prefix@/share/gdal/grass
-
 AUTOLOAD_DIR	=	@AUTOLOAD_DIR@
 
 GLIBNAME =	gdal_GRASS.so
@@ -27,17 +25,6 @@ install:	default
 	install -d $(AUTOLOAD_DIR)
 	cp $(GLIBNAME) $(AUTOLOAD_DIR)
 	cp $(OLIBNAME) $(AUTOLOAD_DIR)
-	test -d ${GRASSTABLES_DIR} || mkdir ${GRASSTABLES_DIR}
-	test -d ${GRASSTABLES_DIR}/etc || mkdir ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/ellipse.table || cp @GRASS_GISBASE@/etc/ellipse.table ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/datum.table || cp @GRASS_GISBASE@/etc/datum.table ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/datumtransform.table || cp @GRASS_GISBASE@/etc/datumtransform.table ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/proj/ellipse.table || cp @GRASS_GISBASE@/etc/proj/ellipse.table ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/proj/datum.table || cp @GRASS_GISBASE@/etc/proj/datum.table ${GRASSTABLES_DIR}/etc
-	test ! -e @GRASS_GISBASE@/etc/proj/datumtransform.table || cp @GRASS_GISBASE@/etc/proj/datumtransform.table ${GRASSTABLES_DIR}/etc
-	test -d ${GRASSTABLES_DIR}/driver || mkdir ${GRASSTABLES_DIR}/driver
-	test -d ${GRASSTABLES_DIR}/driver/db || mkdir ${GRASSTABLES_DIR}/driver/db
-	cp -r @GRASS_GISBASE@/driver/db/* ${GRASSTABLES_DIR}/driver/db/
 
 clean:
 	rm -f $(OLIBNAME) $(GLIBNAME) *.o


=====================================
README
=====================================
--- a/README
+++ b/README
@@ -2,11 +2,11 @@ Standalone GRASS Drivers for GDAL and OGR
 =========================================
 
 This package contains standalone drivers for GRASS raster and vector
-files that can be built after GDAL has been built and installed as an 
-"autoload" driver.  
+files that can be built after GDAL has been built and installed as an
+"autoload" driver.
 
 This is particularly useful in resolving problems with GRASS depending
-on GDAL, but GDAL with GRASS support depending on GRASS.  With this 
+on GDAL, but GDAL with GRASS support depending on GRASS.  With this
 package you can configure and install GDAL normally (--without-grass), then
 build and install GRASS normally and finally build and install this driver.
 
@@ -52,12 +52,12 @@ libraries not found?
 
 Answer:
 
-Your problem is likely to be solved by editing /etc/ld.so.conf to 
-include the locations of proj, gdal, grass, and geos. Specifically, 
-the full path to both gdal-config and geos-config, and the full paths 
+Your problem is likely to be solved by editing /etc/ld.so.conf to
+include the locations of proj, gdal, grass, and geos. Specifically,
+the full path to both gdal-config and geos-config, and the full paths
 to the library locations of proj (often /usr/local/lib) and grass (/
-usr/local/grass-6.0.1/lib). After editing ld.so.conf, run ldconfig, 
+usr/local/grass-6.0.1/lib). After editing ld.so.conf, run ldconfig,
 and you should be good to go.
 
-I ran into this problem this weekend (and posted for help to this 
-list), so it seems to be a pretty common issue. 
+I ran into this problem this weekend (and posted for help to this
+list), so it seems to be a pretty common issue.


=====================================
VERSION
=====================================
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.1.0
+2.2.2


=====================================
aclocal.m4
=====================================
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -6,14 +6,14 @@ AC_DEFUN(AC_COMPILER_LOCALHACK,
   echo 'int main() { int i = 1; if( *((unsigned char *) &i) == 0 ) printf( "BIGENDIAN"); return 0; }' >> conftest.c
   ${CC} $CPPFLAGS $EXTRA_INCLUDES -o conftest conftest.c 2> comp.out
   COMP_CHECK=`grep "system directory" comp.out | grep /usr/local/include`
-  if test -z "$COMP_CHECK" ; then 
+  if test -z "$COMP_CHECK" ; then
      AC_MSG_RESULT([no, everything is ok])
   else
      AC_MSG_RESULT([yes, stripping extras])
      CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-I\/usr\/local\/include //"`
      CFLAGS=`echo "$CFLAGS " | sed "s/-I\/usr\/local\/include //"`
      EXTRA_INCLUDES=`echo "$EXTRA_INCLUDES " | sed "s/-I\/usr\/local\/include //"`
-  fi 
+  fi
   rm -f comp.out
 ])
 
@@ -61,7 +61,7 @@ AC_DEFUN(AC_COMPILER_PIC,
 dnl
 dnl Try to find something to link shared libraries with.  Use "c++ -shared"
 dnl in preference to "ld -shared" because it will link in required c++
-dnl run time support for us. 
+dnl run time support for us.
 dnl
 AC_DEFUN(AC_LD_SHARED,
 [
@@ -84,9 +84,9 @@ AC_DEFUN(AC_LD_SHARED,
 
   if test "$with_ld_shared" != "" ; then
     if test "$with_ld_shared" = "no" ; then
-      echo "user disabled shared library support."	
+      echo "user disabled shared library support."
     else
-      echo "using user supplied .so link command ... $with_ld_shared"	
+      echo "using user supplied .so link command ... $with_ld_shared"
     fi
     LD_SHARED="$with_ld_shared"
   fi
@@ -113,7 +113,7 @@ AC_DEFUN(AC_LD_SHARED,
     fi
   fi
 
-  dnl Test special MacOS (Darwin) case. 
+  dnl Test special MacOS (Darwin) case.
 
   if test ! -z "`uname | grep Darwin`" \
           -a "$LD_SHARED" = "/bin/true" \
@@ -157,7 +157,7 @@ AC_DEFUN(AC_LD_SHARED,
     else
       echo "checking for ${CXX} -shared ... no(2)"
     fi
-  else 
+  else
     if test "$LD_SHARED" = "/bin/true" ; then
       echo "checking for ${CXX} -shared ... no(1)"
     fi
@@ -195,7 +195,7 @@ AC_DEFUN(AC_LD_SHARED,
     fi
   fi
 
-  rm -f conftest* libconftest* 
+  rm -f conftest* libconftest*
 
   AC_SUBST(LD_SHARED,$LD_SHARED)
   AC_SUBST(SO_EXT,$SO_EXT)


=====================================
configure
=====================================
--- a/configure
+++ b/configure
@@ -626,6 +626,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -703,6 +704,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -955,6 +957,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1092,7 +1103,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1245,6 +1256,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -3279,7 +3291,50 @@ fi
 if test "$with_grass" != "yes" ; then
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for G_is_initialized in -lgrass_gis" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for G_read_compressed in -lgrass_gis" >&5
+$as_echo_n "checking for G_read_compressed in -lgrass_gis... " >&6; }
+if ${ac_cv_lib_grass_gis_G_read_compressed+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgrass_gis -L$with_grass/lib -lgrass_datetime $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char G_read_compressed ();
+int
+main ()
+{
+return G_read_compressed ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_grass_gis_G_read_compressed=yes
+else
+  ac_cv_lib_grass_gis_G_read_compressed=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_grass_gis_G_read_compressed" >&5
+$as_echo "$ac_cv_lib_grass_gis_G_read_compressed" >&6; }
+if test "x$ac_cv_lib_grass_gis_G_read_compressed" = xyes; then :
+  GRASS_SETTING=grass72+
+else
+  GRASS_SETTING=no
+fi
+
+  if test "$GRASS_SETTING" = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G_is_initialized in -lgrass_gis" >&5
 $as_echo_n "checking for G_is_initialized in -lgrass_gis... " >&6; }
 if ${ac_cv_lib_grass_gis_G_is_initialized+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -3321,8 +3376,8 @@ else
   GRASS_SETTING=no
 fi
 
-  if test "$GRASS_SETTING" = "no" ; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G_asprintf in -lgrass_gis" >&5
+    if test "$GRASS_SETTING" = "no" ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G_asprintf in -lgrass_gis" >&5
 $as_echo_n "checking for G_asprintf in -lgrass_gis... " >&6; }
 if ${ac_cv_lib_grass_gis_G_asprintf+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -3364,10 +3419,15 @@ else
   GRASS_SETTING=no
 fi
 
+    fi
   fi
 
   if test "$GRASS_SETTING" != "no" ; then
-    if test "$GRASS_SETTING" = "grass70+" ; then
+    if test "$GRASS_SETTING" = "grass72+" ; then
+      G_RASTLIBS="-lgrass_raster -lgrass_imagery"
+      G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_btree2 -lgrass_ccmath $LIBS"
+    elif test "$GRASS_SETTING" = "grass70+" ; then
       G_RASTLIBS="-lgrass_raster -lgrass_imagery"
       G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
       LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"


=====================================
configure.in
=====================================
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl ***************************************************************************
-dnl $Id: configure.in 33717 2016-03-14 06:29:14Z goatbar $
+dnl $Id: configure.in 37160 2017-01-17 07:34:22Z rouault $
 dnl
 dnl Project:  GDAL GRASS Plugin
 dnl Purpose:  Configure source file.
@@ -123,13 +123,20 @@ fi
 
 if test "$with_grass" != "yes" ; then
 
-  AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
+  AC_CHECK_LIB(grass_gis,G_read_compressed,GRASS_SETTING=grass72+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
   if test "$GRASS_SETTING" = "no" ; then
-    AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
+    AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
+    if test "$GRASS_SETTING" = "no" ; then
+      AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
+    fi
   fi
 
   if test "$GRASS_SETTING" != "no" ; then
-    if test "$GRASS_SETTING" = "grass70+" ; then
+    if test "$GRASS_SETTING" = "grass72+" ; then
+      G_RASTLIBS="-lgrass_raster -lgrass_imagery"
+      G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_btree2 -lgrass_ccmath $LIBS"
+    elif test "$GRASS_SETTING" = "grass70+" ; then
       G_RASTLIBS="-lgrass_raster -lgrass_imagery"
       G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
       LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,116 @@
+libgdal-grass (2.2.2-1~trusty2) trusty; urgency=medium
+
+  * Rebuild for trusty.
+  * Bump minimum version to GRASS 7.4.0.
+
+ -- Martin Landa <landa.martin at gmail.com>  Sun, 28 Jan 2018 19:51:49 +0100
+
+libgdal-grass (2.2.2-1) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.1.1, no changes.
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 03 Oct 2017 20:02:16 +0200
+
+libgdal-grass (2.2.2-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Bump Standards-Version to 4.1.0, no changes.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 22 Sep 2017 15:07:24 +0200
+
+libgdal-grass (2.2.2~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 16 Sep 2017 02:21:56 +0200
+
+libgdal-grass (2.2.1-2) unstable; urgency=medium
+
+  * Bump minimum GRASS version to 7.2.2.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 16 Sep 2017 16:42:42 +0200
+
+libgdal-grass (2.2.1-1) unstable; urgency=medium
+
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 10 Jul 2017 18:31:09 +0200
+
+libgdal-grass (2.2.1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 30 Jun 2017 15:04:00 +0200
+
+libgdal-grass (2.2.1~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+  * Disable PIE on Ubuntu where it's still problematic.
+  * Bump Standards-Version to 4.0.0, no changes.
+  * Add autopkgtest to test installability.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 23 Jun 2017 17:07:35 +0200
+
+libgdal-grass (2.2.0-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Bump minimum GRASS version to 7.2.1.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 09 May 2017 18:23:57 +0200
+
+libgdal-grass (2.2.0~beta1-1~exp1) experimental; urgency=medium
+
+  * New upstream beta release.
+  * Drop Breaks/Replaces for old binary packages, 2.2 subdirectory now used.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 15 Apr 2017 12:17:42 +0200
+
+libgdal-grass (2.1.3-1~exp2) experimental; urgency=medium
+
+  * Merge changes from libgdal-grass (2.1.2-5).
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 03 Apr 2017 01:22:02 +0200
+
+libgdal-grass (2.1.3-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 27 Jan 2017 13:12:12 +0100
+
+libgdal-grass (2.1.3~rc1-1~exp3) experimental; urgency=medium
+
+  * Add Breaks/Replaces for old version specific binary packages.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 26 Jan 2017 21:11:06 +0100
+
+libgdal-grass (2.1.3~rc1-1~exp2) experimental; urgency=medium
+
+  * Rename library package to libgdal-grass, drop now obsolete metapackage.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 21 Jan 2017 12:20:20 +0100
+
+libgdal-grass (2.1.3~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+  * Drop grass72.patch, applied upstream. Refresh remaining patch.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 20 Jan 2017 11:41:22 +0100
+
+libgdal-grass (2.1.2-6) unstable; urgency=medium
+
+  * Bump minimum GRASS version to 7.2.1.
+  * Bump Standards-Version to 4.0.0, no changes.
+  * Add autopkgtest to test installability.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 18 Jun 2017 19:46:34 +0200
+
+libgdal-grass (2.1.2-5) unstable; urgency=medium
+
+  * Enable PIE hardening flags.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 02 Apr 2017 23:43:22 +0200
+
 libgdal-grass (2.1.0-1~trusty3) trusty; urgency=medium
 
   * Bump minimum GRASS version to 7.2.0.
@@ -9,6 +122,49 @@ libgdal-grass (2.1.0-1~trusty3) trusty; urgency=medium
 
  -- Bas Couwenberg <sebastic at debian.org>  Tue, 17 Jan 2017 15:23:33 +0100
 
+libgdal-grass (2.1.2-4) unstable; urgency=medium
+
+  * Add patch to link GRASS 7.2 libraries.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 17 Jan 2017 01:50:21 +0100
+
+libgdal-grass (2.1.2-3) unstable; urgency=medium
+
+  * Update rpath patch for GRASS 7.2.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 16 Jan 2017 19:15:15 +0100
+
+libgdal-grass (2.1.2-2) unstable; urgency=medium
+
+  * Bump minimum GRASS version to 7.2.0.
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 28 Dec 2016 19:46:06 +0100
+
+libgdal-grass (2.1.2-2~exp1) experimental; urgency=medium
+
+  * Bump minimum GRASS version to 7.2.0~rc1.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 28 Oct 2016 16:30:08 +0200
+
+libgdal-grass (2.1.2-1) unstable; urgency=medium
+
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 28 Oct 2016 00:08:05 +0200
+
+libgdal-grass (2.1.2-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 27 Oct 2016 20:20:08 +0200
+
+libgdal-grass (2.1.2~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 14 Oct 2016 19:40:18 +0200
+
 libgdal-grass (2.1.0-1~trusty2) trusty; urgency=medium
 
   * Update branch in gbp.conf & Vcs-Git URL.
@@ -16,6 +172,44 @@ libgdal-grass (2.1.0-1~trusty2) trusty; urgency=medium
 
  -- Bas Couwenberg <sebastic at debian.org>  Mon, 03 Oct 2016 13:13:13 +0200
 
+libgdal-grass (2.1.1-3) unstable; urgency=medium
+
+  * Bump minimum GRASS version to 7.0.5.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 02 Oct 2016 22:30:08 +0200
+
+libgdal-grass (2.1.1-2) unstable; urgency=medium
+
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 10 Aug 2016 15:02:31 +0200
+
+libgdal-grass (2.1.1-2~exp1) experimental; urgency=medium
+
+  * Add metapackage to pull in the version specific binary package.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 06 Aug 2016 23:04:16 +0200
+
+libgdal-grass (2.1.1-1) unstable; urgency=medium
+
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 13 Jul 2016 16:30:03 +0200
+
+libgdal-grass (2.1.1-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Update watch file to use HTTPS for trac.osgeo.org.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 13 Jul 2016 12:11:01 +0200
+
+libgdal-grass (2.1.1~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+  * Move control file generation to separate templates target.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 04 Jul 2016 21:56:57 +0200
+
 libgdal-grass (2.1.0-1~trusty1) trusty; urgency=medium
 
   * Backport to Trusty.
@@ -57,6 +251,13 @@ libgdal-grass (2.0.2-1~exp1) experimental; urgency=medium
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 19 Feb 2016 15:55:24 +0100
 
+libgdal-grass (1.11.4-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+  * Bump Standards-Version to 3.9.7, no changes.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 06 Feb 2016 16:16:29 +0100
+
 libgdal-grass (1.11.3-3) unstable; urgency=medium
 
   * Update Vcs-Git URL to use HTTPS.


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -7,21 +7,21 @@ Priority: optional
 Build-Depends: debhelper (>= 9),
                dh-autoreconf,
                d-shlibs,
-               grass (>= 7.2.0),
-               grass-dev (>= 7.2.0),
-               libgdal-dev (>= 2.1.0),
+               grass (>= 7.4.0),
+               grass-dev (>= 7.4.0),
+               libgdal-dev (>= 2.2.2),
                libproj-dev,
                libpq-dev,
                pkg-config
-Standards-Version: 3.9.8
+Standards-Version: 4.1.1
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/gdal-grass.git
 Vcs-Git: https://anonscm.debian.org/git/pkg-grass/gdal-grass.git -b ubuntu/trusty
 Homepage: http://www.gdal.org/
 
-Package: libgdal20-2.1.0-grass
+Package: libgdal-grass
 Architecture: any
 Section: libs
-Depends: grass720,
+Depends: grass740,
          ${shlibs:Depends},
          ${misc:Depends}
 Recommends: gdal-bin
@@ -32,17 +32,3 @@ Description: GRASS extension for the GDAL library
  provides access to GRASS data via GDAL.
  .
  This package provides the GDAL GRASS plugin.
-
-Package: libgdal-grass
-Architecture: all
-Section: metapackages
-Depends: libgdal20-2.1.0-grass,
-         ${misc:Depends}
-Description: GRASS extension for the GDAL library - metapackage
- GDAL is a translator library for raster geospatial data formats.
- As a library, it presents a single abstract data model to the
- calling application for all supported formats. This extension
- provides access to GRASS data via GDAL.
- .
- This metapackage depends on the version specific library package.
-


=====================================
debian/control.in
=====================================
--- a/debian/control.in
+++ b/debian/control.in
@@ -7,18 +7,18 @@ Priority: optional
 Build-Depends: debhelper (>= 9),
                dh-autoreconf,
                d-shlibs,
-               grass (>= 7.2.0),
-               grass-dev (>= 7.2.0),
-               libgdal-dev (>= 2.1.0),
+               grass (>= 7.4.0),
+               grass-dev (>= 7.4.0),
+               libgdal-dev (>= 2.2.2),
                libproj-dev,
                libpq-dev,
                pkg-config
-Standards-Version: 3.9.8
+Standards-Version: 4.1.1
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/gdal-grass.git
 Vcs-Git: https://anonscm.debian.org/git/pkg-grass/gdal-grass.git -b ubuntu/trusty
 Homepage: http://www.gdal.org/
 
-Package: libgdal20-2.1.0-grass
+Package: libgdal-grass
 Architecture: any
 Section: libs
 Depends: @GRASS_ABI@,
@@ -32,17 +32,3 @@ Description: GRASS extension for the GDAL library
  provides access to GRASS data via GDAL.
  .
  This package provides the GDAL GRASS plugin.
-
-Package: libgdal-grass
-Architecture: all
-Section: metapackages
-Depends: libgdal20-2.1.0-grass,
-         ${misc:Depends}
-Description: GRASS extension for the GDAL library - metapackage
- GDAL is a translator library for raster geospatial data formats.
- As a library, it presents a single abstract data model to the
- calling application for all supported formats. This extension
- provides access to GRASS data via GDAL.
- .
- This metapackage depends on the version specific library package.
-


=====================================
debian/libgdal20-2.1.0-grass.lintian-overrides deleted
=====================================
--- a/debian/libgdal20-2.1.0-grass.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-# The run path has been added to get GRASS internal library
-libgdal20-2.1.0-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/gdal_GRASS.so /usr/lib/grass*/lib
-libgdal20-2.1.0-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/ogr_GRASS.so /usr/lib/grass*/lib


=====================================
debian/lintian-overrides
=====================================
--- a/debian/lintian-overrides
+++ b/debian/lintian-overrides
@@ -1,4 +1,3 @@
 # The run path has been added to get GRASS internal library
-libgdal20-2.1.0-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/gdal_GRASS.so /usr/lib/grass*/lib
-libgdal20-2.1.0-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/ogr_GRASS.so /usr/lib/grass*/lib
-
+libgdal-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/gdal_GRASS.so /usr/lib/grass*/lib
+libgdal-grass: binary-or-shlib-defines-rpath usr/lib/gdalplugins/*/ogr_GRASS.so /usr/lib/grass*/lib


=====================================
debian/patches/grass72.patch deleted
=====================================
--- a/debian/patches/grass72.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Description: Add libraries for GRASS 7.2.
-Author: Bas Couwenberg <sebastic at debian.org>
-Forwarded: https://trac.osgeo.org/gdal/ticket/6785
-
---- a/configure.in
-+++ b/configure.in
-@@ -123,13 +123,20 @@ fi
- 
- if test "$with_grass" != "yes" ; then
- 
--  AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
-+  AC_CHECK_LIB(grass_gis,G_read_compressed,GRASS_SETTING=grass72+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
-   if test "$GRASS_SETTING" = "no" ; then
--    AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
-+    AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
-+    if test "$GRASS_SETTING" = "no" ; then
-+      AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
-+    fi
-   fi
- 
-   if test "$GRASS_SETTING" != "no" ; then
--    if test "$GRASS_SETTING" = "grass70+" ; then
-+    if test "$GRASS_SETTING" = "grass72+" ; then
-+      G_RASTLIBS="-lgrass_raster -lgrass_imagery"
-+      G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
-+      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_btree2 -lgrass_ccmath $LIBS"
-+    elif test "$GRASS_SETTING" = "grass70+" ; then
-       G_RASTLIBS="-lgrass_raster -lgrass_imagery"
-       G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
-       LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"


=====================================
debian/patches/rpath
=====================================
--- a/debian/patches/rpath
+++ b/debian/patches/rpath
@@ -4,7 +4,7 @@ Forwarded: not-needed
 
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -47,10 +47,10 @@ distclean: clean
+@@ -34,10 +34,10 @@ distclean: clean
  
  
  $(GLIBNAME):	grass57dataset.o


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 rpath
-grass72.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,7 @@
 #export DH_VERBOSE=1
 
 # Enable hardening build flags
-export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
 PKGNAME=$(shell grep Package: debian/control.in | head -1 | cut -d' ' -f2)
 GRASS=grass$(subst .,,$(shell pkg-config --modversion grass | cut -d. -f1,2))


=====================================
debian/tests/control
=====================================
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+# Test installability
+Depends: @
+Test-Command: /bin/true


=====================================
grass57dataset.cpp
=====================================
--- a/grass57dataset.cpp
+++ b/grass57dataset.cpp
@@ -1,5 +1,4 @@
 /******************************************************************************
- * $Id: grass57dataset.cpp 33893 2016-04-04 14:08:28Z rouault $
  *
  * Project:  GRASS Driver
  * Purpose:  Implement GRASS raster read/write support
@@ -52,22 +51,24 @@ extern "C" {
 #include <grass/gis.h>
 
 #if GRASS_VERSION_MAJOR  >= 7
-char *GPJ_grass_to_wkt(const struct Key_Value *,
-		       const struct Key_Value *,
-		       int, int);
+char *GPJ_grass_to_wkt( const struct Key_Value *,
+                        const struct Key_Value *,
+                        int, int );
 #else
-char *GPJ_grass_to_wkt(struct Key_Value *,
-		       struct Key_Value *,
-		       int, int);
+char *GPJ_grass_to_wkt( struct Key_Value *,
+                        struct Key_Value *,
+                        int, int );
 #endif
 }
 
 #define GRASS_MAX_COLORS 100000  // what is the right value
 
-CPL_CVSID("$Id: grass57dataset.cpp 33893 2016-04-04 14:08:28Z rouault $");
+CPL_CVSID("$Id: grass57dataset.cpp 37964 2017-04-11 18:04:50Z rouault $");
 
 #if GRASS_VERSION_MAJOR  >= 7
 #define G_get_cellhd             Rast_get_cellhd
+#define G_get_window             Rast_get_window
+#define G_set_window             Rast_set_window
 #define G_raster_map_type        Rast_map_type
 #define G_read_fp_range          Rast_read_fp_range
 #define G_get_fp_range_min_max   Rast_get_fp_range_min_max
@@ -96,7 +97,7 @@ CPL_CVSID("$Id: grass57dataset.cpp 33893 2016-04-04 14:08:28Z rouault $");
 /*                         Grass2CPLErrorHook()                         */
 /************************************************************************/
 
-int Grass2CPLErrorHook( char * pszMessage, int bFatal )
+static int Grass2CPLErrorHook( char * pszMessage, int bFatal )
 
 {
     if( !bFatal )
@@ -110,7 +111,7 @@ int Grass2CPLErrorHook( char * pszMessage, int bFatal )
 
 /************************************************************************/
 /* ==================================================================== */
-/*				GRASSDataset				*/
+/*                              GRASSDataset                            */
 /* ==================================================================== */
 /************************************************************************/
 
@@ -120,22 +121,22 @@ class GRASSDataset : public GDALDataset
 {
     friend class GRASSRasterBand;
 
-    char	*pszGisdbase;
-    char	*pszLocation;  /* LOCATION_NAME */
-    char	*pszElement;   /* cellhd or group */
+    char        *pszGisdbase;
+    char        *pszLocation;  /* LOCATION_NAME */
+    char        *pszElement;   /* cellhd or group */
 
     struct Cell_head sCellInfo; /* raster region */
 
-    char	*pszProjection;
+    char        *pszProjection;
 
-    double	adfGeoTransform[6];
+    double      adfGeoTransform[6];
 
   public:
                  GRASSDataset();
                  ~GRASSDataset();
 
-    virtual const char *GetProjectionRef(void);
-    virtual CPLErr GetGeoTransform( double * );
+    virtual const char *GetProjectionRef(void) override;
+    virtual CPLErr GetGeoTransform( double * ) override;
 
     static GDALDataset *Open( GDALOpenInfo * );
 
@@ -155,7 +156,7 @@ class GRASSRasterBand : public GDALRasterBand
 
     char        *pszCellName;
     char        *pszMapset;
-    int		hCell;
+    int         hCell;
     int         nGRSType; // GRASS raster type: CELL_TYPE, FCELL_TYPE, DCELL_TYPE
     bool        nativeNulls; // use GRASS native NULL values
 
@@ -164,11 +165,11 @@ class GRASSRasterBand : public GDALRasterBand
 
     struct Cell_head sOpenWindow; /* the region when the raster was opened */
 
-    int		bHaveMinMax;
-    double	dfCellMin;
-    double	dfCellMax;
+    int         bHaveMinMax;
+    double      dfCellMin;
+    double      dfCellMax;
 
-    double	dfNoData;
+    double      dfNoData;
 
     bool        valid;
 
@@ -178,42 +179,40 @@ class GRASSRasterBand : public GDALRasterBand
                                     const char *, const char * );
     virtual        ~GRASSRasterBand();
 
-    virtual CPLErr IReadBlock( int, int, void * );
+    virtual CPLErr IReadBlock( int, int, void * ) override;
     virtual CPLErr IRasterIO ( GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType,
                                GSpacing nPixelSpace,
                                GSpacing nLineSpace,
-                               GDALRasterIOExtraArg* psExtraArg);
-    virtual GDALColorInterp GetColorInterpretation();
-    virtual GDALColorTable *GetColorTable();
-    virtual double GetMinimum( int *pbSuccess = NULL );
-    virtual double GetMaximum( int *pbSuccess = NULL );
-    virtual double GetNoDataValue( int *pbSuccess = NULL );
+                               GDALRasterIOExtraArg* psExtraArg) override;
+    virtual GDALColorInterp GetColorInterpretation() override;
+    virtual GDALColorTable *GetColorTable() override;
+    virtual double GetMinimum( int *pbSuccess = NULL ) override;
+    virtual double GetMaximum( int *pbSuccess = NULL ) override;
+    virtual double GetNoDataValue( int *pbSuccess = NULL ) override;
 
   private:
     CPLErr ResetReading( struct Cell_head * );
-
 };
 
-
 /************************************************************************/
 /*                          GRASSRasterBand()                           */
 /************************************************************************/
 
-GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDS, int nBand,
-                                  const char * pszMapset,
-                                  const char * pszCellName )
+GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
+                                  const char * pszMapsetIn,
+                                  const char * pszCellNameIn )
 
 {
-    struct Cell_head	sCellInfo;
+    struct Cell_head sCellInfo;
 
     // Note: GISDBASE, LOCATION_NAME ans MAPSET was set in GRASSDataset::Open
 
-    this->poDS = poDS;
-    this->nBand = nBand;
+    this->poDS = poDSIn;
+    this->nBand = nBandIn;
     this->valid = false;
 
-    this->pszCellName = G_store ( (char *) pszCellName );
-    this->pszMapset = G_store ( (char *) pszMapset );
+    this->pszCellName = G_store ( (char *) pszCellNameIn );
+    this->pszMapset = G_store ( (char *) pszMapsetIn );
 
     G_get_cellhd( (char *) pszCellName, (char *) pszMapset, &sCellInfo );
     nGRSType = G_raster_map_type( (char *) pszCellName, (char *) pszMapset );
@@ -244,66 +243,66 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDS, int nBand,
     // full raster values range is used -> no checks if shorter type could be used
 
     if( nGRSType == CELL_TYPE ) {
-	if ( sCellInfo.format == 0 ) {  // 1 byte / cell -> possible range 0,255
-	    if ( bHaveMinMax && dfCellMin > 0 ) {
+        if ( sCellInfo.format == 0 ) {  // 1 byte / cell -> possible range 0,255
+            if ( bHaveMinMax && dfCellMin > 0 ) {
                 this->eDataType = GDT_Byte;
-		dfNoData = 0.0;
-	    } else if ( bHaveMinMax && dfCellMax < 255 ) {
+                dfNoData = 0.0;
+            } else if ( bHaveMinMax && dfCellMax < 255 ) {
                 this->eDataType = GDT_Byte;
-		dfNoData = 255.0;
-	    } else { // maximum is not known or full range is used
-		this->eDataType = GDT_UInt16;
-		dfNoData = 256.0;
-	    }
-	    nativeNulls = false;
-	} else if ( sCellInfo.format == 1 ) {  // 2 bytes / cell -> possible range 0,65535
-	    if ( bHaveMinMax && dfCellMin > 0 ) {
-		this->eDataType = GDT_UInt16;
-		dfNoData = 0.0;
-	    } else if ( bHaveMinMax && dfCellMax < 65535 ) {
+                dfNoData = 255.0;
+            } else { // maximum is not known or full range is used
+                this->eDataType = GDT_UInt16;
+                dfNoData = 256.0;
+            }
+            nativeNulls = false;
+        } else if ( sCellInfo.format == 1 ) {  // 2 bytes / cell -> possible range 0,65535
+            if ( bHaveMinMax && dfCellMin > 0 ) {
+                this->eDataType = GDT_UInt16;
+                dfNoData = 0.0;
+            } else if ( bHaveMinMax && dfCellMax < 65535 ) {
                 this->eDataType = GDT_UInt16;
-		dfNoData = 65535;
-	    } else { // maximum is not known or full range is used
-		CELL cval;
-		this->eDataType = GDT_Int32;
-		G_set_c_null_value ( &cval, 1);
-		dfNoData = (double) cval;
-		nativeNulls = true;
-	    }
-	    nativeNulls = false;
-	} else {  // 3-4 bytes
-	    CELL cval;
-	    this->eDataType = GDT_Int32;
-	    G_set_c_null_value ( &cval, 1);
-	    dfNoData = (double) cval;
-	    nativeNulls = true;
-	}
+                dfNoData = 65535;
+            } else { // maximum is not known or full range is used
+                CELL cval;
+                this->eDataType = GDT_Int32;
+                G_set_c_null_value ( &cval, 1);
+                dfNoData = (double) cval;
+                nativeNulls = true;
+            }
+            nativeNulls = false;
+        } else {  // 3-4 bytes
+            CELL cval;
+            this->eDataType = GDT_Int32;
+            G_set_c_null_value ( &cval, 1);
+            dfNoData = (double) cval;
+            nativeNulls = true;
+        }
     }
     else if( nGRSType == FCELL_TYPE ) {
-	FCELL fval;
+        FCELL fval;
         this->eDataType = GDT_Float32;
-	G_set_f_null_value ( &fval, 1);
-	dfNoData = (double) fval;
-	nativeNulls = true;
+        G_set_f_null_value ( &fval, 1);
+        dfNoData = (double) fval;
+        nativeNulls = true;
     }
     else if( nGRSType == DCELL_TYPE )
     {
-	DCELL dval;
+        DCELL dval;
         this->eDataType = GDT_Float64;
-	G_set_d_null_value ( &dval, 1);
-	dfNoData = (double) dval;
-	nativeNulls = true;
+        G_set_d_null_value ( &dval, 1);
+        dfNoData = (double) dval;
+        nativeNulls = true;
     }
 
-    nBlockXSize = poDS->nRasterXSize;;
+    nBlockXSize = poDSIn->nRasterXSize;
     nBlockYSize = 1;
 
-    G_set_window( &(((GRASSDataset *)poDS)->sCellInfo) );
+    G_set_window( &(poDSIn->sCellInfo) );
     if ( (hCell = G_open_cell_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
-	CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
-	return;
+        CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
+        return;
     }
-    G_copy((void *) &sOpenWindow, (void *) &(((GRASSDataset *)poDS)->sCellInfo), sizeof(struct Cell_head));
+    G_copy((void *) &sOpenWindow, (void *) &(poDSIn->sCellInfo), sizeof(struct Cell_head));
 
 /* -------------------------------------------------------------------- */
 /*      Do we have a color table?                                       */
@@ -311,34 +310,34 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDS, int nBand,
     poCT = NULL;
     if( G_read_colors( (char *) pszCellName, (char *) pszMapset, &sGrassColors ) == 1 )
     {
-	int maxcolor;
-	CELL min, max;
+        int maxcolor;
+        CELL min, max;
 
-	G_get_color_range ( &min, &max, &sGrassColors);
+        G_get_color_range ( &min, &max, &sGrassColors);
 
         if ( bHaveMinMax ) {
-	    if ( max < dfCellMax ) {
-	       maxcolor = max;
+            if ( max < dfCellMax ) {
+               maxcolor = max;
             } else {
-	       maxcolor = (int) ceil ( dfCellMax );
-	    }
-	    if ( maxcolor > GRASS_MAX_COLORS ) {
-		maxcolor = GRASS_MAX_COLORS;
+               maxcolor = (int) ceil ( dfCellMax );
+            }
+            if ( maxcolor > GRASS_MAX_COLORS ) {
+                maxcolor = GRASS_MAX_COLORS;
                 CPLDebug( "GRASS", "Too many values, color table cut to %d entries.", maxcolor );
-	    }
-	} else {
-	    if ( max < GRASS_MAX_COLORS ) {
-	       maxcolor = max;
+            }
+        } else {
+            if ( max < GRASS_MAX_COLORS ) {
+               maxcolor = max;
             } else {
-	       maxcolor = GRASS_MAX_COLORS;
+               maxcolor = GRASS_MAX_COLORS;
                CPLDebug( "GRASS", "Too many values, color table set to %d entries.", maxcolor );
-	    }
+            }
         }
 
         poCT = new GDALColorTable();
         for( int iColor = 0; iColor <= maxcolor; iColor++ )
         {
-            int	nRed, nGreen, nBlue;
+            int nRed, nGreen, nBlue;
             GDALColorEntry    sColor;
 
 #if GRASS_VERSION_MAJOR  >= 7
@@ -424,33 +423,32 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
 
     /* Check if the window has changed */
     if ( sNewWindow->north  != sOpenWindow.north  || sNewWindow->south  != sOpenWindow.south ||
-	 sNewWindow->east   != sOpenWindow.east   || sNewWindow->west   != sOpenWindow.west ||
-	 sNewWindow->ew_res != sOpenWindow.ew_res || sNewWindow->ns_res != sOpenWindow.ns_res ||
-	 sNewWindow->rows   != sOpenWindow.rows   || sNewWindow->cols   != sOpenWindow.cols )
+         sNewWindow->east   != sOpenWindow.east   || sNewWindow->west   != sOpenWindow.west ||
+         sNewWindow->ew_res != sOpenWindow.ew_res || sNewWindow->ns_res != sOpenWindow.ns_res ||
+         sNewWindow->rows   != sOpenWindow.rows   || sNewWindow->cols   != sOpenWindow.cols )
     {
-	if( hCell >= 0 ) {
+        if( hCell >= 0 ) {
             G_close_cell( hCell );
-	    hCell = -1;
-	}
+            hCell = -1;
+        }
 
-	/* Set window */
-	G_set_window( sNewWindow );
+        /* Set window */
+        G_set_window( sNewWindow );
 
-	/* Open raster */
-	G__setenv( "GISDBASE", ((GRASSDataset *)poDS)->pszGisdbase );
-	G__setenv( "LOCATION_NAME", ((GRASSDataset *)poDS)->pszLocation );
-	G__setenv( "MAPSET", pszMapset);
-	G_reset_mapsets();
-	G_add_mapset_to_search_path ( pszMapset );
+        /* Open raster */
+        G__setenv( "GISDBASE", ((GRASSDataset *)poDS)->pszGisdbase );
+        G__setenv( "LOCATION_NAME", ((GRASSDataset *)poDS)->pszLocation );
+        G__setenv( "MAPSET", pszMapset);
+        G_reset_mapsets();
+        G_add_mapset_to_search_path ( pszMapset );
 
-	if ( (hCell = G_open_cell_old( pszCellName, pszMapset)) < 0 ) {
-	    CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
+        if ( (hCell = G_open_cell_old( pszCellName, pszMapset)) < 0 ) {
+            CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
             this->valid = false;
-	    return CE_Failure;
-	}
-
-	G_copy((void *) &sOpenWindow, (void *) sNewWindow, sizeof(struct Cell_head));
+            return CE_Failure;
+        }
 
+        G_copy((void *) &sOpenWindow, (void *) sNewWindow, sizeof(struct Cell_head));
     }
     else
     {
@@ -470,7 +468,6 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
         }
     }
 
-
     return CE_None;
 }
 
@@ -479,7 +476,7 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
 /*                                                                      */
 /************************************************************************/
 
-CPLErr GRASSRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff,
+CPLErr GRASSRasterBand::IReadBlock( int /*nBlockXOff*/, int nBlockYOff,
                                     void *pImage )
 
 {
@@ -491,29 +488,32 @@ CPLErr GRASSRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff,
     }
 
     if ( eDataType == GDT_Byte || eDataType == GDT_UInt16 ) {
-        CELL  *cbuf;
-
-	cbuf = G_allocate_c_raster_buf();
-	G_get_c_raster_row ( hCell, cbuf, nBlockYOff );
-
-	/* Reset NULLs */
-	for ( int col = 0; col < nBlockXSize; col++ ) {
-	    if ( G_is_c_null_value(&(cbuf[col])) )
-		cbuf[col] = (CELL) dfNoData;
-	}
+        CELL *cbuf = G_allocate_c_raster_buf();
+        G_get_c_raster_row ( hCell, cbuf, nBlockYOff );
 
-	GDALCopyWords ( (void *) cbuf, GDT_Int32, sizeof(CELL),
-	                pImage, eDataType, GDALGetDataTypeSize(eDataType)/8,
-			nBlockXSize );
+        /* Reset NULLs */
+        for ( int col = 0; col < nBlockXSize; col++ ) {
+            if ( G_is_c_null_value(&(cbuf[col])) )
+                cbuf[col] = (CELL) dfNoData;
+        }
 
-	G_free ( cbuf );
+        GDALCopyWords ( (void *) cbuf, GDT_Int32, sizeof(CELL),
+                        pImage, eDataType, GDALGetDataTypeSize(eDataType)/8,
+                        nBlockXSize );
 
-    } else if ( eDataType == GDT_Int32 ) {
-	G_get_c_raster_row ( hCell, (CELL *) pImage, nBlockYOff );
-    } else if ( eDataType == GDT_Float32 ) {
-	G_get_f_raster_row ( hCell, (FCELL *) pImage, nBlockYOff );
-    } else if ( eDataType == GDT_Float64 ) {
-	G_get_d_raster_row ( hCell, (DCELL *) pImage, nBlockYOff );
+        G_free ( cbuf );
+    }
+    else if ( eDataType == GDT_Int32 )
+    {
+        G_get_c_raster_row ( hCell, (CELL *) pImage, nBlockYOff );
+    }
+    else if ( eDataType == GDT_Float32 )
+    {
+        G_get_f_raster_row ( hCell, (FCELL *) pImage, nBlockYOff );
+    }
+    else if ( eDataType == GDT_Float64 )
+    {
+        G_get_d_raster_row ( hCell, (DCELL *) pImage, nBlockYOff );
     }
 
     return CE_None;
@@ -525,12 +525,12 @@ CPLErr GRASSRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff,
 /************************************************************************/
 
 CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
-	                           int nXOff, int nYOff, int nXSize, int nYSize,
-				   void * pData, int nBufXSize, int nBufYSize,
-				   GDALDataType eBufType,
-				   GSpacing nPixelSpace,
-                   GSpacing nLineSpace,
-                   GDALRasterIOExtraArg* psExtraArg )
+                                   int nXOff, int nYOff, int nXSize, int nYSize,
+                                   void * pData, int nBufXSize, int nBufYSize,
+                                   GDALDataType eBufType,
+                                   GSpacing nPixelSpace,
+                                    GSpacing nLineSpace,
+                                    GDALRasterIOExtraArg* /*psExtraArg*/ )
 {
     /* GRASS library does that, we have only calculate and reset the region in map units
      * and if the region has changed, reopen the raster */
@@ -539,6 +539,7 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
     struct Cell_head sWindow;
     struct Cell_head *psDsWindow;
 
+    if( eRWFlag != GF_Read ) return CE_Failure;
     if ( ! this->valid ) return CE_Failure;
 
     psDsWindow = &(((GRASSDataset *)poDS)->sCellInfo);
@@ -569,63 +570,63 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
 
     /* Reset space if default (0) */
     if ( nPixelSpace == 0 )
-	nPixelSpace = GDALGetDataTypeSize ( eBufType ) / 8;
+        nPixelSpace = GDALGetDataTypeSize ( eBufType ) / 8;
 
     if ( nLineSpace == 0 )
-	nLineSpace = nBufXSize * nPixelSpace;
+        nLineSpace = nBufXSize * nPixelSpace;
 
     if ( nGRSType == CELL_TYPE && ( !nativeNulls || eBufType != GDT_Int32 || sizeof(CELL) != 4 ||
-		                    nPixelSpace != sizeof(CELL) )  )
+                                    nPixelSpace != sizeof(CELL) )  )
     {
-	cbuf = G_allocate_c_raster_buf();
+        cbuf = G_allocate_c_raster_buf();
     } else if( nGRSType == FCELL_TYPE && ( eBufType != GDT_Float32 || nPixelSpace != sizeof(FCELL) ) ) {
-	fbuf = G_allocate_f_raster_buf();
+        fbuf = G_allocate_f_raster_buf();
     } else if( nGRSType == DCELL_TYPE && ( eBufType != GDT_Float64 || nPixelSpace != sizeof(DCELL) ) ) {
-	dbuf = G_allocate_d_raster_buf();
+        dbuf = G_allocate_d_raster_buf();
     } else {
-	direct = true;
+        direct = true;
     }
 
     for ( int row = 0; row < nBufYSize; row++ ) {
         char *pnt = (char *)pData + row * nLineSpace;
 
-	if ( nGRSType == CELL_TYPE ) {
-	    if ( direct ) {
-		G_get_c_raster_row ( hCell, (CELL *) pnt, row );
-	    } else {
-		G_get_c_raster_row ( hCell, cbuf, row );
-
-		/* Reset NULLs */
-		for ( int col = 0; col < nBufXSize; col++ ) {
-		    if ( G_is_c_null_value(&(cbuf[col])) )
-			cbuf[col] = (CELL) dfNoData;
-		}
-
-		GDALCopyWords ( (void *) cbuf, GDT_Int32, sizeof(CELL),
-			        (void *)  pnt,  eBufType, nPixelSpace,
-				nBufXSize );
-	    }
-	} else if( nGRSType == FCELL_TYPE ) {
-	    if ( direct ) {
-		G_get_f_raster_row ( hCell, (FCELL *) pnt, row );
-	    } else {
-		G_get_f_raster_row ( hCell, fbuf, row );
-
-		GDALCopyWords ( (void *) fbuf, GDT_Float32, sizeof(FCELL),
-			        (void *)  pnt,  eBufType, nPixelSpace,
-				nBufXSize );
-	    }
-	} else if( nGRSType == DCELL_TYPE ) {
-	    if ( direct ) {
-		G_get_d_raster_row ( hCell, (DCELL *) pnt, row );
-	    } else {
-		G_get_d_raster_row ( hCell, dbuf, row );
-
-		GDALCopyWords ( (void *) dbuf, GDT_Float64, sizeof(DCELL),
-			        (void *)  pnt,  eBufType, nPixelSpace,
-				nBufXSize );
-	    }
-	}
+        if ( nGRSType == CELL_TYPE ) {
+            if ( direct ) {
+                G_get_c_raster_row ( hCell, (CELL *) pnt, row );
+            } else {
+                G_get_c_raster_row ( hCell, cbuf, row );
+
+                /* Reset NULLs */
+                for ( int col = 0; col < nBufXSize; col++ ) {
+                    if ( G_is_c_null_value(&(cbuf[col])) )
+                        cbuf[col] = (CELL) dfNoData;
+                }
+
+                GDALCopyWords ( (void *) cbuf, GDT_Int32, sizeof(CELL),
+                                (void *)  pnt,  eBufType, nPixelSpace,
+                                nBufXSize );
+            }
+        } else if( nGRSType == FCELL_TYPE ) {
+            if ( direct ) {
+                G_get_f_raster_row ( hCell, (FCELL *) pnt, row );
+            } else {
+                G_get_f_raster_row ( hCell, fbuf, row );
+
+                GDALCopyWords ( (void *) fbuf, GDT_Float32, sizeof(FCELL),
+                                (void *)  pnt,  eBufType, nPixelSpace,
+                                nBufXSize );
+            }
+        } else if( nGRSType == DCELL_TYPE ) {
+            if ( direct ) {
+                G_get_d_raster_row ( hCell, (DCELL *) pnt, row );
+            } else {
+                G_get_d_raster_row ( hCell, dbuf, row );
+
+                GDALCopyWords ( (void *) dbuf, GDT_Float64, sizeof(DCELL),
+                                (void *)  pnt,  eBufType, nPixelSpace,
+                                nBufXSize );
+            }
+        }
     }
 
     if ( cbuf ) G_free ( cbuf );
@@ -719,7 +720,6 @@ double GRASSRasterBand::GetNoDataValue( int *pbSuccess )
 /* ==================================================================== */
 /************************************************************************/
 
-
 /************************************************************************/
 /*                            GRASSDataset()                            */
 /************************************************************************/
@@ -734,6 +734,9 @@ GRASSDataset::GRASSDataset()
     adfGeoTransform[3] = 0.0;
     adfGeoTransform[4] = 0.0;
     adfGeoTransform[5] = 1.0;
+    pszGisdbase = NULL;
+    pszLocation = NULL;
+    pszElement = NULL;
 }
 
 /************************************************************************/
@@ -744,13 +747,13 @@ GRASSDataset::~GRASSDataset()
 {
 
     if ( pszGisdbase )
-	G_free ( pszGisdbase );
+        G_free ( pszGisdbase );
 
     if ( pszLocation )
         G_free ( pszLocation );
 
     if ( pszElement )
-	G_free ( pszElement );
+        G_free ( pszElement );
 
     G_free( pszProjection );
 }
@@ -788,31 +791,37 @@ CPLErr GRASSDataset::GetGeoTransform( double * padfGeoTransform )
 /*          false - failed                                              */
 /************************************************************************/
 bool GRASSDataset::SplitPath( char *path, char **gisdbase, char **location,
-	                      char **mapset, char **element, char **name )
+                              char **mapset, char **element, char **name )
 {
-    char *p, *ptr[5], *tmp;
-    int  i = 0;
+    char *p;
+    char *ptr[5];
+    char *tmp;
+    int i = 0;
 
-    *gisdbase = *location = *mapset = *element = *name = NULL;
+    *gisdbase = NULL;
+    *location = NULL;
+    *mapset = NULL;
+    *element = NULL;
+    *name = NULL;
 
     if ( !path || strlen(path) == 0 )
-	return false;
+        return false;
 
     tmp = G_store ( path );
 
     while ( (p = strrchr(tmp,'/')) != NULL  && i < 4 ) {
-	*p = '\0';
+        *p = '\0';
 
-	if ( strlen(p+1) == 0 ) /* repeated '/' */
-	    continue;
+        if ( strlen(p+1) == 0 ) /* repeated '/' */
+            continue;
 
-	ptr[i++] = p+1;
+        ptr[i++] = p+1;
     }
 
     /* Note: empty GISDBASE == 0 is not accepted (relative path) */
     if ( i != 4 ) {
         G_free ( tmp );
-	return false;
+        return false;
     }
 
     *gisdbase = G_store ( tmp );
@@ -838,8 +847,8 @@ typedef int (*GrassErrorHandler)(char *, int);
 GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
 
 {
-    char	*pszGisdb = NULL, *pszLoc = NULL;
-    char	*pszMapset = NULL, *pszElem = NULL, *pszName = NULL;
+    char        *pszGisdb = NULL, *pszLoc = NULL;
+    char        *pszMapset = NULL, *pszElem = NULL, *pszName = NULL;
     char        **papszCells = NULL;
     char        **papszMapsets = NULL;
 
@@ -862,7 +871,6 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
     // Set error function
     G_set_error_routine ( (GrassErrorHandler) Grass2CPLErrorHook );
 
-
     // GISBASE is path to the directory where GRASS is installed,
     if ( !getenv( "GISBASE" ) ) {
         static char* gisbaseEnv = NULL;
@@ -880,19 +888,19 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
 
     if ( !SplitPath( poOpenInfo->pszFilename, &pszGisdb, &pszLoc, &pszMapset,
                      &pszElem, &pszName) ) {
-	return NULL;
+        return NULL;
     }
 
 /* -------------------------------------------------------------------- */
 /*      Check element name                                              */
 /* -------------------------------------------------------------------- */
     if ( strcmp(pszElem,"cellhd") != 0 && strcmp(pszElem,"group") != 0 ) {
-	G_free(pszGisdb);
+        G_free(pszGisdb);
         G_free(pszLoc);
         G_free(pszMapset);
         G_free(pszElem);
         G_free(pszName);
-	return NULL;
+        return NULL;
     }
 
 /* -------------------------------------------------------------------- */
@@ -911,12 +919,12 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
     if ( strcmp(pszElem,"cellhd") == 0 ) {
 
         if ( G_find_file2("cell", pszName, pszMapset) == NULL ) {
-	    G_free(pszGisdb); G_free(pszLoc); G_free(pszMapset); G_free(pszElem); G_free(pszName);
-	    return NULL;
-	}
+            G_free(pszGisdb); G_free(pszLoc); G_free(pszMapset); G_free(pszElem); G_free(pszName);
+            return NULL;
+        }
 
-	papszMapsets = CSLAddString( papszMapsets, pszMapset );
-	papszCells = CSLAddString( papszCells, pszName );
+        papszMapsets = CSLAddString( papszMapsets, pszMapset );
+        papszCells = CSLAddString( papszCells, pszName );
     }
 /* -------------------------------------------------------------------- */
 /*      Check if this is a valid GRASS imagery group.                   */
@@ -926,12 +934,12 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
 
         I_init_group_ref( &ref );
         if ( I_get_group_ref( pszName, &ref ) == 0 ) {
-	    G_free(pszGisdb); G_free(pszLoc); G_free(pszMapset); G_free(pszElem); G_free(pszName);
-	    return NULL;
-	}
+            G_free(pszGisdb); G_free(pszLoc); G_free(pszMapset); G_free(pszElem); G_free(pszName);
+            return NULL;
+        }
 
         for( int iRef = 0; iRef < ref.nfiles; iRef++ )
-	{
+        {
             papszCells = CSLAddString( papszCells, ref.file[iRef].name );
             papszMapsets = CSLAddString( papszMapsets, ref.file[iRef].mapset );
             G_add_mapset_to_search_path ( ref.file[iRef].mapset );
@@ -946,9 +954,7 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
 /* -------------------------------------------------------------------- */
 /*      Create a corresponding GDALDataset.                             */
 /* -------------------------------------------------------------------- */
-    GRASSDataset 	*poDS;
-
-    poDS = new GRASSDataset();
+    GRASSDataset*poDS = new GRASSDataset();
 
     /* notdef: should only allow read access to an existing cell, right? */
     poDS->eAccess = poOpenInfo->eAccess;
@@ -997,14 +1003,14 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
 /* -------------------------------------------------------------------- */
     for( int iBand = 0; papszCells[iBand] != NULL; iBand++ )
     {
-	GRASSRasterBand *rb = new GRASSRasterBand( poDS, iBand+1, papszMapsets[iBand],
+        GRASSRasterBand *rb = new GRASSRasterBand( poDS, iBand+1, papszMapsets[iBand],
                                                                   papszCells[iBand] );
 
-	if ( !rb->valid ) {
-	    CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster band %d", iBand);
-	    delete rb;
-	    delete poDS;
-	    return NULL;
+        if ( !rb->valid ) {
+            CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster band %d", iBand);
+            delete rb;
+            delete poDS;
+            return NULL;
         }
 
         poDS->SetBand( iBand+1, rb );


=====================================
ogrgrass.h
=====================================
--- a/ogrgrass.h
+++ b/ogrgrass.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: ogrgrass.h 33713 2016-03-12 17:41:57Z goatbar $
+ * $Id: ogrgrass.h 36501 2016-11-25 14:09:24Z rouault $
  *
  * Project:  OpenGIS Simple Features Reference Implementation
  * Purpose:  Private definitions for OGR/GRASS driver.
@@ -50,81 +50,76 @@ extern "C" {
 class OGRGRASSLayer : public OGRLayer
 {
   public:
-                        OGRGRASSLayer(	int layer, struct Map_info * map );
-                        ~OGRGRASSLayer();
+                        OGRGRASSLayer( int layer, struct Map_info * map );
+                        virtual ~OGRGRASSLayer();
 
     // Layer info
-    OGRFeatureDefn *    GetLayerDefn() { return poFeatureDefn; }
-    GIntBig             GetFeatureCount( int );
-    OGRErr              GetExtent(OGREnvelope *psExtent, int bForce);
-    virtual OGRErr      GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce)
+    OGRFeatureDefn *    GetLayerDefn() override { return poFeatureDefn; }
+    GIntBig             GetFeatureCount( int ) override;
+    OGRErr              GetExtent(OGREnvelope *psExtent, int bForce) override;
+    virtual OGRErr      GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce) override
                 { return OGRLayer::GetExtent(iGeomField, psExtent, bForce); }
-    virtual OGRSpatialReference *GetSpatialRef();
-    int                 TestCapability( const char * );
+    virtual OGRSpatialReference *GetSpatialRef() override;
+    int                 TestCapability( const char * ) override;
 
     // Reading
-    void                ResetReading();
-    virtual OGRErr      SetNextByIndex( GIntBig nIndex );
-    OGRFeature *        GetNextFeature();
-    OGRFeature         *GetFeature( GIntBig nFeatureId );
+    void                ResetReading() override;
+    virtual OGRErr      SetNextByIndex( GIntBig nIndex ) override;
+    OGRFeature *        GetNextFeature() override;
+    OGRFeature         *GetFeature( GIntBig nFeatureId ) override;
 
     // Filters
-    virtual OGRErr 	SetAttributeFilter( const char *query );
-    virtual void 	SetSpatialFilter( OGRGeometry * poGeomIn );
-    virtual void        SetSpatialFilter( int iGeomField, OGRGeometry *poGeom )
+    virtual OGRErr      SetAttributeFilter( const char *query ) override;
+    virtual void        SetSpatialFilter( OGRGeometry * poGeomIn ) override;
+    virtual void        SetSpatialFilter( int iGeomField, OGRGeometry *poGeom ) override
                 { OGRLayer::SetSpatialFilter(iGeomField, poGeom); }
 
-    // Write access, not supported:
-    virtual OGRErr      CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE );
-    OGRErr              ISetFeature( OGRFeature *poFeature );
-    OGRErr              ICreateFeature( OGRFeature *poFeature );
-
   private:
-    char		*pszName;
+    char                *pszName;
     OGRSpatialReference *poSRS;
-    OGRFeatureDefn	*poFeatureDefn;
-    char		*pszQuery;	// Attribute filter string
+    OGRFeatureDefn      *poFeatureDefn;
+    char                *pszQuery;      // Attribute filter string
 
-    int			iNextId;
-    int			nTotalCount;
-    int			iLayer;		// Layer number
-    int			iLayerIndex;	// Layer index (in GRASS category index)
-    int			iCatField;	// Field where category (key) is stored
-    int			nFields;
-    int 		*paFeatureIndex; // Array of indexes to category index array
+    int                 iNextId;
+    int                 nTotalCount;
+    int                 iLayer;         // Layer number
+    int                 iLayerIndex;    // Layer index (in GRASS category index)
+    int                 iCatField;      // Field where category (key) is stored
+    int                 nFields;
+    int                 *paFeatureIndex; // Array of indexes to category index array
 
     // Vector map
-    struct Map_info 	*poMap;
+    struct Map_info     *poMap;
     struct field_info   *poLink;
 
     // Database connection
-    bool 		bHaveAttributes;
+    bool                bHaveAttributes;
 
-    dbString		*poDbString;
-    dbDriver		*poDriver;
-    dbCursor		*poCursor;
+    dbString            *poDbString;
+    dbDriver            *poDriver;
+    dbCursor            *poCursor;
 
-    bool		bCursorOpened;	// Sequential database cursor opened
-    int 		iCurrentCat;	// Current category in select cursor
+    bool                bCursorOpened;  // Sequential database cursor opened
+    int                 iCurrentCat;    // Current category in select cursor
 
-    struct line_pnts	*poPoints;
-    struct line_cats	*poCats;
+    struct line_pnts    *poPoints;
+    struct line_cats    *poCats;
 
-    bool		StartDbDriver ();
-    bool		StopDbDriver ();
+    bool                StartDbDriver ();
+    bool                StopDbDriver ();
 
-    OGRGeometry		*GetFeatureGeometry ( long nFeatureId, int *cat );
-    bool		SetAttributes ( OGRFeature *feature, dbTable *table );
+    OGRGeometry         *GetFeatureGeometry ( long nFeatureId, int *cat );
+    bool                SetAttributes ( OGRFeature *feature, dbTable *table );
 
     // Features matching spatial filter for ALL features/elements in GRASS
-    char 		*paSpatialMatch;
-    bool 		SetSpatialMatch();
+    char                *paSpatialMatch;
+    bool                SetSpatialMatch();
 
     // Features matching attribute filter for ALL features/elements in GRASS
-    char 		*paQueryMatch;
-    bool 		OpenSequentialCursor();
-    bool 		ResetSequentialCursor();
-    bool 		SetQueryMatch();
+    char                *paQueryMatch;
+    bool                OpenSequentialCursor();
+    bool                ResetSequentialCursor();
+    bool                SetQueryMatch();
 };
 
 /************************************************************************/
@@ -134,33 +129,26 @@ class OGRGRASSDataSource : public OGRDataSource
 {
   public:
                         OGRGRASSDataSource();
-                        ~OGRGRASSDataSource();
+                        virtual ~OGRGRASSDataSource();
 
     int                 Open( const char *, int bUpdate, int bTestOpen,
                               int bSingleNewFile = FALSE );
 
-    const char          *GetName() { return pszName; }
-    int                 GetLayerCount() { return nLayers; }
-    OGRLayer            *GetLayer( int );
-
-    int                 TestCapability( const char * );
-
-    // Not implemented (returns NULL):
-    virtual OGRLayer    *ICreateLayer( const char *,
-                                      OGRSpatialReference * = NULL,
-                                      OGRwkbGeometryType = wkbUnknown,
-                                      char ** = NULL );
+    const char          *GetName() override { return pszName; }
+    int                 GetLayerCount() override { return nLayers; }
+    OGRLayer            *GetLayer( int ) override;
 
+    int                 TestCapability( const char * ) override;
 
   private:
     OGRGRASSLayer     **papoLayers;
-    char                *pszName;	// Date source name
-    char		*pszGisdbase;	// GISBASE
-    char		*pszLocation;	// location name
-    char		*pszMapset;	// mapset name
-    char		*pszMap;	// name of vector map
+    char                *pszName;       // Date source name
+    char                *pszGisdbase;   // GISBASE
+    char                *pszLocation;   // location name
+    char                *pszMapset;     // mapset name
+    char                *pszMap;        // name of vector map
 
-    struct Map_info 	map;
+    struct Map_info     map;
     int                 nLayers;
 
     int                 bOpened;
@@ -174,17 +162,12 @@ class OGRGRASSDataSource : public OGRDataSource
 class OGRGRASSDriver : public OGRSFDriver
 {
   public:
-			~OGRGRASSDriver();
-
-    const char 		*GetName();
-    OGRDataSource 	*Open( const char *, int );
+                        virtual ~OGRGRASSDriver();
 
-    int                 TestCapability( const char * );
+    const char          *GetName() override;
+    OGRDataSource       *Open( const char *, int ) override;
 
-    // Not implemented (return error/NULL):
-    virtual OGRDataSource *CreateDataSource( const char *pszName,
-	    				     char ** = NULL );
-    OGRErr              DeleteDataSource( const char *pszDataSource );
+    int                 TestCapability( const char * ) override;
 };
 
 #endif /* ndef OGRGRASS_H_INCLUDED */


=====================================
ogrgrassdatasource.cpp
=====================================
--- a/ogrgrassdatasource.cpp
+++ b/ogrgrassdatasource.cpp
@@ -1,5 +1,4 @@
 /******************************************************************************
- * $Id: ogrgrassdatasource.cpp 33713 2016-03-12 17:41:57Z goatbar $
  *
  * Project:  OpenGIS Simple Features Reference Implementation
  * Purpose:  Implements OGRGRASSDataSource class.
@@ -32,7 +31,7 @@
 #include "cpl_conv.h"
 #include "cpl_string.h"
 
-CPL_CVSID("$Id: ogrgrassdatasource.cpp 33713 2016-03-12 17:41:57Z goatbar $");
+CPL_CVSID("$Id: ogrgrassdatasource.cpp 36368 2016-11-21 01:47:49Z rouault $");
 
 #if GRASS_VERSION_MAJOR  >= 7
 #define G__setenv                G_setenv_nogisrc
@@ -41,7 +40,7 @@ CPL_CVSID("$Id: ogrgrassdatasource.cpp 33713 2016-03-12 17:41:57Z goatbar $");
 /************************************************************************/
 /*                         Grass2CPLErrorHook()                         */
 /************************************************************************/
-int Grass2OGRErrorHook( char * pszMessage, int bFatal )
+static int Grass2OGRErrorHook( char * pszMessage, int bFatal )
 {
     if( !bFatal )
         CPLError( CE_Warning, CPLE_AppDefined, "GRASS warning: %s", pszMessage );
@@ -95,8 +94,8 @@ typedef int (*GrassErrorHandler)(const char *, int);
 typedef int (*GrassErrorHandler)(char *, int);
 #endif
 
-int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
-                              int bTestOpen, int bSingleNewFileIn )
+int OGRGRASSDataSource::Open( const char * pszNewName, int /*bUpdate*/,
+                              int bTestOpen, int /*bSingleNewFileIn*/ )
 {
     VSIStatBuf  stat;
 
@@ -110,11 +109,11 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
     if ( strstr(pszName,"vector") == NULL || strstr(pszName,"head") == NULL )
     {
         if( !bTestOpen )
-	{
+        {
             CPLError( CE_Failure, CPLE_AppDefined,
                  "%s is not GRASS vector, access failed.\n", pszName );
-	}
-	return FALSE;
+        }
+        return FALSE;
     }
 
 /* -------------------------------------------------------------------- */
@@ -123,10 +122,10 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
     if( CPLStat( pszName, &stat ) != 0 || !VSI_ISREG(stat.st_mode) )
     {
         if( !bTestOpen )
-	{
+        {
             CPLError( CE_Failure, CPLE_AppDefined,
                  "%s is not GRASS vector, access failed.\n", pszName );
-	}
+        }
 
         return FALSE;
     }
@@ -135,15 +134,15 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
 /*      Parse datasource name                                           */
 /* -------------------------------------------------------------------- */
     if ( !SplitPath(pszName, &pszGisdbase, &pszLocation,
-		    &pszMapset, &pszMap) )
+                    &pszMapset, &pszMap) )
     {
         if( !bTestOpen )
-	{
+        {
             CPLError( CE_Failure, CPLE_AppDefined,
                       "%s is not GRASS datasource name, access failed.\n",
-		      pszName );
-	}
-	return FALSE;
+                      pszName );
+        }
+        return FALSE;
     }
 
     CPLDebug ( "GRASS", "Gisdbase: %s", pszGisdbase );
@@ -202,7 +201,7 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
     if ( level < 2 ) {
         CPLError( CE_Failure, CPLE_AppDefined,
                  "Cannot open GRASS vector %s on level 2.\n", pszName );
-	return FALSE;
+        return FALSE;
     }
 
     CPLDebug ( "GRASS", "Num lines = %d", Vect_get_num_lines(&map) );
@@ -214,15 +213,13 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
     CPLDebug ( "GRASS", "Num layers = %d", ncidx );
 
     for ( int i = 0; i < ncidx; i++ ) {
-	// Create the layer object
-	OGRGRASSLayer       *poLayer;
-
-        poLayer = new OGRGRASSLayer( i, &map );
+        // Create the layer object
+        OGRGRASSLayer *poLayer = new OGRGRASSLayer( i, &map );
 
         // Add layer to data source layer list
-	papoLayers = (OGRGRASSLayer **)
-	    CPLRealloc( papoLayers,  sizeof(OGRGRASSLayer *) * (nLayers+1) );
-	papoLayers[nLayers++] = poLayer;
+        papoLayers = (OGRGRASSLayer **)
+            CPLRealloc( papoLayers,  sizeof(OGRGRASSLayer *) * (nLayers+1) );
+        papoLayers[nLayers++] = poLayer;
     }
 
     bOpened = TRUE;
@@ -231,25 +228,9 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
 }
 
 /************************************************************************/
-/*                           ICreateLayer()                             */
-/************************************************************************/
-OGRLayer *
-OGRGRASSDataSource::ICreateLayer( const char * pszLayerName,
-                                 OGRSpatialReference *poSRS,
-                                 OGRwkbGeometryType eType,
-                                 char ** papszOptions )
-
-{
-    CPLError( CE_Failure, CPLE_NoWriteAccess,
-	      "CreateLayer is not supported by GRASS driver" );
-
-    return NULL;
-}
-
-/************************************************************************/
 /*                           TestCapability()                           */
 /************************************************************************/
-int OGRGRASSDataSource::TestCapability( const char * pszCap )
+int OGRGRASSDataSource::TestCapability( const char * /* pszCap*/ )
 {
     return FALSE;
 }
@@ -275,7 +256,7 @@ OGRLayer *OGRGRASSDataSource::GetLayer( int iLayer )
 /*          false - failed                                              */
 /************************************************************************/
 bool OGRGRASSDataSource::SplitPath( char *path, char **gisdbase,
-	                     char **location, char **mapset, char **map )
+                                    char **location, char **mapset, char **map )
 {
     char *p, *ptr[5], *tmp;
     int  i = 0;
@@ -285,23 +266,23 @@ bool OGRGRASSDataSource::SplitPath( char *path, char **gisdbase,
     *gisdbase = *location = *mapset = *map = NULL;
 
     if ( !path || strlen(path) == 0 )
-	return false;
+        return false;
 
     tmp = G_store ( path );
 
     while ( (p = strrchr(tmp,'/')) != NULL  && i < 5 ) {
-	*p = '\0';
+        *p = '\0';
 
-	if ( strlen(p+1) == 0 ) /* repeated '/' */
-	    continue;
+        if ( strlen(p+1) == 0 ) /* repeated '/' */
+            continue;
 
-	ptr[i++] = p+1;
+        ptr[i++] = p+1;
     }
 
     /* Note: empty GISDBASE == 0 is not accepted (relative path) */
     if ( i != 5 ) {
         free ( tmp );
-	return false;
+        return false;
     }
 
     if ( strcmp(ptr[0],"head") != 0 || strcmp(ptr[2],"vector") != 0 ) {


=====================================
ogrgrassdriver.cpp
=====================================
--- a/ogrgrassdriver.cpp
+++ b/ogrgrassdriver.cpp
@@ -1,5 +1,4 @@
 /******************************************************************************
- * $Id: ogrgrassdriver.cpp 32110 2015-12-10 17:19:40Z goatbar $
  *
  * Project:  OpenGIS Simple Features Reference Implementation
  * Purpose:  Implements OGRGRASSDriver class.
@@ -31,7 +30,7 @@
 #include "cpl_conv.h"
 #include "cpl_string.h"
 
-CPL_CVSID("$Id: ogrgrassdriver.cpp 32110 2015-12-10 17:19:40Z goatbar $");
+CPL_CVSID("$Id: ogrgrassdriver.cpp 36368 2016-11-21 01:47:49Z rouault $");
 
 /************************************************************************/
 /*                          ~OGRGRASSDriver()                           */
@@ -54,9 +53,7 @@ const char *OGRGRASSDriver::GetName()
 OGRDataSource *OGRGRASSDriver::Open( const char * pszFilename,
                                      int bUpdate )
 {
-    OGRGRASSDataSource  *poDS;
-
-    poDS = new OGRGRASSDataSource();
+    OGRGRASSDataSource  *poDS = new OGRGRASSDataSource();
 
     if( !poDS->Open( pszFilename, bUpdate, TRUE ) )
     {
@@ -70,32 +67,9 @@ OGRDataSource *OGRGRASSDriver::Open( const char * pszFilename,
 }
 
 /************************************************************************/
-/*                          CreateDataSource()                          */
-/************************************************************************/
-OGRDataSource *OGRGRASSDriver::CreateDataSource( const char * pszName,
-                                                 char **papszOptions )
-{
-    CPLError( CE_Failure, CPLE_AppDefined,
-              "CreateDataSource is not supported by GRASS driver.\n" );
-
-    return NULL;
-}
-
-/************************************************************************/
-/*                          DeleteDataSource()                          */
-/************************************************************************/
-OGRErr OGRGRASSDriver::DeleteDataSource( const char *pszDataSource )
-{
-    CPLError( CE_Failure, CPLE_AppDefined,
-              "DeleteDataSource is not supported by GRASS driver" );
-
-    return OGRERR_FAILURE;
-}
-
-/************************************************************************/
 /*                           TestCapability()                           */
 /************************************************************************/
-int OGRGRASSDriver::TestCapability( const char * pszCap )
+int OGRGRASSDriver::TestCapability( const char * /*pszCap*/ )
 {
     return FALSE;
 }
@@ -120,4 +94,3 @@ void RegisterOGRGRASS()
 
     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
 }
-


=====================================
ogrgrasslayer.cpp
=====================================
--- a/ogrgrasslayer.cpp
+++ b/ogrgrasslayer.cpp
@@ -1,5 +1,4 @@
 /******************************************************************************
- * $Id: ogrgrasslayer.cpp 33713 2016-03-12 17:41:57Z goatbar $
  *
  * Project:  OpenGIS Simple Features Reference Implementation
  * Purpose:  Implements OGRGRASSLayer class.
@@ -32,7 +31,7 @@
 #include "ogrgrass.h"
 #include "cpl_conv.h"
 
-CPL_CVSID("$Id: ogrgrasslayer.cpp 33713 2016-03-12 17:41:57Z goatbar $");
+CPL_CVSID("$Id: ogrgrasslayer.cpp 36368 2016-11-21 01:47:49Z rouault $");
 
 /************************************************************************/
 /*                           OGRGRASSLayer()                            */
@@ -50,6 +49,7 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
     pszQuery = NULL;
     paQueryMatch = NULL;
     paSpatialMatch = NULL;
+    iCurrentCat = 0;
 
     iLayer = Vect_cidx_get_field_number ( poMap, iLayerIndex);
     CPLDebug ( "GRASS", "iLayer = %d", iLayer );
@@ -59,13 +59,13 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
     // Layer name
     if ( poLink && poLink->name )
     {
-	pszName = CPLStrdup( poLink->name );
+        pszName = CPLStrdup( poLink->name );
     }
     else
     {
-	char buf[20];
-	sprintf ( buf, "%d", iLayer );
-	pszName = CPLStrdup( buf );
+        char buf[20];
+        snprintf ( buf, sizeof(buf), "%d", iLayer );
+        pszName = CPLStrdup( buf );
     }
 
     // Because we don't represent centroids as any simple feature, we have to scan
@@ -78,12 +78,12 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
     int cnt = 0;
     for ( int i = 0; i < n; i++ )
     {
-	int cat,type, id;
+        int cat,type, id;
 
-	Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, i, &cat, &type, &id );
+        Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, i, &cat, &type, &id );
 
-	if ( !( type & (GV_POINT|GV_LINES|GV_AREA) ) ) continue;
-	paFeatureIndex[cnt++] = i;
+        if ( !( type & (GV_POINT|GV_LINES|GV_AREA) ) ) continue;
+        paFeatureIndex[cnt++] = i;
     }
 
     poFeatureDefn = new OGRFeatureDefn( pszName );
@@ -94,10 +94,10 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
     int nTypes = Vect_cidx_get_num_types_by_index ( poMap, iLayerIndex );
     int types = 0;
     for ( int i = 0; i < nTypes; i++ ) {
-	int type, count;
-	Vect_cidx_get_type_count_by_index ( poMap, iLayerIndex, i, &type, &count);
-	if ( !(type & (GV_POINT|GV_LINES|GV_AREA) ) ) continue;
-	types |= type;
+        int type, count;
+        Vect_cidx_get_type_count_by_index ( poMap, iLayerIndex, i, &type, &count);
+        if ( !(type & (GV_POINT|GV_LINES|GV_AREA) ) ) continue;
+        types |= type;
         CPLDebug ( "GRASS", "type = %d types = %d", type, types );
     }
 
@@ -131,72 +131,71 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
     db_init_string ( poDbString );
     if ( poLink )
     {
-	if ( StartDbDriver() )
-	{
-	    db_set_string ( poDbString, poLink->table );
-	    dbTable *table;
-	    if ( db_describe_table ( poDriver, poDbString, &table) == DB_OK )
-	    {
-		nFields = db_get_table_number_of_columns ( table );
-		iCatField = -1;
-		for ( int i = 0; i < nFields; i++)
-		{
-		    dbColumn *column = db_get_table_column ( table, i );
-		    int ctype = db_sqltype_to_Ctype ( db_get_column_sqltype(column) );
-
-		    OGRFieldType ogrFtype = OFTInteger;
- 	     	    switch ( ctype ) {
-			 case DB_C_TYPE_INT:
-			    ogrFtype = OFTInteger;
-			    break;
-			 case DB_C_TYPE_DOUBLE:
-			    ogrFtype = OFTReal;
-			    break;
-			 case DB_C_TYPE_STRING:
-			    ogrFtype = OFTString;
-			    break;
-			 case DB_C_TYPE_DATETIME:
-			    ogrFtype = OFTDateTime;
-			    break;
-		    }
-
-		    CPLDebug ( "GRASS", "column = %s type = %d",
-			       db_get_column_name(column), ctype );
-
-		    OGRFieldDefn oField ( db_get_column_name(column), ogrFtype );
-		    poFeatureDefn->AddFieldDefn( &oField );
-
-		    if ( G_strcasecmp(db_get_column_name(column),poLink->key) == 0 )
-		    {
-			iCatField = i;
-		    }
-		}
-		if ( iCatField >= 0  )
-		{
-    		    bHaveAttributes = true;
-		}
-		else
-		{
-		    CPLError( CE_Failure, CPLE_AppDefined, "Cannot find key field" );
-		    db_close_database_shutdown_driver ( poDriver );
-		    poDriver = NULL;
+        if ( StartDbDriver() )
+        {
+            db_set_string ( poDbString, poLink->table );
+            dbTable *table = NULL;
+            if ( db_describe_table ( poDriver, poDbString, &table) == DB_OK )
+            {
+                nFields = db_get_table_number_of_columns ( table );
+                iCatField = -1;
+                for ( int i = 0; i < nFields; i++)
+                {
+                    dbColumn *column = db_get_table_column ( table, i );
+                    int ctype = db_sqltype_to_Ctype ( db_get_column_sqltype(column) );
+
+                    OGRFieldType ogrFtype = OFTInteger;
+                    switch ( ctype ) {
+                         case DB_C_TYPE_INT:
+                            ogrFtype = OFTInteger;
+                            break;
+                         case DB_C_TYPE_DOUBLE:
+                            ogrFtype = OFTReal;
+                            break;
+                         case DB_C_TYPE_STRING:
+                            ogrFtype = OFTString;
+                            break;
+                         case DB_C_TYPE_DATETIME:
+                            ogrFtype = OFTDateTime;
+                            break;
+                    }
+
+                    CPLDebug ( "GRASS", "column = %s type = %d",
+                               db_get_column_name(column), ctype );
+
+                    OGRFieldDefn oField ( db_get_column_name(column), ogrFtype );
+                    poFeatureDefn->AddFieldDefn( &oField );
+
+                    if ( G_strcasecmp(db_get_column_name(column),poLink->key) == 0 )
+                    {
+                        iCatField = i;
+                    }
+                }
+                if ( iCatField >= 0  )
+                {
+                    bHaveAttributes = true;
+                }
+                else
+                {
+                    CPLError( CE_Failure, CPLE_AppDefined, "Cannot find key field" );
+                    db_close_database_shutdown_driver ( poDriver );
+                    poDriver = NULL;
                 }
             }
-	    else
+            else
             {
-		CPLError( CE_Failure, CPLE_AppDefined, "Cannot describe table %s",
-			  poLink->table );
-
+                CPLError( CE_Failure, CPLE_AppDefined, "Cannot describe table %s",
+                          poLink->table );
             }
-	    db_close_database_shutdown_driver ( poDriver );
-	    poDriver = NULL;
+            db_close_database_shutdown_driver ( poDriver );
+            poDriver = NULL;
         }
     }
 
     if ( !bHaveAttributes && iLayer > 0 ) // Because features in layer 0 have no cats
     {
-	OGRFieldDefn oField("cat", OFTInteger);
-	poFeatureDefn->AddFieldDefn( &oField );
+        OGRFieldDefn oField("cat", OFTInteger);
+        poFeatureDefn->AddFieldDefn( &oField );
     }
 
     if ( getenv("GISBASE") )  // We have some projection info in GISBASE
@@ -208,13 +207,13 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex,  struct Map_info * map )
         // where those variables are set
 
         projinfo = G_get_projinfo();
-	projunits = G_get_projunits();
+        projunits = G_get_projunits();
 
-	char *srsWkt = GPJ_grass_to_wkt ( projinfo, projunits, 0, 0);
+        char *srsWkt = GPJ_grass_to_wkt ( projinfo, projunits, 0, 0);
         if ( srsWkt )
         {
-	    poSRS = new OGRSpatialReference ( srsWkt );
-	    G_free ( srsWkt );
+            poSRS = new OGRSpatialReference ( srsWkt );
+            G_free ( srsWkt );
         }
 
         G_free_key_value(projinfo);
@@ -229,12 +228,12 @@ OGRGRASSLayer::~OGRGRASSLayer()
 {
     if ( bCursorOpened )
     {
-	db_close_cursor ( poCursor);
+        db_close_cursor ( poCursor);
     }
 
     if ( poDriver )
     {
-	StopDbDriver();
+        StopDbDriver();
     }
 
     if ( pszName ) CPLFree ( pszName );
@@ -271,16 +270,16 @@ bool OGRGRASSLayer::StartDbDriver()
 
     if ( !poLink )
     {
-	return false;
+        return false;
     }
     poDriver = db_start_driver_open_database ( poLink->driver, poLink->database );
 
     if ( poDriver == NULL)
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Cannot open database %s by driver %s, "
-		  "check if GISBASE environment variable is set, the driver is available "
-		  " and the database is accessible.", poLink->driver, poLink->database );
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Cannot open database %s by driver %s, "
+                  "check if GISBASE environment variable is set, the driver is available "
+                  " and the database is accessible.", poLink->driver, poLink->database );
+        return false;
     }
     return true;
 }
@@ -292,8 +291,8 @@ bool OGRGRASSLayer::StopDbDriver()
 {
     if ( !poDriver )
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Driver is not started" );
-	return true; // I think that true is OK here
+        CPLError( CE_Failure, CPLE_AppDefined, "Driver is not started" );
+        return true; // I think that true is OK here
     }
 
     // TODO!!!: Because of bug in GRASS library it is impossible
@@ -341,25 +340,25 @@ OGRErr OGRGRASSLayer::SetNextByIndex( GIntBig nIndex )
 {
     if( m_poFilterGeom != NULL || m_poAttrQuery != NULL )
     {
-	iNextId = 0;
-	int count = 0;
+        iNextId = 0;
+        int count = 0;
 
-	while ( true ) {
-	    if( iNextId >= nTotalCount ) break;
-	    if ( count == nIndex ) break;
+        while ( true ) {
+            if( iNextId >= nTotalCount ) break;
+            if ( count == nIndex ) break;
 
-	    // Attributes
-	    if( pszQuery != NULL && !paQueryMatch[iNextId] ) {
-		iNextId++;
-		continue;
+            // Attributes
+            if( pszQuery != NULL && !paQueryMatch[iNextId] ) {
+                iNextId++;
+                continue;
             }
 
-	    // Spatial
-	    if( m_poFilterGeom && !paSpatialMatch[iNextId] ) {
-		iNextId++;
-		continue;
-	    }
-	    count++;
+            // Spatial
+            if( m_poFilterGeom && !paSpatialMatch[iNextId] ) {
+                iNextId++;
+                continue;
+            }
+            count++;
         }
     }
 
@@ -376,16 +375,16 @@ OGRErr OGRGRASSLayer::SetAttributeFilter( const char *query )
     CPLDebug ( "GRASS", "SetAttributeFilter: %s", query  );
 
     if ( query == NULL ) {
-	// Release old if any
-	if ( pszQuery ) {
-	    CPLFree ( pszQuery );
-	    pszQuery = NULL;
-	}
-	if ( paQueryMatch ) {
-	    CPLFree ( paQueryMatch );
-	    paQueryMatch = NULL;
-	}
-	return OGRERR_NONE;
+        // Release old if any
+        if ( pszQuery ) {
+            CPLFree ( pszQuery );
+            pszQuery = NULL;
+        }
+        if ( paQueryMatch ) {
+            CPLFree ( paQueryMatch );
+            paQueryMatch = NULL;
+        }
+        return OGRERR_NONE;
     }
 
     paQueryMatch = (char *) CPLMalloc ( nTotalCount );
@@ -396,53 +395,53 @@ OGRErr OGRGRASSLayer::SetAttributeFilter( const char *query )
 
     if ( bHaveAttributes ) {
 
-	if ( !poDriver )
-	{
-	    StartDbDriver();
-	}
-
-	if ( poDriver )
-	{
-	    if ( bCursorOpened )
-	    {
-		db_close_cursor ( poCursor );
-		bCursorOpened = false;
-	    }
-	    OpenSequentialCursor();
-	    if ( bCursorOpened )
-	    {
-		SetQueryMatch();
-		db_close_cursor ( poCursor );
-		bCursorOpened = false;
-	    }
-	    else
-	    {
-		CPLFree ( pszQuery );
-		pszQuery = NULL;
-		return OGRERR_FAILURE;
-	    }
-	    db_close_database_shutdown_driver ( poDriver );
-	    poDriver = NULL;
-	}
-	else
-	{
-	    CPLFree ( pszQuery );
-	    pszQuery = NULL;
-	    return OGRERR_FAILURE;
-	}
+        if ( !poDriver )
+        {
+            StartDbDriver();
+        }
+
+        if ( poDriver )
+        {
+            if ( bCursorOpened )
+            {
+                db_close_cursor ( poCursor );
+                bCursorOpened = false;
+            }
+            OpenSequentialCursor();
+            if ( bCursorOpened )
+            {
+                SetQueryMatch();
+                db_close_cursor ( poCursor );
+                bCursorOpened = false;
+            }
+            else
+            {
+                CPLFree ( pszQuery );
+                pszQuery = NULL;
+                return OGRERR_FAILURE;
+            }
+            db_close_database_shutdown_driver ( poDriver );
+            poDriver = NULL;
+        }
+        else
+        {
+            CPLFree ( pszQuery );
+            pszQuery = NULL;
+            return OGRERR_FAILURE;
+        }
     }
     else
     {
-	// Use OGR to evaluate category match
-	for ( int i = 0; i < nTotalCount; i++ )
-	{
-	    OGRFeature *feature = GetFeature(i);
-	    CPLDebug ( "GRASS", "i = %d eval = %d", i, m_poAttrQuery->Evaluate ( feature ) );
-	    if ( m_poAttrQuery->Evaluate ( feature ) )
-	    {
-		paQueryMatch[i] = 1;
-	    }
-	}
+        // Use OGR to evaluate category match
+        for ( int i = 0; i < nTotalCount; i++ )
+        {
+            OGRFeature *feature = GetFeature(i);
+            CPLDebug ( "GRASS", "i = %d eval = %d", i, m_poAttrQuery->Evaluate ( feature ) );
+            if ( m_poAttrQuery->Evaluate ( feature ) )
+            {
+                paQueryMatch[i] = 1;
+            }
+        }
     }
 
     return OGRERR_NONE;
@@ -459,8 +458,8 @@ bool OGRGRASSLayer::SetQueryMatch()
     // this method is called immediately after OpenSequentialCursor()
 
     if ( !bCursorOpened ) {
-	CPLError( CE_Failure, CPLE_AppDefined, "Cursor is not opened.");
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Cursor is not opened.");
+        return false;
     }
 
     int more;
@@ -470,58 +469,58 @@ bool OGRGRASSLayer::SetQueryMatch()
     int ncats = Vect_cidx_get_num_cats_by_index ( poMap, iLayerIndex );
     dbTable *table = db_get_cursor_table ( poCursor );
     while ( true ) {
-	if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
-	{
-	    CPLError( CE_Failure, CPLE_AppDefined, "Cannot fetch attributes.");
-	    return false;
-	}
-	if ( !more ) break;
-
-	dbColumn *column = db_get_table_column ( table, iCatField );
-	dbValue *value = db_get_column_value ( column );
-	int cat = db_get_value_int ( value );
-
-	// NOTE: because of bug in GRASS library it is impossible to use
-	//       Vect_cidx_find_next
-
-	// Go through category index until first record of current category
-	// is found or a category > current is found
-	int cidxcat, type, id;
-	while ( cidx < ncats ) {
-	    Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, cidx,
-		                         &cidxcat, &type, &id );
-
-	    if ( cidxcat < cat ) {
-	    	cidx++;
-		continue;
-	    }
-	    if ( cidxcat > cat ) break; // Not found
-
-	    // We have the category we want, check type
-	    if ( !(type & (GV_POINT|GV_LINES|GV_AREA)) )
-	    {
-	    	cidx++;
-		continue;
-	    }
-
-	    // Both category and type match -> find feature and set it on
-	    while ( true ) {
-		if ( fidx > nTotalCount || paFeatureIndex[fidx] > cidx ) {
-		    // should not happen
-		    break;
-		}
-
-		if ( paFeatureIndex[fidx] == cidx ) {
-		    paQueryMatch[fidx] = 1;
-		    fidx++;
-		    break;
-		}
-		fidx++;
-	    }
-	    cidx++;
-	}
-
-	if ( id < 0 ) continue; // not found
+        if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
+        {
+            CPLError( CE_Failure, CPLE_AppDefined, "Cannot fetch attributes.");
+            return false;
+        }
+        if ( !more ) break;
+
+        dbColumn *column = db_get_table_column ( table, iCatField );
+        dbValue *value = db_get_column_value ( column );
+        int cat = db_get_value_int ( value );
+
+        // NOTE: because of bug in GRASS library it is impossible to use
+        //       Vect_cidx_find_next
+
+        // Go through category index until first record of current category
+        // is found or a category > current is found
+        int cidxcat, type, id;
+        while ( cidx < ncats ) {
+            Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, cidx,
+                                         &cidxcat, &type, &id );
+
+            if ( cidxcat < cat ) {
+                cidx++;
+                continue;
+            }
+            if ( cidxcat > cat ) break; // Not found
+
+            // We have the category we want, check type
+            if ( !(type & (GV_POINT|GV_LINES|GV_AREA)) )
+            {
+                cidx++;
+                continue;
+            }
+
+            // Both category and type match -> find feature and set it on
+            while ( true ) {
+                if ( fidx > nTotalCount || paFeatureIndex[fidx] > cidx ) {
+                    // should not happen
+                    break;
+                }
+
+                if ( paFeatureIndex[fidx] == cidx ) {
+                    paQueryMatch[fidx] = 1;
+                    fidx++;
+                    break;
+                }
+                fidx++;
+            }
+            cidx++;
+        }
+
+        if ( id < 0 ) continue; // not found
     }
 
     return true;
@@ -536,41 +535,41 @@ bool OGRGRASSLayer::OpenSequentialCursor()
 
     if ( !poDriver )
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Driver not opened.");
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Driver not opened.");
+        return false;
     }
 
     if ( bCursorOpened )
     {
-	db_close_cursor ( poCursor );
-	bCursorOpened = false;
+        db_close_cursor ( poCursor );
+        bCursorOpened = false;
     }
 
     char buf[2000];
-    sprintf ( buf, "SELECT * FROM %s ", poLink->table );
+    snprintf ( buf, sizeof(buf), "SELECT * FROM %s ", poLink->table );
     db_set_string ( poDbString, buf);
 
     if ( pszQuery ) {
-	sprintf ( buf, "WHERE %s ", pszQuery );
-	db_append_string ( poDbString, buf);
+        snprintf ( buf, sizeof(buf), "WHERE %s ", pszQuery );
+        db_append_string ( poDbString, buf);
     }
 
-    sprintf ( buf, "ORDER BY %s", poLink->key);
+    snprintf ( buf, sizeof(buf), "ORDER BY %s", poLink->key);
     db_append_string ( poDbString, buf);
 
     CPLDebug ( "GRASS", "Query: %s", db_get_string(poDbString) );
 
     if ( db_open_select_cursor ( poDriver, poDbString,
-		poCursor, DB_SCROLL) == DB_OK )
+                poCursor, DB_SCROLL) == DB_OK )
     {
-	iCurrentCat = -1;
-	bCursorOpened = true;
-	CPLDebug ( "GRASS", "num rows = %d", db_get_num_rows ( poCursor ) );
+        iCurrentCat = -1;
+        bCursorOpened = true;
+        CPLDebug ( "GRASS", "num rows = %d", db_get_num_rows ( poCursor ) );
     }
     else
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Cannot open cursor.");
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Cannot open cursor.");
+        return false;
     }
     return true;
 }
@@ -585,13 +584,13 @@ bool OGRGRASSLayer::ResetSequentialCursor()
     int more;
     if( db_fetch ( poCursor, DB_FIRST, &more) != DB_OK )
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Cannot reset cursor.");
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Cannot reset cursor.");
+        return false;
     }
     if( db_fetch ( poCursor, DB_PREVIOUS, &more) != DB_OK )
     {
-	CPLError( CE_Failure, CPLE_AppDefined, "Cannot reset cursor.");
-	return false;
+        CPLError( CE_Failure, CPLE_AppDefined, "Cannot reset cursor.");
+        return false;
     }
     return true;
 }
@@ -606,12 +605,12 @@ void OGRGRASSLayer::SetSpatialFilter( OGRGeometry * poGeomIn )
     OGRLayer::SetSpatialFilter ( poGeomIn );
 
     if ( poGeomIn == NULL ) {
-	// Release old if any
-    	if ( paSpatialMatch ) {
-	    CPLFree ( paSpatialMatch );
-	    paSpatialMatch = NULL;
-	}
-	return;
+        // Release old if any
+        if ( paSpatialMatch ) {
+            CPLFree ( paSpatialMatch );
+            paSpatialMatch = NULL;
+        }
+        return;
     }
 
     SetSpatialMatch();
@@ -626,51 +625,50 @@ bool OGRGRASSLayer::SetSpatialMatch()
 
     if ( !paSpatialMatch )
     {
-	paSpatialMatch = (char *) CPLMalloc ( nTotalCount );
+        paSpatialMatch = (char *) CPLMalloc ( nTotalCount );
     }
     memset ( paSpatialMatch, 0x0, nTotalCount );
 
-    OGRGeometry *geom;
     OGRLineString *lstring = new OGRLineString();
     lstring->setNumPoints ( 5 );
-    geom = lstring;
+    OGRGeometry *geom = lstring;
 
     for ( int i = 0; i < nTotalCount; i++ ) {
-	int cidx = paFeatureIndex[i];
+        int cidx = paFeatureIndex[i];
 
-	int cat, type, id;
+        int cat, type, id;
 
-	Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, cidx, &cat, &type, &id );
+        Vect_cidx_get_cat_by_index ( poMap, iLayerIndex, cidx, &cat, &type, &id );
 
 #if GRASS_VERSION_MAJOR  >= 7
     struct bound_box box;
 #else
-	BOUND_BOX box;
+        BOUND_BOX box;
 #endif
 
-	switch ( type )
-	{
-	    case GV_POINT:
-	    case GV_LINE:
-	    case GV_BOUNDARY:
-		Vect_get_line_box ( poMap, id, &box );
-		break;
-
-	    case GV_AREA:
-		Vect_get_area_box ( poMap, id, &box );
-		break;
-	}
-
-	lstring->setPoint( 0, box.W, box.N, 0. );
-	lstring->setPoint( 1, box.W, box.S, 0. );
-	lstring->setPoint( 2, box.E, box.S, 0. );
-	lstring->setPoint( 3, box.E, box.N, 0. );
-	lstring->setPoint( 4, box.W, box.N, 0. );
-
-	if ( FilterGeometry(geom) ) {
-    	    CPLDebug ( "GRASS", "Feature %d in filter", i );
-	    paSpatialMatch[i] = 1;
-	}
+        switch ( type )
+        {
+            case GV_POINT:
+            case GV_LINE:
+            case GV_BOUNDARY:
+                Vect_get_line_box ( poMap, id, &box );
+                break;
+
+            case GV_AREA:
+                Vect_get_area_box ( poMap, id, &box );
+                break;
+        }
+
+        lstring->setPoint( 0, box.W, box.N, 0. );
+        lstring->setPoint( 1, box.W, box.S, 0. );
+        lstring->setPoint( 2, box.E, box.S, 0. );
+        lstring->setPoint( 3, box.E, box.N, 0. );
+        lstring->setPoint( 4, box.W, box.N, 0. );
+
+        if ( FilterGeometry(geom) ) {
+            CPLDebug ( "GRASS", "Feature %d in filter", i );
+            paSpatialMatch[i] = 1;
+        }
     }
     delete lstring;
     return true;
@@ -688,36 +686,36 @@ OGRFeature *OGRGRASSLayer::GetNextFeature()
 
     // Get next iNextId
     while ( true ) {
-	if( iNextId >= nTotalCount ) // No more features
-	{
-	    // Close cursor / driver if opened
-	    if ( bCursorOpened )
-	    {
-	    	db_close_cursor ( poCursor);
-	    	bCursorOpened = false;
-	    }
-	    if ( poDriver )
-	    {
-    	    	db_close_database_shutdown_driver ( poDriver );
-		poDriver = NULL;
-	    }
-
-	    return NULL;
-	}
-
-	// Attributes
-	if( pszQuery != NULL && !paQueryMatch[iNextId] ) {
-	    iNextId++;
-	    continue;
-	}
-
-	// Spatial
-	if( m_poFilterGeom && !paSpatialMatch[iNextId] ) {
-	    iNextId++;
-	    continue;
-	}
-
-	break; // Attributes & spatial filter match
+        if( iNextId >= nTotalCount ) // No more features
+        {
+            // Close cursor / driver if opened
+            if ( bCursorOpened )
+            {
+                db_close_cursor ( poCursor);
+                bCursorOpened = false;
+            }
+            if ( poDriver )
+            {
+                db_close_database_shutdown_driver ( poDriver );
+                poDriver = NULL;
+            }
+
+            return NULL;
+        }
+
+        // Attributes
+        if( pszQuery != NULL && !paQueryMatch[iNextId] ) {
+            iNextId++;
+            continue;
+        }
+
+        // Spatial
+        if( m_poFilterGeom && !paSpatialMatch[iNextId] ) {
+            iNextId++;
+            continue;
+        }
+
+        break; // Attributes & spatial filter match
     }
 
     OGRGeometry *poOGR = GetFeatureGeometry ( iNextId, &cat );
@@ -731,51 +729,51 @@ OGRFeature *OGRGRASSLayer::GetNextFeature()
     CPLDebug ( "GRASS", "bHaveAttributes = %d", bHaveAttributes );
     if ( bHaveAttributes )
     {
-	if ( !poDriver )
-	{
-	    StartDbDriver();
-	}
-	if ( poDriver ) {
-	    if ( !bCursorOpened )
-	    {
-		OpenSequentialCursor();
-	    }
-	    if ( bCursorOpened )
-	    {
-		dbTable  *table = db_get_cursor_table ( poCursor );
-		if ( iCurrentCat < cat )
-		{
-		    while ( true ) {
-			int more;
-			if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
-			{
-			    CPLError( CE_Failure, CPLE_AppDefined,
-				      "Cannot fetch attributes.");
-			    break;
-			}
-			if ( !more ) break;
-
-			dbColumn *column = db_get_table_column ( table, iCatField );
-			dbValue *value = db_get_column_value ( column );
-			iCurrentCat = db_get_value_int ( value );
-
-			if ( iCurrentCat >= cat ) break;
-		    }
-		}
-		if ( cat == iCurrentCat )
-		{
-		    SetAttributes ( poFeature, table );
-		}
-		else
-		{
-		    CPLError( CE_Failure, CPLE_AppDefined, "Attributes not found.");
-		}
-	    }
-	}
+        if ( !poDriver )
+        {
+            StartDbDriver();
+        }
+        if ( poDriver ) {
+            if ( !bCursorOpened )
+            {
+                OpenSequentialCursor();
+            }
+            if ( bCursorOpened )
+            {
+                dbTable  *table = db_get_cursor_table ( poCursor );
+                if ( iCurrentCat < cat )
+                {
+                    while ( true ) {
+                        int more;
+                        if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
+                        {
+                            CPLError( CE_Failure, CPLE_AppDefined,
+                                      "Cannot fetch attributes.");
+                            break;
+                        }
+                        if ( !more ) break;
+
+                        dbColumn *column = db_get_table_column ( table, iCatField );
+                        dbValue *value = db_get_column_value ( column );
+                        iCurrentCat = db_get_value_int ( value );
+
+                        if ( iCurrentCat >= cat ) break;
+                    }
+                }
+                if ( cat == iCurrentCat )
+                {
+                    SetAttributes ( poFeature, table );
+                }
+                else
+                {
+                    CPLError( CE_Failure, CPLE_AppDefined, "Attributes not found.");
+                }
+            }
+        }
     }
     else if ( iLayer > 0 ) // Add category
     {
-	poFeature->SetField( 0, cat );
+        poFeature->SetField( 0, cat );
     }
 
     m_nFeaturesRead++;
@@ -787,7 +785,8 @@ OGRFeature *OGRGRASSLayer::GetNextFeature()
 OGRFeature *OGRGRASSLayer::GetFeature( GIntBig nFeatureId )
 
 {
-    CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeature nFeatureId = %ld", nFeatureId );
+    CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeature nFeatureId = " CPL_FRMT_GIB,
+               nFeatureId );
 
     int cat;
     OGRFeature *poFeature = NULL;
@@ -801,57 +800,57 @@ OGRFeature *OGRGRASSLayer::GetFeature( GIntBig nFeatureId )
     // Get attributes
     if ( bHaveAttributes && !poDriver )
     {
-	StartDbDriver();
+        StartDbDriver();
     }
     if ( poDriver )
     {
-	if ( bCursorOpened )
-	{
-	    db_close_cursor ( poCursor);
-	    bCursorOpened = false;
-	}
-	CPLDebug ( "GRASS", "Open cursor for key = %d", cat );
-	char buf[2000];
-	sprintf ( buf, "SELECT * FROM %s WHERE %s = %d",
-		       poLink->table, poLink->key, cat );
-	db_set_string ( poDbString, buf);
-	if ( db_open_select_cursor ( poDriver, poDbString,
-		    poCursor, DB_SEQUENTIAL) == DB_OK )
-	{
-	    iCurrentCat = cat; // Not important
-	    bCursorOpened = true;
-	}
-	else
-	{
-	    CPLError( CE_Failure, CPLE_AppDefined, "Cannot open cursor.");
-	}
-
-	if ( bCursorOpened )
-	{
-	    int more;
-	    if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
-	    {
-		CPLError( CE_Failure, CPLE_AppDefined, "Cannot fetch attributes.");
-	    }
-	    else
-	    {
-		if ( !more )
-		{
-		    CPLError( CE_Failure, CPLE_AppDefined, "Attributes not found.");
-		}
-		else
-		{
-	    	    dbTable *table = db_get_cursor_table ( poCursor );
-		    SetAttributes ( poFeature, table );
-		}
-	    }
-	    db_close_cursor ( poCursor);
-	    bCursorOpened = false;
-	}
+        if ( bCursorOpened )
+        {
+            db_close_cursor ( poCursor);
+            bCursorOpened = false;
+        }
+        CPLDebug ( "GRASS", "Open cursor for key = %d", cat );
+        char buf[2000];
+        snprintf ( buf, sizeof(buf), "SELECT * FROM %s WHERE %s = %d",
+                       poLink->table, poLink->key, cat );
+        db_set_string ( poDbString, buf);
+        if ( db_open_select_cursor ( poDriver, poDbString,
+                    poCursor, DB_SEQUENTIAL) == DB_OK )
+        {
+            iCurrentCat = cat; // Not important
+            bCursorOpened = true;
+        }
+        else
+        {
+            CPLError( CE_Failure, CPLE_AppDefined, "Cannot open cursor.");
+        }
+
+        if ( bCursorOpened )
+        {
+            int more;
+            if( db_fetch ( poCursor, DB_NEXT, &more) != DB_OK )
+            {
+                CPLError( CE_Failure, CPLE_AppDefined, "Cannot fetch attributes.");
+            }
+            else
+            {
+                if ( !more )
+                {
+                    CPLError( CE_Failure, CPLE_AppDefined, "Attributes not found.");
+                }
+                else
+                {
+                    dbTable *table = db_get_cursor_table ( poCursor );
+                    SetAttributes ( poFeature, table );
+                }
+            }
+            db_close_cursor ( poCursor);
+            bCursorOpened = false;
+        }
     }
     else if ( iLayer > 0 ) // Add category
     {
-	poFeature->SetField( 0, cat );
+        poFeature->SetField( 0, cat );
     }
 
     m_nFeaturesRead++;
@@ -876,9 +875,9 @@ OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
     int bIs3D = Vect_is_3d(poMap);
 
     switch ( type ) {
-	case GV_POINT:
+        case GV_POINT:
         {
-	    Vect_read_line ( poMap, poPoints, poCats, id);
+            Vect_read_line ( poMap, poPoints, poCats, id);
             if (bIs3D)
                 poOGR = new OGRPoint( poPoints->x[0], poPoints->y[0], poPoints->z[0] );
             else
@@ -886,11 +885,11 @@ OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
         }
         break;
 
-	case GV_LINE:
-	case GV_BOUNDARY:
+        case GV_LINE:
+        case GV_BOUNDARY:
         {
-	    Vect_read_line ( poMap, poPoints, poCats, id);
-	    OGRLineString *poOGRLine = new OGRLineString();
+            Vect_read_line ( poMap, poPoints, poCats, id);
+            OGRLineString *poOGRLine = new OGRLineString();
             if (bIs3D)
                 poOGRLine->setPoints( poPoints->n_points,
                                       poPoints->x, poPoints->y, poPoints->z );
@@ -902,15 +901,13 @@ OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
         }
         break;
 
-	case GV_AREA:
+        case GV_AREA:
         {
-	    Vect_get_area_points ( poMap, id, poPoints );
+            Vect_get_area_points ( poMap, id, poPoints );
 
-	    OGRPolygon 		*poOGRPoly;
-	    poOGRPoly = new OGRPolygon();
+            OGRPolygon *poOGRPoly = new OGRPolygon();
 
-	    OGRLinearRing       *poRing;
-	    poRing = new OGRLinearRing();
+            OGRLinearRing *poRing = new OGRLinearRing();
             if (bIs3D)
                 poRing->setPoints( poPoints->n_points,
                                 poPoints->x, poPoints->y, poPoints->z );
@@ -918,15 +915,15 @@ OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
                 poRing->setPoints( poPoints->n_points,
                                 poPoints->x, poPoints->y );
 
-	    poOGRPoly->addRingDirectly( poRing );
+            poOGRPoly->addRingDirectly( poRing );
 
-	    // Islands
-	    int nisles = Vect_get_area_num_isles ( poMap, id );
-	    for ( int i = 0; i < nisles; i++ ) {
-		int isle =  Vect_get_area_isle ( poMap, id, i );
-		Vect_get_isle_points ( poMap, isle, poPoints );
+            // Islands
+            int nisles = Vect_get_area_num_isles ( poMap, id );
+            for ( int i = 0; i < nisles; i++ ) {
+                int isle =  Vect_get_area_isle ( poMap, id, i );
+                Vect_get_isle_points ( poMap, isle, poPoints );
 
-		poRing = new OGRLinearRing();
+                poRing = new OGRLinearRing();
                 if (bIs3D)
                     poRing->setPoints( poPoints->n_points,
                                     poPoints->x, poPoints->y, poPoints->z );
@@ -934,17 +931,17 @@ OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
                     poRing->setPoints( poPoints->n_points,
                                     poPoints->x, poPoints->y );
 
-		poOGRPoly->addRingDirectly( poRing );
-	    }
+                poOGRPoly->addRingDirectly( poRing );
+            }
 
-	    poOGR = poOGRPoly;
+            poOGR = poOGRPoly;
         }
         break;
 
-	default: // Should not happen
+        default: // Should not happen
         {
-	    CPLError( CE_Failure, CPLE_AppDefined, "Unknown GRASS feature type.");
-	    return NULL;
+            CPLError( CE_Failure, CPLE_AppDefined, "Unknown GRASS feature type.");
+            return NULL;
         }
     }
 
@@ -960,50 +957,34 @@ bool OGRGRASSLayer::SetAttributes ( OGRFeature *poFeature, dbTable *table )
 
     for ( int i = 0; i < nFields; i++)
     {
-	dbColumn *column = db_get_table_column ( table, i );
-	dbValue *value = db_get_column_value ( column );
-
-	int ctype = db_sqltype_to_Ctype ( db_get_column_sqltype(column) );
-
-	if ( !db_test_value_isnull(value) )
-	{
-	    switch ( ctype ) {
-		case DB_C_TYPE_INT:
-		    poFeature->SetField( i, db_get_value_int ( value ));
-		    break;
-		case DB_C_TYPE_DOUBLE:
-		    poFeature->SetField( i, db_get_value_double ( value ));
-		    break;
-		case DB_C_TYPE_STRING:
-		    poFeature->SetField( i, db_get_value_string ( value ));
-		    break;
-		case DB_C_TYPE_DATETIME:
-		    db_convert_column_value_to_string ( column, poDbString );
-		    poFeature->SetField( i, db_get_string ( poDbString ));
-		    break;
-	    }
-	}
-
-	db_convert_column_value_to_string ( column, poDbString );
-	//CPLDebug ( "GRASS", "val = %s", db_get_string ( poDbString ));
-    }
-    return true;
-}
+        dbColumn *column = db_get_table_column ( table, i );
+        dbValue *value = db_get_column_value ( column );
 
-/************************************************************************/
-/*                             ISetFeature()                             */
-/************************************************************************/
-OGRErr OGRGRASSLayer::ISetFeature( OGRFeature *poFeature )
-{
-    return OGRERR_FAILURE;
-}
+        int ctype = db_sqltype_to_Ctype ( db_get_column_sqltype(column) );
 
-/************************************************************************/
-/*                           ICreateFeature()                            */
-/************************************************************************/
-OGRErr OGRGRASSLayer::ICreateFeature( OGRFeature *poFeature )
-{
-    return OGRERR_FAILURE;
+        if ( !db_test_value_isnull(value) )
+        {
+            switch ( ctype ) {
+                case DB_C_TYPE_INT:
+                    poFeature->SetField( i, db_get_value_int ( value ));
+                    break;
+                case DB_C_TYPE_DOUBLE:
+                    poFeature->SetField( i, db_get_value_double ( value ));
+                    break;
+                case DB_C_TYPE_STRING:
+                    poFeature->SetField( i, db_get_value_string ( value ));
+                    break;
+                case DB_C_TYPE_DATETIME:
+                    db_convert_column_value_to_string ( column, poDbString );
+                    poFeature->SetField( i, db_get_string ( poDbString ));
+                    break;
+            }
+        }
+
+        db_convert_column_value_to_string ( column, poDbString );
+        // CPLDebug ( "GRASS", "val = %s", db_get_string ( poDbString ));
+    }
+    return true;
 }
 
 /************************************************************************/
@@ -1031,7 +1012,7 @@ GIntBig OGRGRASSLayer::GetFeatureCount( int bForce )
 /*                                                                      */
 /*      Returns OGRERR_NONE/OGRRERR_FAILURE.                            */
 /************************************************************************/
-OGRErr OGRGRASSLayer::GetExtent (OGREnvelope *psExtent, int bForce)
+OGRErr OGRGRASSLayer::GetExtent (OGREnvelope *psExtent, int /*bForce*/)
 {
 #if GRASS_VERSION_MAJOR  >= 7
     struct bound_box box;
@@ -1074,17 +1055,6 @@ int OGRGRASSLayer::TestCapability( const char * pszCap )
 }
 
 /************************************************************************/
-/*                            CreateField()                             */
-/************************************************************************/
-OGRErr OGRGRASSLayer::CreateField( OGRFieldDefn *poField, int bApproxOK )
-{
-    CPLError( CE_Failure, CPLE_NotSupported,
-                  "Can't create fields on a GRASS layer.\n");
-
-    return OGRERR_FAILURE;
-}
-
-/************************************************************************/
 /*                           GetSpatialRef()                            */
 /************************************************************************/
 OGRSpatialReference *OGRGRASSLayer::GetSpatialRef()



View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/compare/f6a3ee3c8c1d41539162ff3a1959f35faec65c44...8cfef0c08581f3faedcaabce4c8b71901f99a819

---
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/compare/f6a3ee3c8c1d41539162ff3a1959f35faec65c44...8cfef0c08581f3faedcaabce4c8b71901f99a819
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-grass-devel/attachments/20180128/99d9bafa/attachment-0001.html>


More information about the Pkg-grass-devel mailing list