[DebianGIS-dev] Bug#539088: Bug#539088: libgeos-3.1.0: Assertion fails when buffering a specific multipolygon

Francesco P. Lovergine frankie at debian.org
Wed Jul 29 09:30:43 UTC 2009


On Wed, Jul 29, 2009 at 02:36:51AM +0300, Tuure Laurinolli wrote:
> Package: libgeos-3.1.0
> Version: 3.1.0-1
> Severity: normal
> 
> 
> When doing 0-distance buffer on the geometry in script "test2.py", GEOS prints
> a message stderr and causes the process to exit with code 134.
> 
> Test script "test2.py":
> 
> from shapely import wkt
> mp = wkt.loads('MULTIPOLYGON (((3375988.599 6680548.657, 3375856.477 6680761.861, 3376067.385 6680748.959, 3375988.599 6680548.657), (3375921.642 6680736.744, 3375920.948 6680725.834, 3376044.612 6680717.931, 3375921.642 6680736.744)), ((3376292.713 6680820.212, 3376320.365 6680785.36, 3376043.927 6680525.464, 3376292.713 6680820.212)))')
> mp.buffer(0)
> 
> Running the script requires package python-shapely. Run as follows:
>  % python test.py
> 
> Expected result:
> 
> MULTIPOLYGON (((3376292.7129999999888241 6680820.2120000002905726, 3376320.3650000002235174 6680785.3600000003352761, 3376043.9270000001415610 6680525.4639999996870756, 3376292.7129999999888241 6680820.2120000002905726)), ((3375988.5989999999292195 6680548.6569999996572733, 3375856.4769999999552965 6680761.8609999995678663, 3376067.3849999997764826 6680748.9589999997988343, 3375988.5989999999292195 6680548.6569999996572733), (3375921.6419999999925494 6680736.7439999999478459, 3375920.9479999998584390 6680725.8339999997988343, 3376044.6120000001974404 6680717.9309999998658895, 3375921.6419999999925494 6680736.7439999999478459)))
> 
> printed on stdout
> 
> Actual result:
> 
> bufferOriginalPrecision failed (TopologyException: unable to assign hole to a shell), trying with reduced precision
> recomputing with precision scale factor = 1e+09
> Scaler: offsetX,Y: 0,0 scaleFactor: 1e+09
> ReScaler: offsetX,Y: 0,0 scaleFactor: 1e+09
> recomputing with precision scale factor = 1e+08
> Scaler: offsetX,Y: 0,0 scaleFactor: 1e+08
> ReScaler: offsetX,Y: 0,0 scaleFactor: 1e+08
> recomputing with precision scale factor = 1e+07
> Scaler: offsetX,Y: 0,0 scaleFactor: 1e+07
> ReScaler: offsetX,Y: 0,0 scaleFactor: 1e+07
> recomputing with precision scale factor = 1e+06
> Scaler: offsetX,Y: 0,0 scaleFactor: 1e+06
> ReScaler: offsetX,Y: 0,0 scaleFactor: 1e+06
> recomputing with precision scale factor = 100000
> Scaler: offsetX,Y: 0,0 scaleFactor: 100000
> ReScaler: offsetX,Y: 0,0 scaleFactor: 100000
> recomputing with precision scale factor = 10000
> Scaler: offsetX,Y: 0,0 scaleFactor: 10000
> ReScaler: offsetX,Y: 0,0 scaleFactor: 10000
> recomputing with precision scale factor = 1000
> Scaler: offsetX,Y: 0,0 scaleFactor: 1000
> ReScaler: offsetX,Y: 0,0 scaleFactor: 1000
> recomputing with precision scale factor = 100
> Scaler: offsetX,Y: 0,0 scaleFactor: 100
> ReScaler: offsetX,Y: 0,0 scaleFactor: 100
> recomputing with precision scale factor = 10
> Scaler: offsetX,Y: 0,0 scaleFactor: 10
> ReScaler: offsetX,Y: 0,0 scaleFactor: 10
> recomputing with precision scale factor = 1
> recomputing with precision scale factor = 0.1
> Scaler: offsetX,Y: 0,0 scaleFactor: 0.1
> ReScaler: offsetX,Y: 0,0 scaleFactor: 0.1
> recomputing with precision scale factor = 0.01
> Scaler: offsetX,Y: 0,0 scaleFactor: 0.01
> ReScaler: offsetX,Y: 0,0 scaleFactor: 0.01
> recomputing with precision scale factor = 0.001
> Scaler: offsetX,Y: 0,0 scaleFactor: 0.001
> python: ../../source/headers/geos/noding/SegmentString.h:175: void geos::noding::SegmentString::testInvariant() const: Assertion `pts->size() > 1' failed.
> zsh: abort      python test2.py
> 
> printed on stderr
> 
> The same problem can be reproduced using other software that uses GEOS
> as well, e.g. postgresql-8.3-postgis and the operation:
> 
> SELECT ST_BUFFER(ST_GEOMFROMTEXT('MULTIPOLYGON (((3375988.599 6680548.657, 3375856.477 6680761.861, 3376067.385 6680748.959, 3375988.599 6680548.657), (3375921.642 6680736.744, 3375920.948 6680725.834, 3376044.612 6680717.931, 3375921.642 6680736.744)), ((3376292.713 6680820.212, 3376320.365 6680785.36, 3376043.927 6680525.464, 3376292.713 6680820.212)))'), 0);
> 
> The problem has been fixed in upstream GEOS release 3.1.1.
> 

Due to a license issue, you have to wait next geos release, or need to provide a minimal patch for the 3.1.0 version.

-- 
Francesco P. Lovergine





More information about the Pkg-grass-devel mailing list