]> granicus.if.org Git - postgis/commitdiff
Removed hackish use of POSTGIS_GDAL_VERSION in postgis/sqldefines.h.in and postgis...
authorBborie Park <bkpark at ucdavis.edu>
Wed, 5 Oct 2011 04:54:00 +0000 (04:54 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Wed, 5 Oct 2011 04:54:00 +0000 (04:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7948 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis.sql.in.c
postgis/sqldefines.h.in
raster/rt_core/rt_api.c

index c2162856e955e8b9de02d08b83d9fe1514102e53..07403fe5d8f5d1c8877ab878d28c9b3f9801bdfb 100644 (file)
@@ -2205,7 +2205,7 @@ DECLARE
        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
@@ -2217,7 +2217,7 @@ BEGIN
        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
@@ -2235,7 +2235,7 @@ BEGIN
                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
index c14fde6fb47553501c10eddacf5161945913cc02..20df2c399f94de77c8e2bd1e67e8186b9d915441 100644 (file)
 #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
index b30695039ebd533d20a18c6d75c296ed94835dcd..3341ee4c346b08bbb991efd77d50916a5ff23df6 100644 (file)
@@ -7594,7 +7594,7 @@ rt_raster_gdal_rasterize(const unsigned char *wkb,
 
        /*
                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 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.
@@ -7609,16 +7609,21 @@ rt_raster_gdal_rasterize(const unsigned char *wkb,
                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 */