Skip to content
Commits on Source (119)
......@@ -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
......
......@@ -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,6 +3291,49 @@ fi
if test "$with_grass" != "yes" ; then
{ $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 :
......@@ -3365,9 +3420,14 @@ else
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"
......
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_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_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"
......
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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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@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.
......
......@@ -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.
......@@ -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.
# 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
# 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
Description: Add libraries for GRASS 7.2.
Author: Bas Couwenberg <sebastic@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"
......@@ -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
......
......@@ -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))
......
# Test installability
Depends: @
Test-Command: /bin/true
/******************************************************************************
* $Id: grass57dataset.cpp 33893 2016-04-04 14:08:28Z rouault $
*
* Project: GRASS Driver
* Purpose: Implement GRASS raster read/write support
......@@ -64,10 +63,12 @@ char *GPJ_grass_to_wkt(struct Key_Value *,
#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 )
......@@ -134,8 +135,8 @@ class GRASSDataset : public GDALDataset
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 * );
......@@ -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;
// 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 );
......@@ -295,15 +294,15 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDS, int nBand,
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;
}
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? */
......@@ -450,7 +449,6 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
}
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,9 +488,7 @@ CPLErr GRASSRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff,
}
if ( eDataType == GDT_Byte || eDataType == GDT_UInt16 ) {
CELL *cbuf;
cbuf = G_allocate_c_raster_buf();
CELL *cbuf = G_allocate_c_raster_buf();
G_get_c_raster_row ( hCell, cbuf, nBlockYOff );
/* Reset NULLs */
......@@ -507,12 +502,17 @@ CPLErr GRASSRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff,
nBlockXSize );
G_free ( cbuf );
} else if ( eDataType == GDT_Int32 ) {
}
else if ( eDataType == GDT_Int32 )
{
G_get_c_raster_row ( hCell, (CELL *) pImage, nBlockYOff );
} else if ( eDataType == GDT_Float32 ) {
}
else if ( eDataType == GDT_Float32 )
{
G_get_f_raster_row ( hCell, (FCELL *) pImage, nBlockYOff );
} else if ( eDataType == GDT_Float64 ) {
}
else if ( eDataType == GDT_Float64 )
{
G_get_d_raster_row ( hCell, (DCELL *) pImage, nBlockYOff );
}
......@@ -530,7 +530,7 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
GDALDataType eBufType,
GSpacing nPixelSpace,
GSpacing nLineSpace,
GDALRasterIOExtraArg* psExtraArg )
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);
......@@ -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;
}
/************************************************************************/
......@@ -790,10 +793,16 @@ CPLErr GRASSDataset::GetGeoTransform( double * padfGeoTransform )
bool GRASSDataset::SplitPath( char *path, char **gisdbase, char **location,
char **mapset, char **element, char **name )
{
char *p, *ptr[5], *tmp;
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;
......@@ -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;
......@@ -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;
......
/******************************************************************************
* $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.
......@@ -51,34 +51,29 @@ class OGRGRASSLayer : public OGRLayer
{
public:
OGRGRASSLayer( int layer, struct Map_info * map );
~OGRGRASSLayer();
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;
OGRSpatialReference *poSRS;
......@@ -134,23 +129,16 @@ 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;
......@@ -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 */
/******************************************************************************
* $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;
......@@ -215,9 +214,7 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
for ( int i = 0; i < ncidx; i++ ) {
// Create the layer object
OGRGRASSLayer *poLayer;
poLayer = new OGRGRASSLayer( i, &map );
OGRGRASSLayer *poLayer = new OGRGRASSLayer( i, &map );
// Add layer to data source layer list
papoLayers = (OGRGRASSLayer **)
......@@ -230,26 +227,10 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int bUpdate,
return TRUE;
}
/************************************************************************/
/* 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;
}
......
/******************************************************************************
* $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 ) )
{
......@@ -69,33 +66,10 @@ 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 );
}