[postgis-users] ST_Clip - Different results between PostGIS 2.0.1 and 2.3.1

Shira Bezalel shira at sfei.org
Mon Jan 9 10:18:39 PST 2017


Hi there. I'm testing an upgraded database and seeing different results in
a query that's using the ST_Clip function.

old database: PostgreSQL 9.1.14 with PostGIS 2.0.1
new database: PostgreSQL: 9.6.1 with PostGIS 2.3.1

I know ST_Clip was rewritten in C in PostGIS 2.1. Could this be responsible
for different results? Or did the clipping algorithm change? I consulted
the docs, but didn't see anything noted to this effect.

Query:

SELECT (pvc).value, SUM((pvc).count) AS total
       FROM (
           SELECT ST_ValueCount(st_clip(rast, c.the_geom),1) AS pvc
           FROM nlcdcal20_2011, counties c
           WHERE st_intersects(rast, c.the_geom) and
           c.NAME = 'Alameda'
       ) AS foo
       GROUP BY (pvc).value
       order by (pvc).value

If I remove the clip, the results are identical.

In terms of the actual difference, here's the sum total of all pixels found
by this query:

Total pixels in 2.0.1 = 2,362,444
Total pixels in 2.3.1 = 2,418,017

It's not a huge difference, but enough to be curious about. We can live
with it, but it would just be nice to know the cause.

Thank you for any insight you can provide.
Shira

p.s. The faster performance of the new ST_Clip is awesome!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170109/08d5d7d3/attachment.html>


More information about the postgis-users mailing list