[Git][debian-gis-team/gdal-grass][experimental] 12 commits: Revert "Update branch in gbp.conf & Vcs-Git URL."
Bas Couwenberg
gitlab at salsa.debian.org
Mon Oct 26 19:12:34 GMT 2020
Bas Couwenberg pushed to branch experimental at Debian GIS Project / gdal-grass
Commits:
f9305fc8 by Bas Couwenberg at 2020-10-24T07:06:54+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."
This reverts commit 29385ccdfb47a6c7044887f5a6feed7278865e67.
- - - - -
fa34d175 by Bas Couwenberg at 2020-10-24T07:07:05+02:00
New upstream version 3.1.4
- - - - -
ae02a2cf by Bas Couwenberg at 2020-10-24T07:07:06+02:00
Update upstream source from tag 'upstream/3.1.4'
Update to upstream version '3.1.4'
with Debian dir b380b99fc8be38bfaabbca3f8d8a0e57abb0ccea
- - - - -
b13ecfe1 by Bas Couwenberg at 2020-10-24T07:09:02+02:00
New upstream release.
- - - - -
1f37fef6 by Bas Couwenberg at 2020-10-24T07:09:27+02:00
Set distribution to unstable.
- - - - -
107c11d0 by Bas Couwenberg at 2020-10-26T15:18:27+01:00
Update branch in gbp.conf & Vcs-Git URL.
- - - - -
34e08435 by Bas Couwenberg at 2020-10-26T15:19:43+01:00
New upstream version 3.2.0~rc1
- - - - -
a2dd7045 by Bas Couwenberg at 2020-10-26T15:19:44+01:00
Update upstream source from tag 'upstream/3.2.0_rc1'
Update to upstream version '3.2.0~rc1'
with Debian dir 702d3a4e5d4212809a4f50b9d84897a2f4f3c518
- - - - -
603440ad by Bas Couwenberg at 2020-10-26T15:20:10+01:00
New upstream release candidate.
- - - - -
b93efa2f by Bas Couwenberg at 2020-10-26T15:21:49+01:00
Update copyright file.
- - - - -
a0726095 by Bas Couwenberg at 2020-10-26T19:59:16+01:00
Refresh patches.
- - - - -
ab33dfad by Bas Couwenberg at 2020-10-26T19:59:16+01:00
Set distribution to experimental.
- - - - -
12 changed files:
- Makefile.in
- README
- VERSION
- debian/changelog
- debian/control
- debian/copyright
- debian/patches/rpath
- grass57dataset.cpp → grass.cpp
- ogrgrass.h
- ogrgrassdatasource.cpp
- ogrgrassdriver.cpp
- ogrgrasslayer.cpp
Changes:
=====================================
Makefile.in
=====================================
@@ -33,8 +33,8 @@ distclean: clean
rm -fr Makefile config.status config.log autom*.cache
-$(GLIBNAME): grass57dataset.o
- $(LD_SHARED) $(LDFLAGS) grass57dataset.o $(LIBS) -o $(GLIBNAME)
+$(GLIBNAME): grass.o
+ $(LD_SHARED) $(LDFLAGS) grass.o $(LIBS) -o $(GLIBNAME)
$(OLIBNAME): ogrgrassdriver.o ogrgrassdatasource.o ogrgrasslayer.o
$(LD_SHARED) $(LDFLAGS) ogrgrassdriver.o ogrgrassdatasource.o ogrgrasslayer.o $(LIBS) -o $(OLIBNAME)
=====================================
README
=====================================
@@ -13,14 +13,14 @@ build and install GRASS normally and finally build and install this driver.
To build this driver it is necessary for it to find GDAL and GRASS support
files. Typically the configure and build process would look something like:
-./configure --with-gdal=/usr/local/bin/gdal-config --with-grass=/usr/local/grass-7.0.0
+./configure --with-gdal=/usr/local/bin/gdal-config --with-grass=/usr/local/grass-7.0.1
make
sudo make install
See also:
- http://www.gdal.org/
- http://grass.osgeo.org
+ https://gdal.org/
+ https://grass.osgeo.org
---
@@ -31,22 +31,22 @@ FAQs
Question:
-I am trying to install gdal-grass 1.3.1 on Red hat enterprise linux
-advanced server 3.0. I have previously installed gdal 1.3.1 without-
-grass, and Grass 6.0.1 with-gdal. I have tried to configure gdal-grass
+I am trying to install gdal-grass 3.1.3 on RedHat Enterprise Linux
+advanced server 3.0. I have previously installed gdal 3.1.3 --without-grass,
+and GRASS 7.0.1 with GDAL. I have tried to configure gdal-grass
with:
-./configure --with-gdal=/usr/local/gdal/bin/gdal-config --with-
-grass=/usr/local/grass-6.0.1
+./configure --with-gdal=/usr/local/bin/gdal-config \
+ --with-grass=/usr/local/grass-7.0.1
It seems to find gdal alright, but then balks at the Grass location. The
Grass location specified above is indeed the correct location. I have
-also tried adding --with-grass=/usr/local/grass-6.0.1/lib, but with no
+also tried adding --with-grass=/usr/local/grass-7.0.1/lib, but with no
success. My error is:
...
checking for G_asprintf in -lgrass_gis ... no
-configure: error: --with-grass=/usr/local/grass-6.0.1 requested, but
+configure: error: --with-grass=/usr/local/grass-7.0.1 requested, but
libraries not found?
@@ -55,8 +55,8 @@ 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
-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,
+to the library locations of proj (often /usr/local/lib) and grass
+(/usr/local/grass-7.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
=====================================
VERSION
=====================================
@@ -1 +1 @@
-3.1.4
+3.2.0
=====================================
debian/changelog
=====================================
@@ -1,8 +1,17 @@
-libgdal-grass (3.1.4~rc2-1) UNRELEASED; urgency=medium
+libgdal-grass (3.2.0~rc1-1~exp1) experimental; urgency=medium
* New upstream release candidate.
+ * Update copyright file.
+ * Refresh patches.
+
+ -- Bas Couwenberg <sebastic at debian.org> Mon, 26 Oct 2020 15:21:53 +0100
+
+libgdal-grass (3.1.4-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Move from experimental to unstable.
- -- Bas Couwenberg <sebastic at debian.org> Tue, 20 Oct 2020 15:59:16 +0200
+ -- Bas Couwenberg <sebastic at debian.org> Sat, 24 Oct 2020 07:09:09 +0200
libgdal-grass (3.1.4~rc1-1~exp1) experimental; urgency=medium
=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Priority: optional
Build-Depends: debhelper (>= 10~),
grass (>= 7.8.4),
grass-dev (>= 7.8.4),
- libgdal-dev (>= 3.1.4~),
+ libgdal-dev (>= 3.2.0~),
libpq-dev,
lsb-release,
pkg-config
=====================================
debian/copyright
=====================================
@@ -8,8 +8,8 @@ Source: GDAL-GRASS source is extracted from the GDAL source.
from http://www.gdal.org/
Files: *
-Copyright: 1998-2013, Frank Warmerdam <warmerdam at pobox.com>
- 2007-2010, Even Rouault <even dot rouault at spatialys.com>
+Copyright: 2007-2020, Even Rouault <even dot rouault at spatialys.com>
+ 1998-2013, Frank Warmerdam <warmerdam at pobox.com>
2005, Radim Blazek <radim.blazek at gmail.com>
License: MIT
=====================================
debian/patches/rpath
=====================================
@@ -7,9 +7,9 @@ Forwarded: not-needed
@@ -34,10 +34,10 @@ distclean: clean
- $(GLIBNAME): grass57dataset.o
-- $(LD_SHARED) $(LDFLAGS) grass57dataset.o $(LIBS) -o $(GLIBNAME)
-+ $(LD_SHARED) $(LDFLAGS) grass57dataset.o $(LIBS) -o $(GLIBNAME) -Wl,-rpath,/usr/lib/grass78/lib
+ $(GLIBNAME): grass.o
+- $(LD_SHARED) $(LDFLAGS) grass.o $(LIBS) -o $(GLIBNAME)
++ $(LD_SHARED) $(LDFLAGS) grass.o $(LIBS) -o $(GLIBNAME) -Wl,-rpath,/usr/lib/grass78/lib
$(OLIBNAME): ogrgrassdriver.o ogrgrassdatasource.o ogrgrasslayer.o
- $(LD_SHARED) $(LDFLAGS) ogrgrassdriver.o ogrgrassdatasource.o ogrgrasslayer.o $(LIBS) -o $(OLIBNAME)
=====================================
grass57dataset.cpp → grass.cpp
=====================================
@@ -2,14 +2,14 @@
*
* Project: GRASS Driver
* Purpose: Implement GRASS raster read/write support
- * This version is for GRASS 5.7+ and uses GRASS libraries
+ * This version is for GRASS GIS 7+ and uses GRASS libraries
* directly instead of using libgrass.
* Author: Frank Warmerdam <warmerdam at pobox.com>
* Radim Blazek <blazek at itc.it>
*
******************************************************************************
* Copyright (c) 2000 Frank Warmerdam <warmerdam at pobox.com>
- * Copyright (c) 2007-2010, Even Rouault <even dot rouault at spatialys.com>
+ * Copyright (c) 2007-2020, Even Rouault <even dot rouault at spatialys.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -50,48 +50,14 @@ extern "C" {
#include <grass/gprojects.h>
#include <grass/gis.h>
-#if GRASS_VERSION_MAJOR >= 7
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 );
-#endif
}
#define GRASS_MAX_COLORS 100000 // what is the right value
-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
-#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
-#define G_set_c_null_value Rast_set_c_null_value
-#define G_set_f_null_value Rast_set_f_null_value
-#define G_set_d_null_value Rast_set_d_null_value
-#define G_open_cell_old Rast_open_old
-#define G_copy memcpy
-#define G_read_colors Rast_read_colors
-#define G_get_color_range Rast_get_c_color_range
-#define G_colors_count Rast_colors_count
-#define G_get_f_color_rule Rast_get_fp_color_rule
-#define G_free_colors Rast_free_colors
-#define G_close_cell Rast_close
-#define G_allocate_c_raster_buf Rast_allocate_c_buf
-#define G_get_c_raster_row Rast_get_c_row
-#define G_is_c_null_value Rast_is_c_null_value
-#define G_get_f_raster_row Rast_get_f_row
-#define G_get_d_raster_row Rast_get_d_row
-#define G_allocate_f_raster_buf Rast_allocate_f_buf
-#define G_allocate_d_raster_buf Rast_allocate_d_buf
-#define G__setenv G_setenv_nogisrc
-#endif
+CPL_CVSID("$Id: grass.cpp a832da5b936bac8438f9c50e7c20e563fd94c9ff 2020-09-22 13:06:27 +0200 Markus Neteler $")
/************************************************************************/
/* Grass2CPLErrorHook() */
@@ -217,15 +183,15 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
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 );
+ Rast_get_cellhd( (char *) pszCellName, (char *) pszMapset, &sCellInfo );
+ nGRSType = Rast_map_type( (char *) pszCellName, (char *) pszMapset );
/* -------------------------------------------------------------------- */
/* Get min/max values. */
/* -------------------------------------------------------------------- */
struct FPRange sRange;
- if( G_read_fp_range( (char *) pszCellName, (char *) pszMapset,
+ if( Rast_read_fp_range( (char *) pszCellName, (char *) pszMapset,
&sRange ) == -1 )
{
bHaveMinMax = FALSE;
@@ -233,7 +199,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
else
{
bHaveMinMax = TRUE;
- G_get_fp_range_min_max( &sRange, &dfCellMin, &dfCellMax );
+ Rast_get_fp_range_min_max( &sRange, &dfCellMin, &dfCellMax );
}
/* -------------------------------------------------------------------- */
@@ -268,15 +234,14 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
} else { // maximum is not known or full range is used
CELL cval;
this->eDataType = GDT_Int32;
- G_set_c_null_value ( &cval, 1);
+ Rast_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);
+ Rast_set_c_null_value ( &cval, 1);
dfNoData = (double) cval;
nativeNulls = true;
}
@@ -284,7 +249,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
else if( nGRSType == FCELL_TYPE ) {
FCELL fval;
this->eDataType = GDT_Float32;
- G_set_f_null_value ( &fval, 1);
+ Rast_set_f_null_value ( &fval, 1);
dfNoData = (double) fval;
nativeNulls = true;
}
@@ -292,7 +257,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
{
DCELL dval;
this->eDataType = GDT_Float64;
- G_set_d_null_value ( &dval, 1);
+ Rast_set_d_null_value ( &dval, 1);
dfNoData = (double) dval;
nativeNulls = true;
}
@@ -300,21 +265,21 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
nBlockXSize = poDSIn->nRasterXSize;
nBlockYSize = 1;
- G_set_window( &(poDSIn->sCellInfo) );
+ Rast_set_window ( &(poDSIn->sCellInfo) );
// open the raster only for actual reading
hCell = -1;
- G_copy((void *) &sOpenWindow, (void *) &(poDSIn->sCellInfo), sizeof(struct Cell_head));
+ memcpy((void *) &sOpenWindow, (void *) &(poDSIn->sCellInfo), sizeof(struct Cell_head));
/* -------------------------------------------------------------------- */
/* Do we have a color table? */
/* -------------------------------------------------------------------- */
poCT = NULL;
- if( G_read_colors( (char *) pszCellName, (char *) pszMapset, &sGrassColors ) == 1 )
+ if( Rast_read_colors( (char *) pszCellName, (char *) pszMapset, &sGrassColors ) == 1 )
{
int maxcolor;
CELL min, max;
- G_get_color_range ( &min, &max, &sGrassColors);
+ Rast_get_c_color_range ( &min, &max, &sGrassColors);
if ( bHaveMinMax ) {
if ( max < dfCellMax ) {
@@ -341,11 +306,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
int nRed, nGreen, nBlue;
GDALColorEntry sColor;
-#if GRASS_VERSION_MAJOR >= 7
if( Rast_get_c_color( &iColor, &nRed, &nGreen, &nBlue, &sGrassColors ) )
-#else
- if( G_get_color( iColor, &nRed, &nGreen, &nBlue, &sGrassColors ) )
-#endif
{
sColor.c1 = nRed;
sColor.c2 = nGreen;
@@ -367,7 +328,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
/* Create metadata entries for color table rules */
char key[200], value[200];
- int rcount = G_colors_count ( &sGrassColors );
+ int rcount = Rast_colors_count ( &sGrassColors );
snprintf ( value, sizeof(value), "%d", rcount );
this->SetMetadataItem( "COLOR_TABLE_RULES_COUNT", value );
@@ -377,7 +338,7 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
DCELL val1, val2;
unsigned char r1, g1, b1, r2, g2, b2;
- G_get_f_color_rule ( &val1, &r1, &g1, &b1, &val2, &r2, &g2, &b2, &sGrassColors, i );
+ Rast_get_fp_color_rule ( &val1, &r1, &g1, &b1, &val2, &r2, &g2, &b2, &sGrassColors, i );
snprintf ( key, sizeof(key), "COLOR_TABLE_RULE_RGB_%d", rcount-i-1 );
snprintf ( value, sizeof(value), "%e %e %d %d %d %d %d %d", val1, val2, r1, g1, b1, r2, g2, b2 );
@@ -397,12 +358,12 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDSIn, int nBandIn,
GRASSRasterBand::~GRASSRasterBand()
{
if( poCT != NULL ) {
- G_free_colors( &sGrassColors );
+ Rast_free_colors( &sGrassColors );
delete poCT;
}
if( hCell >= 0 )
- G_close_cell( hCell );
+ Rast_close( hCell );
if ( pszCellName )
G_free ( pszCellName );
@@ -423,17 +384,17 @@ GRASSRasterBand::~GRASSRasterBand()
void GRASSRasterBand::SetWindow ( struct Cell_head *sNewWindow )
{
if( hCell >= 0 ) {
- G_close_cell( hCell );
+ Rast_close( hCell );
hCell = -1;
}
/* Set window */
- G_set_window( sNewWindow );
+ Rast_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_setenv_nogisrc( "GISDBASE", ((GRASSDataset *)poDS)->pszGisdbase );
+ G_setenv_nogisrc( "LOCATION_NAME", ((GRASSDataset *)poDS)->pszLocation );
+ G_setenv_nogisrc( "MAPSET", pszMapset);
G_reset_mapsets();
G_add_mapset_to_search_path ( pszMapset );
}
@@ -456,14 +417,14 @@ CPLErr GRASSRasterBand::ResetReading ( struct Cell_head *sNewWindow )
sNewWindow->rows != sOpenWindow.rows || sNewWindow->cols != sOpenWindow.cols )
{
SetWindow ( sNewWindow );
- G_copy((void *) &sOpenWindow, (void *) sNewWindow, sizeof(struct Cell_head));
+ memcpy((void *) &sOpenWindow, (void *) sNewWindow, sizeof(struct Cell_head));
}
else
{
/* The windows are identical, check current window */
struct Cell_head sCurrentWindow;
- G_get_window ( &sCurrentWindow );
+ Rast_get_window ( &sCurrentWindow );
if ( sNewWindow->north != sCurrentWindow.north || sNewWindow->south != sCurrentWindow.south ||
sNewWindow->east != sCurrentWindow.east || sNewWindow->west != sCurrentWindow.west ||
@@ -495,19 +456,19 @@ CPLErr GRASSRasterBand::IReadBlock( int /*nBlockXOff*/, int nBlockYOff,
}
// open for reading
if (hCell < 0) {
- if ( (hCell = G_open_cell_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
+ if ( (hCell = Rast_open_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();
- G_get_c_raster_row ( hCell, cbuf, nBlockYOff );
+ CELL *cbuf = Rast_allocate_c_buf();
+ Rast_get_c_row ( hCell, cbuf, nBlockYOff );
/* Reset NULLs */
for ( int col = 0; col < nBlockXSize; col++ ) {
- if ( G_is_c_null_value(&(cbuf[col])) )
+ if ( Rast_is_c_null_value(&(cbuf[col])) )
cbuf[col] = (CELL) dfNoData;
}
@@ -519,19 +480,19 @@ CPLErr GRASSRasterBand::IReadBlock( int /*nBlockXOff*/, int nBlockYOff,
}
else if ( eDataType == GDT_Int32 )
{
- G_get_c_raster_row ( hCell, (CELL *) pImage, nBlockYOff );
+ Rast_get_c_row ( hCell, (CELL *) pImage, nBlockYOff );
}
else if ( eDataType == GDT_Float32 )
{
- G_get_f_raster_row ( hCell, (FCELL *) pImage, nBlockYOff );
+ Rast_get_f_row ( hCell, (FCELL *) pImage, nBlockYOff );
}
else if ( eDataType == GDT_Float64 )
{
- G_get_d_raster_row ( hCell, (DCELL *) pImage, nBlockYOff );
+ Rast_get_d_row ( hCell, (DCELL *) pImage, nBlockYOff );
}
// close to avoid confusion with other GRASS raster bands
- G_close_cell( hCell );
+ Rast_close( hCell );
hCell = -1;
return CE_None;
@@ -581,7 +542,7 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
}
// open for reading
if (hCell < 0) {
- if ( (hCell = G_open_cell_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
+ if ( (hCell = Rast_open_old((char *) pszCellName, (char *) pszMapset)) < 0 ) {
CPLError( CE_Failure, CPLE_AppDefined, "GRASS: Cannot open raster '%s'", pszCellName );
return CE_Failure;
}
@@ -603,11 +564,11 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
if ( nGRSType == CELL_TYPE && ( !nativeNulls || eBufType != GDT_Int32 || sizeof(CELL) != 4 ||
nPixelSpace != sizeof(CELL) ) )
{
- cbuf = G_allocate_c_raster_buf();
+ cbuf = Rast_allocate_c_buf();
} else if( nGRSType == FCELL_TYPE && ( eBufType != GDT_Float32 || nPixelSpace != sizeof(FCELL) ) ) {
- fbuf = G_allocate_f_raster_buf();
+ fbuf = Rast_allocate_f_buf();
} else if( nGRSType == DCELL_TYPE && ( eBufType != GDT_Float64 || nPixelSpace != sizeof(DCELL) ) ) {
- dbuf = G_allocate_d_raster_buf();
+ dbuf = Rast_allocate_d_buf();
} else {
direct = true;
}
@@ -617,13 +578,13 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
if ( nGRSType == CELL_TYPE ) {
if ( direct ) {
- G_get_c_raster_row ( hCell, (CELL *) pnt, row );
+ Rast_get_c_row ( hCell, (CELL *) pnt, row );
} else {
- G_get_c_raster_row ( hCell, cbuf, row );
+ Rast_get_c_row ( hCell, cbuf, row );
/* Reset NULLs */
for ( int col = 0; col < nBufXSize; col++ ) {
- if ( G_is_c_null_value(&(cbuf[col])) )
+ if ( Rast_is_c_null_value(&(cbuf[col])) )
cbuf[col] = (CELL) dfNoData;
}
@@ -633,9 +594,9 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
}
} else if( nGRSType == FCELL_TYPE ) {
if ( direct ) {
- G_get_f_raster_row ( hCell, (FCELL *) pnt, row );
+ Rast_get_f_row ( hCell, (FCELL *) pnt, row );
} else {
- G_get_f_raster_row ( hCell, fbuf, row );
+ Rast_get_f_row ( hCell, fbuf, row );
GDALCopyWords ( (void *) fbuf, GDT_Float32, sizeof(FCELL),
(void *) pnt, eBufType, nPixelSpace,
@@ -643,9 +604,9 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
}
} else if( nGRSType == DCELL_TYPE ) {
if ( direct ) {
- G_get_d_raster_row ( hCell, (DCELL *) pnt, row );
+ Rast_get_d_row ( hCell, (DCELL *) pnt, row );
} else {
- G_get_d_raster_row ( hCell, dbuf, row );
+ Rast_get_d_row ( hCell, dbuf, row );
GDALCopyWords ( (void *) dbuf, GDT_Float64, sizeof(DCELL),
(void *) pnt, eBufType, nPixelSpace,
@@ -659,7 +620,7 @@ CPLErr GRASSRasterBand::IRasterIO ( GDALRWFlag eRWFlag,
if ( dbuf ) G_free ( dbuf );
// close to avoid confusion with other GRASS raster bands
- G_close_cell( hCell );
+ Rast_close( hCell );
hCell = -1;
return CE_None;
@@ -867,11 +828,7 @@ bool GRASSDataset::SplitPath( char *path, char **gisdbase, char **location,
/* Open() */
/************************************************************************/
-#if (GRASS_VERSION_MAJOR >= 6 && GRASS_VERSION_MINOR >= 3) || GRASS_VERSION_MAJOR >= 7
typedef int (*GrassErrorHandler)(const char *, int);
-#else
-typedef int (*GrassErrorHandler)(char *, int);
-#endif
GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
@@ -936,9 +893,9 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
/* Set GRASS variables */
/* -------------------------------------------------------------------- */
- G__setenv( "GISDBASE", pszGisdb );
- G__setenv( "LOCATION_NAME", pszLoc );
- G__setenv( "MAPSET", pszMapset); // group is searched only in current mapset
+ G_setenv_nogisrc( "GISDBASE", pszGisdb );
+ G_setenv_nogisrc( "LOCATION_NAME", pszLoc );
+ G_setenv_nogisrc( "MAPSET", pszMapset); // group is searched only in current mapset
G_reset_mapsets();
G_add_mapset_to_search_path ( pszMapset );
@@ -996,15 +953,7 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
/* Capture some information from the file that is of interest. */
/* -------------------------------------------------------------------- */
-#if GRASS_VERSION_MAJOR >= 7
Rast_get_cellhd( papszCells[0], papszMapsets[0], &(poDS->sCellInfo) );
-#else
- if( G_get_cellhd( papszCells[0], papszMapsets[0], &(poDS->sCellInfo) ) != 0 ) {
- CPLError( CE_Warning, CPLE_AppDefined, "GRASS: Cannot open raster header");
- delete poDS;
- return NULL;
- }
-#endif
poDS->nRasterXSize = poDS->sCellInfo.cols;
poDS->nRasterYSize = poDS->sCellInfo.rows;
@@ -1069,7 +1018,7 @@ GDALDataset *GRASSDataset::Open( GDALOpenInfo * poOpenInfo )
void GDALRegister_GRASS()
{
- if( !GDAL_CHECK_VERSION( "GDAL/GRASS57 driver" ) )
+ if( !GDAL_CHECK_VERSION( "GDAL/GRASS driver" ) )
return;
if( GDALGetDriverByName( "GRASS" ) != NULL )
@@ -1079,7 +1028,7 @@ void GDALRegister_GRASS()
poDriver->SetDescription( "GRASS" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
- poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "GRASS Rasters (5.7+)" );
+ poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "GRASS Rasters (7+)" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "drivers/raster/grass.html" );
poDriver->pfnOpen = GRASSDataset::Open;
=====================================
ogrgrass.h
=====================================
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrgrass.h 842d122d2f23aaebb28362e083b52d6bc7dbcde2 2019-08-11 17:42:34 +0200 Even Rouault $
+ * $Id: ogrgrass.h a832da5b936bac8438f9c50e7c20e563fd94c9ff 2020-09-22 13:06:27 +0200 Markus Neteler $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Private definitions for OGR/GRASS driver.
@@ -37,11 +37,7 @@ extern "C" {
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
-#if GRASS_VERSION_MAJOR >= 7
#include <grass/vector.h>
-#else
- #include <grass/Vect.h>
-#endif
}
/************************************************************************/
=====================================
ogrgrassdatasource.cpp
=====================================
@@ -6,7 +6,7 @@
*
******************************************************************************
* Copyright (c) 2005, Radim Blazek <radim.blazek at gmail.com>
- * Copyright (c) 2008-2010, Even Rouault <even dot rouault at spatialys.com>
+ * Copyright (c) 2008-2020, Even Rouault <even dot rouault at spatialys.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,11 +31,8 @@
#include "cpl_conv.h"
#include "cpl_string.h"
-CPL_CVSID("$Id: ogrgrassdatasource.cpp b1c9c12ad373e40b955162b45d704070d4ebf7b0 2019-06-19 16:50:15 +0200 Even Rouault $")
+CPL_CVSID("$Id: ogrgrassdatasource.cpp a832da5b936bac8438f9c50e7c20e563fd94c9ff 2020-09-22 13:06:27 +0200 Markus Neteler $")
-#if GRASS_VERSION_MAJOR >= 7
-#define G__setenv G_setenv_nogisrc
-#endif
/************************************************************************/
/* Grass2CPLErrorHook() */
@@ -88,11 +85,7 @@ OGRGRASSDataSource::~OGRGRASSDataSource()
/* Open() */
/************************************************************************/
-#if (GRASS_VERSION_MAJOR >= 6 && GRASS_VERSION_MINOR >= 3) || GRASS_VERSION_MAJOR >= 7
typedef int (*GrassErrorHandler)(const char *, int);
-#else
-typedef int (*GrassErrorHandler)(char *, int);
-#endif
int OGRGRASSDataSource::Open( const char * pszNewName, int /*bUpdate*/,
int bTestOpen, int /*bSingleNewFileIn*/ )
@@ -183,18 +176,15 @@ int OGRGRASSDataSource::Open( const char * pszNewName, int /*bUpdate*/,
/* -------------------------------------------------------------------- */
/* Set GRASS variables */
/* -------------------------------------------------------------------- */
- G__setenv( "GISDBASE", pszGisdbase );
- G__setenv( "LOCATION_NAME", pszLocation );
- G__setenv( "MAPSET", pszMapset);
+ G_setenv_nogisrc( "GISDBASE", pszGisdbase );
+ G_setenv_nogisrc( "LOCATION_NAME", pszLocation );
+ G_setenv_nogisrc( "MAPSET", pszMapset);
G_reset_mapsets();
G_add_mapset_to_search_path ( pszMapset );
/* -------------------------------------------------------------------- */
/* Open GRASS vector map */
/* -------------------------------------------------------------------- */
-#if GRASS_VERSION_MAJOR < 7
- Vect_set_fatal_error ( GV_FATAL_PRINT ); // Print error and continue
-#endif
Vect_set_open_level (2);
int level = Vect_open_old ( &map, pszMap, pszMapset);
=====================================
ogrgrassdriver.cpp
=====================================
@@ -30,7 +30,7 @@
#include "cpl_conv.h"
#include "cpl_string.h"
-CPL_CVSID("$Id: ogrgrassdriver.cpp ff8146d84de7cba8e09d212d5481ea7d2ede3e98 2017-06-27 20:47:31Z Even Rouault $")
+CPL_CVSID("$Id: ogrgrassdriver.cpp 1761acd90777d5bcc49eddbc13c193098f0ed40b 2020-10-01 12:12:00 +0200 Even Rouault $")
/************************************************************************/
/* ~OGRGRASSDriver() */
@@ -90,7 +90,7 @@ void RegisterOGRGRASS()
poDriver->SetDescription( "GRASS" );
poDriver->SetMetadataItem( GDAL_DCAP_VECTOR, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "GRASS Vectors (5.7+)" );
- poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "drv_grass.html" );
+ poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "drivers/vector/grass.html" );
OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
}
=====================================
ogrgrasslayer.cpp
=====================================
@@ -6,7 +6,7 @@
*
******************************************************************************
* Copyright (c) 2005, Radim Blazek <radim.blazek at gmail.com>
- * Copyright (c) 2008-2010, Even Rouault <even dot rouault at spatialys.com>
+ * Copyright (c) 2008-2020, Even Rouault <even dot rouault at spatialys.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,7 +31,7 @@
#include "ogrgrass.h"
#include "cpl_conv.h"
-CPL_CVSID("$Id: ogrgrasslayer.cpp b1c9c12ad373e40b955162b45d704070d4ebf7b0 2019-06-19 16:50:15 +0200 Even Rouault $")
+CPL_CVSID("$Id: ogrgrasslayer.cpp a832da5b936bac8438f9c50e7c20e563fd94c9ff 2020-09-22 13:06:27 +0200 Markus Neteler $")
/************************************************************************/
/* OGRGRASSLayer() */
@@ -641,11 +641,7 @@ bool OGRGRASSLayer::SetSpatialMatch()
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;
-#endif
+ struct bound_box box;
switch ( type )
{
@@ -1013,11 +1009,7 @@ GIntBig OGRGRASSLayer::GetFeatureCount( int bForce )
/************************************************************************/
OGRErr OGRGRASSLayer::GetExtent (OGREnvelope *psExtent, int /*bForce*/)
{
-#if GRASS_VERSION_MAJOR >= 7
struct bound_box box;
-#else
- BOUND_BOX box;
-#endif
Vect_get_map_box ( poMap, &box );
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/64078c0b322859be4b70e70ec0fc4cb895a8086d...ab33dfadbe17cd52f53ac2f44d64deebe383e5da
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal-grass/-/compare/64078c0b322859be4b70e70ec0fc4cb895a8086d...ab33dfadbe17cd52f53ac2f44d64deebe383e5da
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/20201026/ce2c9afe/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list