[postgis-users] A function to find errors in groups in a table

Vera Green vera.green.ca at gmail.com
Thu Jun 9 16:53:07 PDT 2022


Use a window function to find where outflow =< inflow with the window on
the nodeid.

On Thu., Jun. 9, 2022, 5:28 a.m. Shaozhong SHI, <shishaozhong at gmail.com>
wrote:

> There is a table full of grouped values like the following
>
> nodeid     link_type      primary
> 11           outflowlink       1
> 11              inflowlink      1
> 11              outflowlink     2
>
> Primary of 1 indicates a primary water course.  Primary of 2 indicates a
> secondary water course.
>
> Obviously, one of the out flow links is an error, as its primacy value is
> 2.  It is wrong that water flows from a primary water course into a
> secondary water course.
>
> How can a function can be designed to find and report such errors?
>
> Regards,
>
> David
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220609/e59be66e/attachment.htm>


More information about the postgis-users mailing list