[geos-devel] Buffering of invalid polygon seems to produce a less useable result

Casper Børgesen (CABO) CABO at NIRAS.DK
Mon Sep 29 12:05:28 PDT 2014


Hi!

I hope this is the right place to ask my question. I am using Shapely (GEOS 3.3.0) for doing a lot of intersections and buffering. I have encountered the following polygon:

POLYGON ((495500.0008984859 6223520.993661864, 495499.998 6223520.995448768, 495499.9991735771 6223527.855730382, 495508.4863142541 6223531.706871153, 495530.2685512748 6223543.411751036, 495533.1580739201 6223544.947487216, 495533.8227791181 6223543.611840623, 495533.8271434258 6223543.603092512, 495555.6344791899 6223499.999, 495566.8171459202 6223499.999, 495566.8180398509 6223500.000448206, 495566.1117119509 6223501.409196244, 495542.7750432596 6223548.072535053, 495526.8506947843 6223580.070632624, 495529.2135856081 6223581.293180954, 495552.9615536986 6223534.554188457, 495570.1400217356 6223499.999, 495581.3075270238 6223499.999, 495581.3084224826 6223500.000445144, 495561.9082049726 6223539.026180848, 495561.8885137878 6223539.065359981, 495538.1146364022 6223585.855345234, 495559.0058384891 6223596.461268372, 495566.4481611441 6223599.999096851, 495566.4477318175 6223600.001, 495543.8828814158 6223600.000891673, 495533.6582439464 6223594.810107598, 495531.1272425454 6223600.001, 495600.0010000134 6223600.001, 495600.002 6223599.999999792, 495600 6223593.009925384, 495596.8509020228 6223591.430463607, 495596.8495582865 6223591.430912227, 495596.1490985376 6223592.839558984, 495590.0299959367 6223589.770009149, 495575.7599193477 6223582.619950288, 495574.7599693871 6223581.849986448, 495573.6199312546 6223580.849924827, 495572.4699504239 6223579.319921299, 495571.6599650297 6223577.669868131, 495571.4399859799 6223576.499942598, 495571.3299971888 6223574.919921184, 495571.5300424019 6223572.699865821, 495572.0800108417 6223571.299956108, 495578.5195385296 6223558.440899175, 495578.1804384738 6223558.269103024, 495595.8708982405 6223522.980438616, 495599.9998027192 6223525.048014081, 495600.0012504738 6223525.047119915, 495599.9999999871 6223499.998, 495530.7043992468 6223499.998449264, 495516.0786580448 6223529.078217097, 495500.0008984859 6223520.993661864))

According to QGIS it has a self-intersection at (495566.447732, 6223600.001) and the polygon is the result of previous intersections with other valid geometry.

I am trying to buffer the polygon 0.001 meter (no segments) to avoid the self-intersection. But instead I end up with this MultiPolygon:

MULTIPOLYGON (((495555.6332172451 6223499.999287644, 495566.8184538786 6223499.999215126, 495566.8179968625 6223499.99847474, 495566.8171459202 6223499.998, 495555.6344791899 6223499.998, 495555.6335848061 6223499.9985527, 495555.6332172451 6223499.999287644)), ((495570.1388087373 6223499.999193599, 495581.3087785234 6223499.999121181, 495581.3083770663 6223499.998473286, 495581.3075270238 6223499.998, 495570.1400217356 6223499.998, 495570.1391262832 6223499.998554843, 495570.1388087373 6223499.999193599)), ((495566.4489825341 6223600, 495543.878915958 6223600, 495543.8824287364 6223600.001783347, 495543.8828814111 6223600.001891674, 495566.4477318127 6223600.002, 495566.4487073044 6223600.001220058, 495566.4489825341 6223600)))

Though it is valid it only represents the part of the polygon I would like to avoid, but in this case increase to ensure validity on the expense of a slightly increased area.

Is the MultiPolygon the intended result of the specified operation?

Are there any methods to better ensure validity of geometries resulting from the various geometric functions?


Kind regards, Casper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20140929/e115ebf5/attachment.html>


More information about the geos-devel mailing list