Hey all,
I've got an interesting problem. I've only tested it with NTS, but I'm
sure it's an issue in JTS as well, and it shouldn't be terribly hard for
someone with a JTS environment already set up to confirm.
Consider the following two geometries, named "A" and "B", respectively:
A: POLYGON ((151.33075838999991 -33.495196879999924, 151.33175839
-33.500496879999957, 151.33085839000012 -33.500596879999989,
151.32785838999996 -33.500596879999989, 151.32535839000002
-33.500296880000008, 151.32395839000003 -33.506796879999854,
151.31945839000002 -33.506296879999979, 151.31925838999996
-33.506996879999974, 151.31615838999994 -33.506596880000018, 151.31545839
-33.506496879999986, 151.31125839000026 -33.505896880000023, 151.30685839
-33.505196879999914, 151.30175838999992 -33.504496879999976,
151.29725839000025 -33.502796880000005, 151.29735839 -33.502196879999929,
151.29505839000012 -33.501796879999972, 151.29345838999996
-33.509596880000004, 151.29245838999998 -33.509496879999972,
151.29135839000003 -33.5146968799998, 151.28815838999992
-33.514196879999929, 151.29205839000008 -33.495496879999962,
151.28885838999997 -33.493996879999941, 151.29275839000025
-33.493796879999991, 151.29395839000006 -33.494796879999967,
151.29525838999996 -33.49599687999995, 151.29955839000013
-33.495496879999962, 151.30025838999995 -33.495496879999962, 151.30635839
-33.49639688000002, 151.31165838999993 -33.491896880000013,
151.31565838999995 -33.491396880000025, 151.32385839000006
-33.484196880000013, 151.32394830607632 -33.477093509978658,
151.32403683439372 -33.4771989905272, 151.32455839000011
-33.483196879999866, 151.32645839000008 -33.483896879999861,
151.33655839000016 -33.48439688000002, 151.33255838999992
-33.491696879999893, 151.33075838999991 -33.495196879999924))
B: POLYGON ((151.31615838999994 -33.506596880000004, 151.31925838999993
-33.506996879999974, 151.31945839000005 -33.506296879999965,
151.32395839000006 -33.506796879999939, 151.32605839000007
-33.507096879999985, 151.32765839000012 -33.50719687999991,
151.32695839000004 -33.511296879999946, 151.32625839000002
-33.514296880000018, 151.32615838999993 -33.514796879999992,
151.32575839000003 -33.517296879999989, 151.32555839000011
-33.518396880000054, 151.32485839 -33.522196879999967, 151.32865839000002
-33.522596879999931, 151.32845839000007 -33.524596880000033,
151.32265839000013 -33.525096879999921, 151.32015838999996
-33.525796880000023, 151.31715838999992 -33.527196879999948,
151.31815839000012 -33.521396879999941, 151.31985839000004
-33.521596879999969, 151.32015838999996 -33.519996880000008,
151.31695839000005 -33.519596879999952, 151.31675839000002
-33.521396879999941, 151.31545839000003 -33.528196879999911,
151.31265839000017 -33.529796879999964, 151.3115583900001
-33.533196879999991, 151.31265839000017 -33.534596879999924,
151.30925838999997 -33.535596879999972, 151.29595839000007
-33.536096879999953, 151.29645839000003 -33.533796879999983,
151.29765839000012 -33.527996879999975, 151.29885838999994
-33.5223968799999, 151.30015839000009 -33.515896879999971,
151.30135839000002 -33.509896879999928, 151.30165838999997
-33.508696879999945, 151.30175838999989
-33.507896879999919,151.29855839000007 -33.507496879999948,
151.29925838999998 -33.504296879999949, 151.29705839000013
-33.503896879999985, 151.29725839000014 -33.502796880000005,
151.30175838999989 -33.504496879999976,151.30685838999997
-33.5051968799999, 151.31125839000015 -33.505896879999995,
151.31545839000003 -33.506496879999986, 151.31615838999994
-33.506596880000004))
AB = A.Union(B) -- works like a charm
BAB = B.Union(AB) -- also works just fine
AAB = A.Union(AB) -- throws even after snapping... the post-snap exception
is in DirectedEdgeStar.LinkResultDirectedEdges(): no outgoing dirEdge found
[ (0.0077441045222599314, -0.50638418161354082, NaN) ]
This is the underlying cause of a failure of a much larger operation. In
the real-world scenario it came from, there are other things unioned
together with "A" and other things unioned together with "B", so in the
real-world it winds up being something more like "UNION(UNION(A, Z, Y,
...), UNION(A, B, X, W, ...), ...)" where we need to keep all intermediate
polygons as well as their union.
Any tips on how to work around this? I'm hoping for something better than
using the user data to tag each aggregated polygon with its list of
leaf-level children (so the first would be conceptually tagged as "A, Z, Y,
...") and then replacing our code that does the final union to fetch the
leaf-level children back again to ensure we never have to union two
overlapping geometries... this would obviously make already slow operation
even slower, not to mention how expensive that solution would be in terms
of development effort...
--Joe Amenta
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user