[postgis-users] (Bug?) Strange Behavior with ST_SymDifference (line, surface)

Rémi Cura remi.cura at gmail.com
Fri Sep 27 06:06:59 PDT 2013


It appears that ST_Difference has the same wrong behavior :

Intersection:LINESTRING(650814.2 6861324.8,650807.6 6861313,650750.3
6861219.1,650740.9 6861202.9)
ST_Difference:POLYGON((650810.218274441 6861311.53554141,650810.160856181
6861311.43730501,650752.878151586 6861217.56564774,650743.494815461
6861201.39436634,650740.9 6861202.9,650738.305184539
6861204.40563366,650747.705184539 6861220.60563366,650747.739143819
6861220.66269499,650805.009503031 6861314.51412134,650811.581725559
6861326.26445859,650814.2 6861324.8,650816.818274441
6861323.33554141,650810.218274441 6861311.53554141))
 ST_SymDifference:POLYGON((650810.218274441
6861311.53554141,650810.160856181 6861311.43730501,650752.878151586
6861217.56564774,650743.494815461 6861201.39436634,650740.9
6861202.9,650738.305184539 6861204.40563366,650747.705184539
6861220.60563366,650747.739143819 6861220.66269499,650805.009503031
6861314.51412134,650811.581725559 6861326.26445859,650814.2
6861324.8,650816.818274441 6861323.33554141,650810.218274441
6861311.53554141))
Surface : POLYGON((650810.218274441 6861311.53554141,650810.160856181
6861311.43730501,650752.878151586 6861217.56564774,650743.494815461
6861201.39436634,650738.305184539 6861204.40563366,650747.705184539
6861220.60563366,650747.739143819 6861220.66269499,650805.009503031
6861314.51412134,650811.581725559 6861326.26445859,650816.818274441
6861323.33554141,650810.218274441 6861311.53554141))
Line: LINESTRING(650814.2 6861324.8,650807.6 6861313,650750.3
6861219.1,650740.9 6861202.9)


Rémi-C


2013/9/27 Rémi Cura <remi.cura at gmail.com>

> hey,
> I'm experiencing a strange behavior with ST_SymDifference :<http://postgis.net/docs/manual-2.0/ST_SymDifference.html>
>
> When doing symdiff of a line and a surface, I get the same surfaces with
> added points on surfaces boundary (where line crossed surface).
>
> Example :
>   ___________
> *├---------┤*
>   -------------------
>
> gives
>   ___________
> *|             |***
>   -------------------
>
> I read the SQL MM definition (here<http://jtc1sc32.org/doc/N1101-1150/32N1107-WD13249-3--spatial.pdf‎>, page 67-68-69), and I found no trace of behavior with line against
> surfaces.
>
> Mathematically , if we take for definition the union without the
> intersection, the result is false (no point on the line should be in the
> result, yet they are).
>
> I was expecting as output one polygon each side of the line (ie 2
> polygons).
>
> I would appreciate any thoughts about this.
> Cheers,
>
> Rémi-C
> PS : I know I can use ST_Split or other tricks for the same result in this
> simple case, but not so easily for trickier case.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130927/ad063592/attachment.html>


More information about the postgis-users mailing list