libver text;\r
projver text;\r
geosver text;\r
-#if POSTGIS_GDAL_VERSION > 0\r
+#ifdef POSTGIS_GDAL_VERSION\r
gdalver text;\r
#endif\r
libxmlver text;\r
SELECT postgis_lib_version() INTO libver;\r
SELECT postgis_proj_version() INTO projver;\r
SELECT postgis_geos_version() INTO geosver;\r
-#if POSTGIS_GDAL_VERSION > 0\r
+#ifdef POSTGIS_GDAL_VERSION\r
SELECT postgis_gdal_version() INTO gdalver;\r
#endif\r
SELECT postgis_libxml_version() INTO libxmlver;\r
fullver = fullver || ' PROJ="' || projver || '"';\r
END IF;\r
\r
-#if POSTGIS_GDAL_VERSION > 0\r
+#ifdef POSTGIS_GDAL_VERSION\r
IF gdalver IS NOT NULL THEN\r
fullver = fullver || ' GDAL="' || gdalver || '"';\r
END IF;\r
#define POSTGIS_LIBXML2_VERSION @POSTGIS_LIBXML2_VERSION@
/*
- * The trailing zero is needed in case POSTGIS_GDAL_VERSION does not exist or has no value
+ * POSTGIS_GDAL_VERSION may not be defined or have a value
*/
-#define POSTGIS_GDAL_VERSION @POSTGIS_GDAL_VERSION@0
+#if @POSTGIS_GDAL_VERSION@0 != 0
+#define POSTGIS_GDAL_VERSION @POSTGIS_GDAL_VERSION@
+#else
+#undef POSTGIS_GDAL_VERSION
+#endif
/*
* Define the build date and the version number
/*
if geometry is a point, a linestring or set of either and bounds not set,
- increase extent by half-pixel to avoid missing points on border
+ increase extent by a pixel to avoid missing points on border
a whole pixel is used instead of half-pixel due to backward
compatibility with GDAL 1.6, 1.7 and 1.8. 1.9+ works fine with half-pixel.
FLT_EQ(_width, 0) &&
FLT_EQ(_height, 0)
) {
- /*
+
+#if POSTGIS_GDAL_VERSION > 18
+ RASTER_DEBUG(3, "Adjusting extent for GDAL > 1.8 by half the scale");
src_env.MinX -= (_scale_x / 2.);
src_env.MaxX += (_scale_x / 2.);
src_env.MinY -= (_scale_y / 2.);
src_env.MaxY += (_scale_y / 2.);
- */
+#else
+ RASTER_DEBUG(3, "Adjusting extent for GDAL <= 1.8 by the scale");
src_env.MinX -= _scale_x;
src_env.MaxX += _scale_x;
src_env.MinY -= _scale_y;
src_env.MaxY += _scale_y;
+#endif
+
}
/* user-defined skew */