[SCM] gdal-grass branch, upstream, updated. upstream/1.7.3-1-g8cb7466
Jerome Villeneuve Larouche
jlarouche at mapgears.com
Fri Jun 15 17:13:21 UTC 2012
The following commit has been merged in the upstream branch:
commit 8cb746679a5c21d25a00347b6e46c90d589cef34
Author: Jerome Villeneuve Larouche <jlarouche at mapgears.com>
Date: Thu Jun 7 15:41:35 2012 +0000
Imported Upstream version 1.9.1
diff --git a/VERSION b/VERSION
index 661e7ae..9ab8337 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.7.3
+1.9.1
diff --git a/configure b/configure
index 16a46a2..cdd9df2 100755
--- a/configure
+++ b/configure
@@ -3014,13 +3014,13 @@ fi
else
# Check for GRASS >= 7.0
- echo "$as_me:$LINENO: checking for G_putenv in -lgrass_gis" >&5
-echo $ECHO_N "checking for G_putenv in -lgrass_gis... $ECHO_C" >&6
-if test "${ac_cv_lib_grass_gis_G_putenv+set}" = set; then
+ echo "$as_me:$LINENO: checking for G_putenv in -lgrass_gis.7.0.svn" >&5
+echo $ECHO_N "checking for G_putenv in -lgrass_gis.7.0.svn... $ECHO_C" >&6
+if test "${ac_cv_lib_grass_gis_7_0_svn_G_putenv+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgrass_gis -L$with_grass/lib -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient -lgrass_dgl -lgrass_dig2 -lgrass_rtree -lgrass_linkm $LIBS"
+LIBS="-lgrass_gis.7.0.svn -L$with_grass/lib -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3065,27 +3065,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_grass_gis_G_putenv=yes
+ ac_cv_lib_grass_gis_7_0_svn_G_putenv=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_grass_gis_G_putenv=no
+ac_cv_lib_grass_gis_7_0_svn_G_putenv=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_grass_gis_G_putenv" >&5
-echo "${ECHO_T}$ac_cv_lib_grass_gis_G_putenv" >&6
-if test $ac_cv_lib_grass_gis_G_putenv = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_grass_gis_7_0_svn_G_putenv" >&5
+echo "${ECHO_T}$ac_cv_lib_grass_gis_7_0_svn_G_putenv" >&6
+if test $ac_cv_lib_grass_gis_7_0_svn_G_putenv = yes; then
GRASS_SETTING=grass7+
else
GRASS_SETTING=no
fi
if test "$GRASS_SETTING" = "grass7+" ; then
- LIBS="-L$with_grass/lib -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient -lgrass_dgl -lgrass_dig2 -lgrass_rtree -lgrass_linkm $LIBS"
+ LIBS="-L$with_grass/lib -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn $LIBS"
GRASS_INCLUDE="-I$with_grass/include"
GRASS_GISBASE="$with_grass"
else
diff --git a/configure.in b/configure.in
index 34539c6..099a9e1 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl ***************************************************************************
-dnl $Id: configure.in 16813 2009-04-21 20:05:19Z rouault $
+dnl $Id: configure.in 20157 2010-07-28 19:32:04Z rouault $
dnl
dnl Project: GDAL GRASS Plugin
dnl Purpose: Configure source file.
@@ -132,9 +132,9 @@ if test "$with_grass" != "yes" ; then
else
# Check for GRASS >= 7.0
- AC_CHECK_LIB(grass_gis,G_putenv,GRASS_SETTING=grass7+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient -lgrass_dgl -lgrass_dig2 -lgrass_rtree -lgrass_linkm)
- if test "$GRASS_SETTING" = "grass7+" ; then
- LIBS="-L$with_grass/lib -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient -lgrass_dgl -lgrass_dig2 -lgrass_rtree -lgrass_linkm $LIBS"
+ AC_CHECK_LIB(grass_gis.7.0.svn,G_putenv,GRASS_SETTING=grass7+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn)
+ if test "$GRASS_SETTING" = "grass7+" ; then
+ LIBS="-L$with_grass/lib -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn $LIBS"
GRASS_INCLUDE="-I$with_grass/include"
GRASS_GISBASE="$with_grass"
else
diff --git a/grass57dataset.cpp b/grass57dataset.cpp
index 128fd5c..a2a3dbf 100644
--- a/grass57dataset.cpp
+++ b/grass57dataset.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: grass57dataset.cpp 18537 2010-01-12 15:05:51Z rblazek $
+ * $Id: grass57dataset.cpp 20157 2010-07-28 19:32:04Z rouault $
*
* Project: GRASS Driver
* Purpose: Implement GRASS raster read/write support
@@ -56,12 +56,37 @@ char *GPJ_grass_to_wkt(struct Key_Value *proj_info,
#define GRASS_MAX_COLORS 100000 // what is the right value
-CPL_CVSID("$Id: grass57dataset.cpp 18537 2010-01-12 15:05:51Z rblazek $");
+CPL_CVSID("$Id: grass57dataset.cpp 20157 2010-07-28 19:32:04Z rouault $");
CPL_C_START
void GDALRegister_GRASS(void);
CPL_C_END
+#if GRASS_VERSION_MAJOR >= 7
+#define G_get_cellhd Rast_get_cellhd
+#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
+#endif
+
/************************************************************************/
/* Grass2CPLErrorHook() */
/************************************************************************/
@@ -308,7 +333,11 @@ GRASSRasterBand::GRASSRasterBand( GRASSDataset *poDS, int nBand,
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;
@@ -713,7 +742,7 @@ GRASSDataset::~GRASSDataset()
if ( pszElement )
G_free ( pszElement );
- CPLFree( pszProjection );
+ G_free( pszProjection );
}
/************************************************************************/
@@ -921,12 +950,16 @@ 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;
+ 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;
diff --git a/ogrgrass.h b/ogrgrass.h
index ad1dec2..45b10e6 100644
--- a/ogrgrass.h
+++ b/ogrgrass.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrgrass.h 15583 2008-10-23 00:04:33Z warmerdam $
+ * $Id: ogrgrass.h 20157 2010-07-28 19:32:04Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Private definitions for OGR/GRASS driver.
@@ -37,7 +37,11 @@ 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
}
/************************************************************************/
diff --git a/ogrgrassdatasource.cpp b/ogrgrassdatasource.cpp
index 530a6e6..565af4a 100644
--- a/ogrgrassdatasource.cpp
+++ b/ogrgrassdatasource.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrgrassdatasource.cpp 16813 2009-04-21 20:05:19Z rouault $
+ * $Id: ogrgrassdatasource.cpp 20157 2010-07-28 19:32:04Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRGRASSDataSource class.
@@ -31,7 +31,7 @@
#include "cpl_conv.h"
#include "cpl_string.h"
-CPL_CVSID("$Id: ogrgrassdatasource.cpp 16813 2009-04-21 20:05:19Z rouault $");
+CPL_CVSID("$Id: ogrgrassdatasource.cpp 20157 2010-07-28 19:32:04Z rouault $");
/************************************************************************/
/* Grass2CPLErrorHook() */
@@ -71,10 +71,10 @@ OGRGRASSDataSource::~OGRGRASSDataSource()
if ( pszName ) CPLFree( pszName );
if ( papoLayers ) CPLFree( papoLayers );
- if ( pszGisdbase ) CPLFree( pszGisdbase );
- if ( pszLocation ) CPLFree( pszLocation );
- if ( pszMapset ) CPLFree( pszMapset );
- if ( pszMap ) CPLFree( pszMap );
+ if ( pszGisdbase ) G_free( pszGisdbase );
+ if ( pszLocation ) G_free( pszLocation );
+ if ( pszMapset ) G_free( pszMapset );
+ if ( pszMap ) G_free( pszMap );
if (bOpened)
Vect_close(&map);
diff --git a/ogrgrasslayer.cpp b/ogrgrasslayer.cpp
index 751db79..d0b6533 100644
--- a/ogrgrasslayer.cpp
+++ b/ogrgrasslayer.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrgrasslayer.cpp 17122 2009-05-25 20:48:40Z rouault $
+ * $Id: ogrgrasslayer.cpp 20157 2010-07-28 19:32:04Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRGRASSLayer class.
@@ -31,7 +31,7 @@
#include "ogrgrass.h"
#include "cpl_conv.h"
-CPL_CVSID("$Id: ogrgrasslayer.cpp 17122 2009-05-25 20:48:40Z rouault $");
+CPL_CVSID("$Id: ogrgrasslayer.cpp 20157 2010-07-28 19:32:04Z rouault $");
/************************************************************************/
/* OGRGRASSLayer() */
@@ -212,7 +212,7 @@ OGRGRASSLayer::OGRGRASSLayer( int layerIndex, struct Map_info * map )
if ( srsWkt )
{
poSRS = new OGRSpatialReference ( srsWkt );
- CPLFree ( srsWkt );
+ G_free ( srsWkt );
}
G_free_key_value(projinfo);
@@ -245,7 +245,7 @@ OGRGRASSLayer::~OGRGRASSLayer()
if ( paFeatureIndex ) CPLFree ( paFeatureIndex );
- if ( poLink ) CPLFree ( poLink );
+ if ( poLink ) G_free ( poLink );
Vect_destroy_line_struct ( poPoints );
Vect_destroy_cats_struct ( poCats );
@@ -640,7 +640,11 @@ 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
switch ( type )
{
@@ -781,7 +785,7 @@ OGRFeature *OGRGRASSLayer::GetNextFeature()
OGRFeature *OGRGRASSLayer::GetFeature( long nFeatureId )
{
- CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeature nFeatureId = %d", nFeatureId );
+ CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeature nFeatureId = %ld", nFeatureId );
int cat;
OGRFeature *poFeature = NULL;
@@ -857,7 +861,7 @@ OGRFeature *OGRGRASSLayer::GetFeature( long nFeatureId )
/************************************************************************/
OGRGeometry *OGRGRASSLayer::GetFeatureGeometry ( long nFeatureId, int *cat )
{
- CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeatureGeometry nFeatureId = %d", nFeatureId );
+ CPLDebug ( "GRASS", "OGRGRASSLayer::GetFeatureGeometry nFeatureId = %ld", nFeatureId );
int cidx = paFeatureIndex[(int)nFeatureId];
@@ -1027,7 +1031,11 @@ int 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 );
--
GRASS extension for the GDAL library
More information about the Pkg-grass-devel
mailing list