From: Mark Cave-Ayland Date: Sat, 14 Jan 2012 00:49:29 +0000 (+0000) Subject: Use normal autoconf convention of using #define to determine whether or not GDALFPOLY... X-Git-Tag: 2.0.0alpha1~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f32b97fdf995eb5b1e99c22deb3de88fc7c1c3d;p=postgis Use normal autoconf convention of using #define to determine whether or not GDALFPOLYGONIZE is present, rather than always having it present and setting its value to either 0 or 1. git-svn-id: http://svn.osgeo.org/postgis/trunk@8810 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index 75002d3be..a998acec9 100644 --- a/configure.ac +++ b/configure.ac @@ -919,7 +919,7 @@ if test "x$RASTER" = "xraster"; then dnl # { dnl Check if the new polygonize function is present AC_CHECK_LIB([gdal], [GDALFPolygonize], [AC_DEFINE_UNQUOTED([GDALFPOLYGONIZE], [1], [Define to 1 if GDALFPolygonize function is available])], - [AC_DEFINE_UNQUOTED([GDALFPOLYGONIZE], [0], [Define to 1 if GDALFPolygonize function is available])]) + []) dnl Extract the linker and include flags LIBGDAL_LDFLAGS=`$GDAL_CONFIG --libs` diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 126286c61..10a4415f2 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -4907,7 +4907,7 @@ rt_raster_dump_as_wktpolygons(rt_raster raster, int nband, int * pnElements) /** * We don't need a raster mask band. Each band has a nodata value. **/ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE GDALFPolygonize(gdal_band, NULL, hLayer, iPixVal, NULL, NULL, NULL); #else GDALPolygonize(gdal_band, NULL, hLayer, iPixVal, NULL, NULL, NULL); diff --git a/raster/test/core/testapi.c b/raster/test/core/testapi.c index 3d23bbaf1..61a81eacf 100644 --- a/raster/test/core/testapi.c +++ b/raster/test/core/testapi.c @@ -2425,7 +2425,7 @@ main() */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[0].val, 1.8)); #else CHECK(FLT_EQ(gv[0].val, 2.0)); @@ -2436,7 +2436,7 @@ main() CHECK_EQUALS_DOUBLE(gv[1].val, 0.0); CHECK(!strcmp(gv[1].geom, "POLYGON ((3 3,3 6,6 6,6 3,3 3))")); -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[2].val, 2.8)); #else CHECK(FLT_EQ(gv[2].val, 3.0)); @@ -2454,7 +2454,7 @@ main() /* Second test: NODATA value = 1.8 */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE rt = fillRasterToPolygonize(1, 1.8); #else rt = fillRasterToPolygonize(1, 2.0); @@ -2474,7 +2474,7 @@ main() } */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK_EQUALS_DOUBLE(gv[1].val, 0.0); CHECK(!strcmp(gv[1].geom, "POLYGON ((3 3,3 6,6 6,6 3,3 3))")); @@ -2499,7 +2499,7 @@ main() deepRelease(rt); /* Third test: NODATA value = 2.8 */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE rt = fillRasterToPolygonize(1, 2.8); #else rt = fillRasterToPolygonize(1, 3.0); @@ -2518,7 +2518,7 @@ main() } */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[0].val, 1.8)); CHECK_EQUALS_DOUBLE(gv[3].val, 0.0); @@ -2555,7 +2555,7 @@ main() } */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[0].val, 1.8)); #else CHECK(FLT_EQ(gv[0].val, 2.0)); @@ -2563,7 +2563,7 @@ main() CHECK(!strcmp(gv[0].geom, "POLYGON ((3 1,3 2,2 2,2 3,1 3,1 6,2 6,2 7,3 7,3 8,5 8,5 6,3 6,3 3,4 3,5 3,5 1,3 1))")); -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[1].val, 2.8)); #else CHECK(FLT_EQ(gv[1].val, 3.0)); @@ -2591,7 +2591,7 @@ main() } */ -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[0].val, 1.8)); #else CHECK(FLT_EQ(gv[0].val, 2.0)); @@ -2602,7 +2602,7 @@ main() CHECK_EQUALS_DOUBLE(gv[1].val, 0.0); CHECK(!strcmp(gv[1].geom, "POLYGON ((3 3,3 6,6 6,6 3,3 3))")); -#if GDALFPOLYGONIZE == 1 +#ifdef GDALFPOLYGONIZE CHECK(FLT_EQ(gv[2].val, 2.8)); #else CHECK(FLT_EQ(gv[2].val, 3.0));