[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.3-19-gfbbf5fdda
git at osgeo.org
git at osgeo.org
Mon Jun 26 19:39:22 PDT 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.3 has been updated
via fbbf5fdda4e6cc69c7f110b90cb95d3e32de5d17 (commit)
from a5c0cb911a1acbdb9ec22383d1e4e47b1f5af6c8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fbbf5fdda4e6cc69c7f110b90cb95d3e32de5d17
Author: Regina Obe <lr at pcorp.us>
Date: Mon Jun 26 20:31:40 2023 -0400
ST_Value bilinear
- Don't throw an error if nodatavalue, instead use 0
- Add tests for bilinear
References #5410 for PostGIS 3.3.4
diff --git a/NEWS b/NEWS
index 94bd03f77..e2af982d6 100644
--- a/NEWS
+++ b/NEWS
@@ -2,10 +2,13 @@ PostGIS 3.3.4dev
YYYY/MM/DD
* Bug Fixes and Enhancements *
- - #5394, Improve robustness of finding distinct vertices in topology edges
- (Sandro Santilli)
- - #5403, Fix ValidateTopology(bbox) without topology in search_path
- (Sandro Santilli).
+ - #5394, [postgis_topology] Improve robustness of finding
+ distinct vertices in topology edges (Sandro Santilli)
+ - #5403, [postgis_topology] Fix ValidateTopology(bbox) without
+ topology in search_path (Sandro Santilli)
+ - #5410, [postgis_raster] ST_Value bilinear resample,
+ don't throw an error if Band has no NODATA value
+ (Regina Obe)
PostGIS 3.3.3
2023/05/29
diff --git a/raster/rt_core/rt_band.c b/raster/rt_core/rt_band.c
index c46ee81f4..66aa19431 100644
--- a/raster/rt_core/rt_band.c
+++ b/raster/rt_core/rt_band.c
@@ -1262,7 +1262,6 @@ rt_band_get_pixel_bilinear(
double xr, double yr,
double *r_value, int *r_nodata)
{
- rt_errorstate err;
double xcenter, ycenter;
double values[2][2];
double nodatavalue = 0.0;
@@ -1294,9 +1293,11 @@ rt_band_get_pixel_bilinear(
xdir = xr < xcenter ? 1 : 0;
ydir = yr < ycenter ? 1 : 0;
- err = rt_band_get_nodata(band, &nodatavalue);
- if (err != ES_NONE) {
- nodatavalue = 0.0;
+ if (rt_band_get_hasnodata_flag(band) != FALSE) {
+ rt_band_get_nodata(band, &nodatavalue);
+ }
+ else {
+ nodatavalue = 0.0;
}
/* Read the 2x2 values from the band */
diff --git a/raster/test/regress/rt_pixelvalue.sql b/raster/test/regress/rt_pixelvalue.sql
index fb9c05341..942c1e889 100644
--- a/raster/test/regress/rt_pixelvalue.sql
+++ b/raster/test/regress/rt_pixelvalue.sql
@@ -288,6 +288,8 @@ SELECT 'test 1.10', id
-----------------------------------------------------------------------
-- Test 2 - st_value(rast raster, band integer, pt geometry)
+-- - st_value(rast raster, band integer, pt geometry,
+-- boolean exclude_nodata_value=true, text resample)
-----------------------------------------------------------------------
SELECT 'test 2.1', id
@@ -298,6 +300,18 @@ SELECT 'test 2.2', id
FROM rt_band_properties_test
WHERE st_value(rast, 2, st_makepoint(st_upperleftx(rast), st_upperlefty(rast))) != b2val;
+SELECT 'test 2.3', id, st_value(rast, 1,
+ ST_Centroid(rast::geometry),
+ true, 'bilinear') AS val
+ FROM rt_band_properties_test
+ WHERE id = 1;
+
+SELECT '#5410', id, st_value(
+ ST_SetBandNoDataValue(rast,1,NULL), 1,
+ ST_Centroid(rast::geometry),
+ true, 'bilinear') As val
+ FROM rt_band_properties_test
+ WHERE id = 1;
-----------------------------------------------------------------------
-- Test 3 - st_pixelaspolygon(rast raster, x integer, y integer)
-----------------------------------------------------------------------
diff --git a/raster/test/regress/rt_pixelvalue_expected b/raster/test/regress/rt_pixelvalue_expected
index 49194c799..7576caaff 100644
--- a/raster/test/regress/rt_pixelvalue_expected
+++ b/raster/test/regress/rt_pixelvalue_expected
@@ -4,6 +4,8 @@ NOTICE: Attempting to get pixel value with out of range raster coordinates: (-2
NOTICE: Attempting to get pixel value with out of range raster coordinates: (-2, -2)
ERROR: Raster and geometry do not have the same SRID
ERROR: Raster and geometry do not have the same SRID
+test 2.3|1|2
+#5410|1|2
NOTICE: Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster
NOTICE: Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster
NOTICE: Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster
-----------------------------------------------------------------------
Summary of changes:
NEWS | 11 +++++++----
raster/rt_core/rt_band.c | 9 +++++----
raster/test/regress/rt_pixelvalue.sql | 14 ++++++++++++++
raster/test/regress/rt_pixelvalue_expected | 2 ++
4 files changed, 28 insertions(+), 8 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list