[Git][debian-gis-team/gdal-grass][master] 2 commits: Update autopkgtest to also run gdalinfo.

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sat Nov 5 19:49:46 GMT 2022



Bas Couwenberg pushed to branch master at Debian GIS Project / gdal-grass


Commits:
01d9377d by Bas Couwenberg at 2022-11-05T20:45:54+01:00
Update autopkgtest to also run gdalinfo.

- - - - -
36762e47 by Bas Couwenberg at 2022-11-05T20:48:26+01:00
Add upstream patch to fix FTBFS with GDAL 3.6.0. (closes: #1023506)

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/pr13-Add-support-for-GDAL-3.6.0.patch
- + debian/patches/series
- debian/tests/ogrinfo → debian/tests/ogrinfo-gdalinfo


Changes:

=====================================
debian/changelog
=====================================
@@ -3,6 +3,8 @@ libgdal-grass (1:1.0.1-2) UNRELEASED; urgency=medium
   * Bump Standards-Version to 4.6.1, no changes.
   * Add autopkgtest to catch GDAL/GRASS version errors.
   * Enable Salsa CI.
+  * Add upstream patch to fix FTBFS with GDAL 3.6.0.
+    (closes: #1023506)
 
  -- Bas Couwenberg <sebastic at debian.org>  Tue, 21 Jun 2022 07:07:28 +0200
 


=====================================
debian/patches/pr13-Add-support-for-GDAL-3.6.0.patch
=====================================
@@ -0,0 +1,76 @@
+Description: Add support for GDAL 3.6.0
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/gdal-grass/pull/13
+Bug: https://github.com/OSGeo/gdal-grass/issues/12
+Bug-Debian: https://bugs.debian.org/1023506
+
+--- a/grass.cpp
++++ b/grass.cpp
+@@ -95,7 +95,7 @@ class GRASSDataset final: public GDALDat
+ 
+     struct Cell_head sCellInfo; /* raster region */
+ 
+-    char        *pszProjection;
++    OGRSpatialReference m_oSRS{};
+ 
+     double      adfGeoTransform[6];
+ 
+@@ -103,10 +103,7 @@ class GRASSDataset final: public GDALDat
+     GRASSDataset();
+     ~GRASSDataset() override;
+ 
+-    const char *_GetProjectionRef(void) override;
+-    const OGRSpatialReference* GetSpatialRef() const override {
+-        return GetSpatialRefFromOldGetProjectionRef();
+-    }
++    const OGRSpatialReference* GetSpatialRef() const override;
+     CPLErr GetGeoTransform( double * ) override;
+ 
+     static GDALDataset *Open( GDALOpenInfo * );
+@@ -718,7 +715,7 @@ double GRASSRasterBand::GetNoDataValue(
+ 
+ GRASSDataset::GRASSDataset()
+ {
+-    pszProjection = NULL;
++    m_oSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);
+ 
+     adfGeoTransform[0] = 0.0;
+     adfGeoTransform[1] = 1.0;
+@@ -746,20 +743,15 @@ GRASSDataset::~GRASSDataset()
+ 
+     if ( pszElement )
+         G_free ( pszElement );
+-
+-    G_free( pszProjection );
+ }
+ 
+ /************************************************************************/
+-/*                          GetProjectionRef()                          */
++/*                          GetSpatialRef()                             */
+ /************************************************************************/
+ 
+-const char *GRASSDataset::_GetProjectionRef()
++const OGRSpatialReference *GRASSDataset::GetSpatialRef() const
+ {
+-    if( pszProjection == NULL )
+-        return "";
+-    else
+-        return pszProjection;
++    return m_oSRS.IsEmpty() ? nullptr : &m_oSRS;
+ }
+ 
+ /************************************************************************/
+@@ -974,9 +966,12 @@ GDALDataset *GRASSDataset::Open( GDALOpe
+ 
+     projinfo = G_get_projinfo();
+     projunits = G_get_projunits();
+-    poDS->pszProjection = GPJ_grass_to_wkt ( projinfo, projunits, 0, 0);
++    char* pszWKT = GPJ_grass_to_wkt ( projinfo, projunits, 0, 0);
+     if (projinfo) G_free_key_value(projinfo);
+     if (projunits) G_free_key_value(projunits);
++    if( pszWKT )
++        poDS->m_oSRS.importFromWkt(pszWKT);
++    G_free( pszWKT );
+ 
+ /* -------------------------------------------------------------------- */
+ /*      Create band information objects.                                */


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+pr13-Add-support-for-GDAL-3.6.0.patch


=====================================
debian/tests/ogrinfo → debian/tests/ogrinfo-gdalinfo
=====================================
@@ -15,6 +15,20 @@ PROJ_NETWORK=ON \
 ogrinfo -so -al ./spearfish*/PERMANENT/vector/roads/head
 RC=$?
 
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+echo
+
+GISBASE="$(ls -d /usr/lib/grass??)" \
+PROJ_NETWORK=ON \
+gdalinfo ./spearfish*/PERMANENT/cellhd/geology
+RC=$?
+
 cd "${OLDPWD}" || exit 1
 rm -rf "${TEMPDIR}"
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/2f622e5520c10bc0a0e52f9210b8c2575432642e...36762e4774a375bf6f3e5d3a9a2c41d017e6047e

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/2f622e5520c10bc0a0e52f9210b8c2575432642e...36762e4774a375bf6f3e5d3a9a2c41d017e6047e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20221105/dc86e30a/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list