Re: [Jts-topo-suite-user] How to do edge matching or snapping edges for polygons?
Brought to you by:
dr_jts
From: Stefan S. <ss...@ge...> - 2012-11-10 18:59:22
|
good question. I don't know about this either. A "dumb" approach would be to figure the direction of the shared edge and then try to find a path that goes from takes one coordinate and then looks for the closest to connect into that direction. Another GIS approach (which leaves the decision to the user) is to to an intersection operation and then assign the sliver polygon to either of the polygons and using a union; in case you have polygons. An automated assign criteria is for instance "common edge length" or "largest area". the latter, is the simplest idea I can come up with; and most common. But it depends on your use case if this is acceptable. stefan Am 10.11.12 14:53, schrieb David Shi: > Dear Stefan, > > I noticed that when gaps and overlaps occur, after intersection, the > coordinate values of data are there. But in either linear rings or > polygons. > > Would interleaved sorting be applied to concatenate together vertices? > > http://en.wikipedia.org/wiki/Z-order_curve > > I do not quite know how useful this Morten value is. Can this be used > to sort X, Y coordinates? > > Regards. > > David > > ------------------------------------------------------------------------ > *From:* Stefan Steiniger <ss...@ge...> > *To:* jts...@li... > *Sent:* Saturday, 10 November 2012, 16:56 > *Subject:* Re: [Jts-topo-suite-user] How to do edge matching or snapping > edges for polygons? > > not sure if there is a out-of-the-box answer. > I think you need to program that yourself. I.e. the vertices of one of > the polygons need to be snapped to the other. I.e. you would use > snapping? Or find the middle? > sounds like a lot of work. But maybe the Conflation suite tools help here. > > stefan > > Am 10.11.12 13:43, schrieb David Shi: > > Hello, Martin, > > I have to come back to you about this. After intersection, how to make > > shared edges to have identical lists of vertices to merge shared edges > > together and get rid of gaps and overlaps? > > > > Regards. > > > > David > > > > ------------------------------------------------------------------------ > > *From:* David Shi <dav...@ya... <mailto:dav...@ya...>> > > *To:* Martin Davis <mtn...@gm... <mailto:mtn...@gm...>>; > > "jts...@li... > <mailto:jts...@li...>" > > <jts...@li... > <mailto:jts...@li...>> > > *Sent:* Tuesday, 11 September 2012, 18:12 > > *Subject:* How to do edge matching or snapping edges for polygons? > > > > Hi, All, > > > > How to do edge matching or snapping edges for polygons? > > > > Regards. > > > > David > > > > public static void testintersection() throws ParseException{ > > Geometry geometries = null; > > // String teststring1 = "POLYGON((20 10, 30 0, 40 10, 30 20, 20 > > 10))"; > > // String teststring2 = "POLYGON((20 10, 30 0, 40 10, 30 20, 20 > > 10))"; > > > > String teststring1 = "POLYGON((0.0 10, 0.0 0.0, 5 2.5, 10.0 5, > > 20 20, 30 25, 40 20, 40 30, 30 30, 0.0 10))"; > > String teststring2 = "POLYGON((-10 -5, 5 2.5, 10 5, 15 15, 20 > > 20, 30 20, 40 20, 50 10, -10 -5))"; > > > > // LineString mystring = new LineString(tempcoor, GEOM_FACTORY); > > GeometryFactory geometryFactory = null; > > > > > > > > //Geometry geometryFactory = null; > > WKTReader reader = new WKTReader( ); > > //Geometry polygon = reader.read(teststring); > > //geometries = polygon; > > > > Geometry polygon1 = reader.read(teststring1); > > Geometry polygon2 = reader.read(teststring2); > > > > System.out.print("\n" + "testing intersection" + > > polygon1.intersection(polygon2)); > > > > geometries = polygon1; > > String test = GeometrySnapper.snap(polygon1, polygon2, > > GeometrySnapper.computeOverlaySnapTolerance(polygon1, > polygon2)).toString(); > > //test = "POLYGON((" + test +"))"; > > System.out.print("\n" + "poly3"+test); > > Geometry polygon3 = reader.read(test); > > allGeometries.add(polygon3); > > //allGeometries.add(polygon1); > > //allGeometries.add(polygon2); > > > > } > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > Everyone hates slow websites. So do we. > > Make your web apps faster with AppDynamics > > Download AppDynamics Lite for free today: > > http://p.sf.net/sfu/appdyn_d2d_nov > > > > > > > > _______________________________________________ > > Jts-topo-suite-user mailing list > > Jts...@li... > <mailto:Jts...@li...> > > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > Jts-topo-suite-user mailing list > Jts...@li... > <mailto:Jts...@li...> > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > > |