]> granicus.if.org Git - postgis/commitdiff
Merge branch 'master' into HEAD
authorBborie Park <bkpark at ucdavis.edu>
Tue, 27 Mar 2012 19:25:23 +0000 (19:25 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 27 Mar 2012 19:25:23 +0000 (19:25 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9559 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_core/rt_api.c
raster/rt_core/rt_api.h
raster/rt_pg/rt_pg.c

index fcd8405fff9dcff1855e652cad95548ae038e27b..94e3a893b38ed408b9f79a68f8f541090c8283d4 100644 (file)
@@ -2489,8 +2489,10 @@ rt_band_get_summary_stats(rt_band band, int exclude_nodata_value, double sample,
                                rtn != -1 && (
                                        !exclude_nodata_value || (
                                                exclude_nodata_value &&
-                                               (hasnodata != FALSE) &&
-                                               FLT_NEQ(value, nodata)
+                                               (hasnodata != FALSE) && (
+                                                       FLT_NEQ(value, nodata) &&
+                                                       (rt_band_clamped_value_is_nodata(band, value) != 1)
+                                               )
                                        )
                                )
                        ) {
@@ -3387,8 +3389,10 @@ rt_band_get_quantiles_stream(rt_band band,
                                status != -1 && (
                                        !exclude_nodata_value || (
                                                exclude_nodata_value &&
-                                               (hasnodata != FALSE) &&
-                                               FLT_NEQ(value, nodata)
+                                               (hasnodata != FALSE) && (
+                                                       FLT_NEQ(value, nodata) &&
+                                                       (rt_band_clamped_value_is_nodata(band, value) != 1)
+                                               )
                                        )
                                )
                        ) {
@@ -3976,8 +3980,10 @@ rt_band_get_value_count(rt_band band, int exclude_nodata_value,
                        if (
                                !exclude_nodata_value || (
                                        exclude_nodata_value &&
-                                       (hasnodata != FALSE) &&
-                                       FLT_NEQ(pxlval, nodata)
+                                       (hasnodata != FALSE) && (
+                                               FLT_NEQ(pxlval, nodata) &&
+                                               (rt_band_clamped_value_is_nodata(band, pxlval) != 1)
+                                       )
                                )
                        ) {
                                total++;
@@ -4245,7 +4251,7 @@ rt_band_reclass(rt_band srcband, rt_pixtype pixtype,
                                do_nv = 0;
 
                                /* no data*/
-                               if (src_hasnodata && hasnodata && ov == src_nodataval) {
+                               if (src_hasnodata && hasnodata && FLT_EQ(ov, src_nodataval)) {
                                        do_nv = 1;
                                        break;
                                }
index c33641cb807ac5d6d90837e396da7a157feca0b9..3bff7c94eacfd47b06115eada4da49a15ac979be 100644 (file)
@@ -520,7 +520,7 @@ int rt_band_set_pixel(rt_band band,
 /**
  * Get pixel value
  *
- * @param band : the band to set nodata value to
+ * @param band : the band to get pixel value from
  * @param x : x ordinate (0-based)
  * @param y : x ordinate (0-based)
  * @param *result: result if there is a value
index f72964764291863e4638d5604a410c38b1ab3a06..31c5f36b816823efa4c0ca9555d797088fff3406 100644 (file)
@@ -719,7 +719,7 @@ Datum RASTER_to_bytea(PG_FUNCTION_ARGS)
 
        /* Free raster objects used */
        rt_raster_destroy(raster);
-       rtdealloc(wkb);
+       pfree(wkb);
 
        PG_RETURN_POINTER(result);
 }
@@ -763,7 +763,7 @@ Datum RASTER_to_binary(PG_FUNCTION_ARGS)
 
        /* Free raster objects used */
        rt_raster_destroy(raster);
-       rtdealloc(wkb);
+       pfree(wkb);
 
        PG_RETURN_POINTER(result);
 }