[Git][debian-gis-team/gdal-grass][master] 11 commits: Update branch in gbp.conf & Vcs-Git URL.
Bas Couwenberg
gitlab at salsa.debian.org
Mon Sep 7 13:07:02 BST 2020
Bas Couwenberg pushed to branch master at Debian GIS Project / gdal-grass
Commits:
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.
- - - - -
b173d2f4 by Bas Couwenberg at 2020-09-07T12:51:34+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."
This reverts commit bc240a71ab8c4428318a14fe413ac2716f9c7b54.
- - - - -
666919f8 by Bas Couwenberg at 2020-09-07T12:51:47+02:00
New upstream version 3.1.3
- - - - -
731be747 by Bas Couwenberg at 2020-09-07T12:51:48+02:00
Update upstream source from tag 'upstream/3.1.3'
Update to upstream version '3.1.3'
with Debian dir 676e0ab7ab8a558631d3141d0b02093d64e72652
- - - - -
bf0d23d0 by Bas Couwenberg at 2020-09-07T12:52:36+02:00
New upstream release.
- - - - -
31e61bea by Bas Couwenberg at 2020-09-07T12:52:57+02:00
Set distribution to unstable.
- - - - -
5 changed files:
- VERSION
- debian/changelog
- debian/control
- debian/lintian-overrides
- grass57dataset.cpp
Changes:
=====================================
VERSION
=====================================
@@ -1 +1 @@
-3.1.2
+3.1.3
=====================================
debian/changelog
=====================================
@@ -1,3 +1,16 @@
+libgdal-grass (3.1.3-1) experimental; urgency=medium
+
+ * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org> Mon, 07 Sep 2020 12:52:41 +0200
+
+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.
=====================================
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.2),
+ 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/ce4b650b79d99a4c6929d4c697f81e5bec0234d3...31e61beae1638e3b00da56b9c8c7f966a27f3de5
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/ce4b650b79d99a4c6929d4c697f81e5bec0234d3...31e61beae1638e3b00da56b9c8c7f966a27f3de5
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/20200907/8aceeb3a/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list