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

Shira Bezalel shira at sfei.org
Wed Jan 18 11:20:23 PST 2017


On Mon, Jan 9, 2017 at 10:18 AM, Shira Bezalel <shira at sfei.org> wrote:

> 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!
>


​Didn't hear back from the list on this, so thought I'd resend. Just
looking to know if anyone has run into this, what might be the cause, and
maybe most importantly (and ideally), if the new results would be
considered more accurate?

Thank you,
Shira​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170118/0bc174c5/attachment.html>


More information about the postgis-users mailing list