[Git][debian-gis-team/gdal-grass][experimental] 15 commits: Revert "Update branch in gbp.conf & Vcs-Git URL."

Bas Couwenberg gitlab at salsa.debian.org
Tue Sep 1 13:07:10 BST 2020



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


Commits:
52e91b81 by Bas Couwenberg at 2020-06-29T15:31:04+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit b9d6db935b28098d1d660055c41f82e0fc7ef0e4.

- - - - -
866364bc by Bas Couwenberg at 2020-06-29T15:31:33+02:00
New upstream version 3.1.1
- - - - -
2cba2484 by Bas Couwenberg at 2020-06-29T15:31:35+02:00
Update upstream source from tag 'upstream/3.1.1'

Update to upstream version '3.1.1'
with Debian dir 8fc4edfaa741db5a8bb388aa8e30fa3cc896b401
- - - - -
5947803a by Bas Couwenberg at 2020-06-29T15:31:52+02:00
New upstream release.

- - - - -
0a754dfe by Bas Couwenberg at 2020-06-29T15:32:10+02:00
Set distribution to unstable.

- - - - -
3374b4f7 by Bas Couwenberg at 2020-07-07T15:17:03+02:00
New upstream version 3.1.2
- - - - -
82c7361b by Bas Couwenberg at 2020-07-07T15:17:05+02:00
Update upstream source from tag 'upstream/3.1.2'

Update to upstream version '3.1.2'
with Debian dir dfc6f77efcc5527ac53f8a8babf1010c978244e4
- - - - -
1412b904 by Bas Couwenberg at 2020-07-07T15:17:24+02:00
New upstream release.

- - - - -
ce4b650b by Bas Couwenberg at 2020-07-07T16:19:16+02:00
Set distribution to unstable.

- - - - -
bc240a71 by Bas Couwenberg at 2020-09-01T11:56:05+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
0b1c56fa by Bas Couwenberg at 2020-09-01T11:56:35+02:00
New upstream version 3.1.3~rc1
- - - - -
7aba61b3 by Bas Couwenberg at 2020-09-01T11:56:36+02:00
Update upstream source from tag 'upstream/3.1.3_rc1'

Update to upstream version '3.1.3~rc1'
with Debian dir 8cb46488f73e3e94c63e8adfcae26923a5682bec
- - - - -
bcfbc4a5 by Bas Couwenberg at 2020-09-01T11:57:09+02:00
New upstream release candidate.

- - - - -
29ffe43d by Bas Couwenberg at 2020-09-01T13:59:19+02:00
Update lintian overrides for renamed tags.

- - - - -
f0b8e11e by Bas Couwenberg at 2020-09-01T13:59:19+02:00
Set distribution to experimental.

- - - - -


5 changed files:

- VERSION
- debian/changelog
- debian/control
- debian/lintian-overrides
- grass57dataset.cpp


Changes:

=====================================
VERSION
=====================================
@@ -1 +1 @@
-3.1.1
+3.1.3


=====================================
debian/changelog
=====================================
@@ -1,3 +1,23 @@
+libgdal-grass (3.1.3~rc1-1~exp1) experimental; urgency=medium
+
+  * New upstream release candidate.
+  * Update lintian overrides for renamed tags.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 01 Sep 2020 11:57:35 +0200
+
+libgdal-grass (3.1.2-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 07 Jul 2020 15:17:33 +0200
+
+libgdal-grass (3.1.1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 29 Jun 2020 15:31:56 +0200
+
 libgdal-grass (3.1.1~rc1-1~exp1) experimental; urgency=medium
 
   * New upstream release candidate.


=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Priority: optional
 Build-Depends: debhelper (>= 10~),
                grass (>= 7.8.3),
                grass-dev (>= 7.8.3),
-               libgdal-dev (>= 3.1.1~),
+               libgdal-dev (>= 3.1.3~),
                libpq-dev,
                lsb-release,
                pkg-config


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


=====================================
grass57dataset.cpp
=====================================
@@ -63,7 +63,7 @@ char *GPJ_grass_to_wkt( struct Key_Value *,
 
 #define GRASS_MAX_COLORS 100000  // what is the right value
 
-CPL_CVSID("$Id: grass57dataset.cpp a5d5ed208537a05de4437e97b6a09b7ba44f76c9 2020-03-24 08:27:48 +0100 Kai Pastor $")
+CPL_CVSID("$Id: grass57dataset.cpp 7aa76ba75c2c4c1b814cf1489838533b56a1946e 2020-08-21 19:19:23 +0200 Markus Metz $")
 
 #if GRASS_VERSION_MAJOR  >= 7
 #define G_get_cellhd             Rast_get_cellhd
@@ -193,6 +193,7 @@ class GRASSRasterBand final: public GDALRasterBand
     double GetNoDataValue( int *pbSuccess = NULL ) override;
 
   private:
+    void SetWindow( struct Cell_head * );
     CPLErr ResetReading( struct Cell_head * );
 };
 
@@ -300,10 +301,8 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
     nBlockYSize = 1;
 
     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;
-    }
+    // open the raster only for actual reading
+    hCell = -1;
     G_copy((void *) &sOpenWindow, (void *) &(poDSIn->sCellInfo), sizeof(struct Cell_head));
 
 /* -------------------------------------------------------------------- */
@@ -413,11 +412,38 @@ GRASSRasterBand::~GRASSRasterBand()
 }
 
 /************************************************************************/
-/*                             ResetReading                             */
+/*                             SetWindow                                */
 /*                                                                      */
-/* Reset current window and reopen cell if the window has changed,      */
+/* Helper for ResetReading                                              */
+/* close the current GRASS raster band, actually set the new window,    */
 /* reset GRASS variables                                                */
 /*                                                                      */
+/* Returns nothing                       */
+/************************************************************************/
+void GRASSRasterBand::SetWindow ( struct Cell_head *sNewWindow )
+{
+    if( hCell >= 0 ) {
+        G_close_cell( hCell );
+        hCell = -1;
+    }
+
+    /* Set window */
+    G_set_window( sNewWindow );
+
+    /* Set GRASS env to the current raster, don't open the 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 );
+}
+
+/************************************************************************/
+/*                             ResetReading                             */
+/*                                                                      */
+/* Reset current window for a new reading request,                      */
+/* close the current GRASS raster band, reset GRASS variables           */
+/*                                                                      */
 /* Returns CE_Failure if fails, otherwise CE_None                       */
 /************************************************************************/
 CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
@@ -429,27 +455,7 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
          sNewWindow->ew_res != sOpenWindow.ew_res || sNewWindow->ns_res != sOpenWindow.ns_res ||
          sNewWindow->rows   != sOpenWindow.rows   || sNewWindow->cols   != sOpenWindow.cols )
     {
-        if( hCell >= 0 ) {
-            G_close_cell( hCell );
-            hCell = -1;
-        }
-
-        /* 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 );
-
-        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;
-        }
-
+        SetWindow ( sNewWindow );
         G_copy((void *) &sOpenWindow, (void *) sNewWindow, sizeof(struct Cell_head));
     }
     else
@@ -465,8 +471,7 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
              sNewWindow->rows   != sCurrentWindow.rows   || sNewWindow->cols   != sCurrentWindow.cols
              )
         {
-            /* Reset window */
-            G_set_window( sNewWindow );
+            SetWindow ( sNewWindow );
         }
     }
 
@@ -488,6 +493,13 @@ CPLErr GRASSRasterBand::IReadBlock( int /*nBlockXOff*/, int nBlockYOff,
     if ( ResetReading ( &(((GRASSDataset *)poDS)->sCellInfo) ) != CE_None ) {
        return CE_Failure;
     }
+    // open for reading
+    if (hCell < 0) {
+        if ( (hCell = G_open_cell_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
+            CPLError( CE_Failure, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
+            return CE_Failure;
+        }
+    }
 
     if ( eDataType == GDT_Byte || eDataType == GDT_UInt16 ) {
         CELL *cbuf = G_allocate_c_raster_buf();
@@ -518,6 +530,10 @@ CPLErr GRASSRasterBand::IReadBlock( int /*nBlockXOff*/, int nBlockYOff,
         G_get_d_raster_row ( hCell, (DCELL *) pImage, nBlockYOff );
     }
 
+    // close to avoid confusion with other GRASS raster bands
+    G_close_cell( hCell );
+    hCell = -1;
+
     return CE_None;
 }
 
@@ -563,6 +579,13 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
     {
         return CE_Failure;
     }
+    // open for reading
+    if (hCell < 0) {
+        if ( (hCell = G_open_cell_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
+            CPLError( CE_Failure, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
+            return CE_Failure;
+        }
+    }
 
     /* Read Data */
     CELL  *cbuf = NULL;
@@ -635,6 +658,10 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
     if ( fbuf ) G_free ( fbuf );
     if ( dbuf ) G_free ( dbuf );
 
+    // close to avoid confusion with other GRASS raster bands
+    G_close_cell( hCell );
+    hCell = -1;
+
     return CE_None;
 }
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/f1e585d1a44b9da2ad43de99b9c269260945a931...f0b8e11e2ce235d12b285e8b50d0f0eb97bbf2bf

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/f1e585d1a44b9da2ad43de99b9c269260945a931...f0b8e11e2ce235d12b285e8b50d0f0eb97bbf2bf
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/20200901/27251b1e/attachment-0001.html>


More information about the Pkg-grass-devel mailing list