[geos-devel] MakeValid and empty collection component
Darafei "Komяpa" Praliaskouski
me at komzpa.net
Sun Dec 20 23:18:53 PST 2020
Hi,
ST_MakeValid('MULTIPOLYGON EMPTY') crashes (any) GEOS in PostGIS 3.1.0
after the removal of EMPTY was dropped.
In PostGIS input functions and for Wagyu clipping library there's a set of
fuzzers that make sure the function never crashes.
MakeValid in GEOS may be a good candidate for such a thing - it needs to
output a Valid something and not crash on any input to be useful.
On Thu, Dec 10, 2020 at 5:48 PM Sandro Santilli <strk at kbt.io> wrote:
> On Thu, Dec 10, 2020 at 12:16:40PM +0100, Sandro Santilli wrote:
> > On Thu, Dec 10, 2020 at 12:08:58PM +0100, Sandro Santilli wrote:
> >
> > > Odd, for a MULTIPOINT with empty components it seems to strip it.
> > > But I cannot add the test because it looks like EMPTY is not accepted
> > > in WKT:
> > >
> > > MULTIPOINT(EMPTY,1 1,EMPTY,0 0)
> > > ParseException: Expected number but encountered word: 'EMPTY')
> >
> > Ok, figured: it's just the PostGIS->GEOS->PostGIS roundtrip conversion
> > dropping those components !
> >
> > strk=# select ST_AsText(postgis_geos_noop('GEOMETRYCOLLECTION(POINT
> EMPTY, POINT(1 1))'));
> > st_astext
> > --------------------------------
> > GEOMETRYCOLLECTION(POINT(1 1))
> > (1 row)
> >
> > So, not related to GEOSMakeValid per-se, just with the adapter...
>
> For the record, in case anyone wants to follow:
> https://trac.osgeo.org/postgis/ticket/4814
>
> To be noted that actually passing those empty components
> to GEOS exposes crashes in GEOS (more on the ticket above)
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geos-devel
>
--
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20201221/f1f56486/attachment.html>
More information about the geos-devel
mailing list