Re: [Jts-topo-suite-user] Union semantic
Brought to you by:
dr_jts
From: Martin D. <mtn...@te...> - 2011-05-21 22:07:38
|
1) The reasons are that this takes extra work, and also that it would change the semantics of the union operator so that it operates differently to the other overlay operators. But these may not be all that good reasons 8^) There's no magic in the union() code - it just unions all the polygons first, so that it eliminates any invalid polygon overlaps. You could easily code this up yourself if necessary. In fact, the easiest way to do this is to simply build a GeometryCollection on the two input geometries and run union() on it! public static Geometry unionGC(Geometry a, Geometry b) { Geometry gc = a.getFactory().createGeometryCollection( new Geometry[] { a, b}); return gc.union(); } 2) Which method in particular is confusing? 3) You can use LineMerger to do this. In general, I like to try and keep the API as orthogonal as possible; i.e. rather than provide options to operations to call other operations, just provide an easy way to call the second operation directly and let the developer chain them together. This keeps the API simpler, I think. 4) Fixed - thanks. On 5/15/2011 1:21 AM, Michaël Michaud wrote: > Hi Martin, > > Some questions / suggestions about union operator > > 1) I'm wondering if there is a reason why Geometry.union(Geometry) still > not support GeometryCollection, while Geometry.union() now supports them. > > 2) I'm often confused by the difference between polygon unioning > (dissolving adjacent polygons) and linestring unioning (dissolving > coincident linestring but not merging adjacent linestring where possible). > > Difference between dissolving and merging for linestring is explained in > UnaryUnionOp javadoc but a bit confusing (for me) in Geometry javadoc. > > 3) I find it would be useful if Union (or at least UnaryUnionOp) had an > option to "merge" linestrings, as it is often wanted in a union operation. > > 4) typo in Geometry.union() javadoc : {link #union(Geometry)} instead of > {@link #union(Geometry)} > > Thanks for the excellent work on JTS, > > Michaël > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Jts-topo-suite-user mailing list > Jts...@li... > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1325 / Virus Database: 1500/3637 - Release Date: 05/14/11 > > > |