Re: [geos-devel] MakeValid and empty collection component

2020-12-21 Thread Sandro Santilli
On Mon, Dec 21, 2020 at 10:18:53AM +0300, Darafei "Komяpa" Praliaskouski wrote: > Hi, > > ST_MakeValid('MULTIPOLYGON EMPTY') crashes (any) GEOS in PostGIS 3.1.0 > after the removal of EMPTY was dropped. Please check both 3.1 and master branches now. I pushed a fix for this crash (fully inside

Re: [geos-devel] MakeValid and empty collection component

2020-12-20 Thread Komяpa
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

Re: [geos-devel] MakeValid and empty collection component

2020-12-10 Thread Sandro Santilli
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: > > >

Re: [geos-devel] MakeValid and empty collection component

2020-12-10 Thread Sandro Santilli
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

Re: [geos-devel] MakeValid and empty collection component

2020-12-10 Thread Sandro Santilli
On Thu, Dec 10, 2020 at 01:35:17AM +0100, Even Rouault wrote: > On mercredi 9 décembre 2020 12:13:17 CET Sandro Santilli wrote: > > I found out that GEOSMakeValid will remove EMPTY components from > > collections. The PostGIS implementation of it does not do this. > > > > The rationale was that a

Re: [geos-devel] MakeValid and empty collection component

2020-12-09 Thread Even Rouault
On mercredi 9 décembre 2020 12:13:17 CET Sandro Santilli wrote: > I found out that GEOSMakeValid will remove EMPTY components from > collections. The PostGIS implementation of it does not do this. > > The rationale was that a collection with EMPTY component is NOT > invalid as per OGC

Re: [geos-devel] MakeValid and empty collection component

2020-12-09 Thread Komяpa
Hi, I believe there are two modes functions can operate in: geometry-preserving or structure-preserving. MakeValid will try to recover the geometry, but makes no effort to preserve structure, sometimes it is impossible. If you're using MakeValid, you expect the structure (the number of

Re: [geos-devel] MakeValid and empty collection component

2020-12-09 Thread Even Rouault
Sandro, > I found out that GEOSMakeValid will remove EMPTY components from > collections. The PostGIS implementation of it does not do this. > > The rationale was that a collection with EMPTY component is NOT > invalid as per OGC specification, so why removing them ? Isn't > that a job for

[geos-devel] MakeValid and empty collection component

2020-12-09 Thread Sandro Santilli
I found out that GEOSMakeValid will remove EMPTY components from collections. The PostGIS implementation of it does not do this. The rationale was that a collection with EMPTY component is NOT invalid as per OGC specification, so why removing them ? Isn't that a job for CollectionHomogenize or