### Email Archive: jts-topo-suite-user (read-only)

 2009: 2010: 2011: 2012: 2013: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov (3) Dec Jan (30) Feb (41) Mar (69) Apr (131) May (67) Jun (24) Jul (28) Aug (52) Sep (9) Oct (24) Nov (36) Dec (24) Jan (20) Feb (53) Mar (31) Apr (74) May (71) Jun (51) Jul (28) Aug (91) Sep (72) Oct (46) Nov (90) Dec (38) Jan (80) Feb (77) Mar (98) Apr (78) May (56) Jun (85) Jul (53) Aug (87) Sep (74) Oct (67) Nov (85) Dec (66) Jan (50) Feb (34) Mar (45) Apr (36) May (22) Jun (10) Jul (30) Aug (39) Sep (25) Oct (11) Nov (64) Dec (35)
 Re: [Jts-topo-suite-user] Polygon Buffering and Differencing From: Brian Sanjeewa Rupasinghe - 2013-04-27 10:49 Attachments: Message as HTML ```Hi, I have following two polygons(1&2): I applied buffer operation on the union of these two with same +- distance and get the aggregated polygon geometry (3). Now what i want is to get the polygon in between the two source polygons and union it again with the two source polygons. Because, resulting polygon has some geometry discrepancies due to precision problems. When i applied the difference operator (polygon3 - union of polygons 1&2), the polygon i get is not correct due to precision errors (4). I tried GeoemtrySnapper on the polygon 4 to snap back to union of 1&2, but it does not give correct result. Any solution for this? 1. Geometry src = reader.read("POLYGON ((0 0.00789, 10 0, 10 10.006543, 0 10, 0 0.00789))"); 2. Geometry srcb = reader.read("POLYGON ((5 -5.00321, 5.5432 -10, 15 -10, 15 -5, 5 -5.00321))"); 3. POLYGON ((-0.0000000000000009 0.0078899999999982, -0.0000000000000009 10.000000000000002, 10 10.006543, 10 -5.001604999999999, 14.999999999999998 -4.999999999999999, 14.999999999999998 -9.999999999999998, 5.543199999999999 -9.999999999999998, 4.455626530994031 0.0043745106670444, -0.0000000000000009 0.0078899999999982)) 4. POLYGON ((-0.0000000000000009 0.0078899999999982, -0.0000000000000009 10.000000000000002, 10 10.006543, 0 10, 0 0.00789, 10 0, 10 -5.001604999999999, 14.999999999999998 -4.999999999999999, 14.999999999999998 -5, 5 -5.00321, 5.5432 -9.999999999999998, 5.543199999999999 -9.999999999999998, 4.455626530994031 0.0043745106670444, -0.0000000000000009 0.0078899999999982)) ```

 Re: [Jts-topo-suite-user] Polygon Buffering and Differencing From: Martin Davis - 2013-04-27 16:07 Attachments: Message as HTML ```The only idea I can suggest is to try rounding the geometries back to a lower-precision grid. On 4/27/2013 3:49 AM, Brian Sanjeewa Rupasinghe wrote: > Hi, > > I have following two polygons(1&2): I applied buffer operation on the > union of these two with same +- distance and get the aggregated > polygon geometry (3). Now what i want is to get the polygon in between > the two source polygons and union it again with the two source > polygons. Because, resulting polygon has some > geometry discrepancies due to precision problems. When i applied the > difference operator (polygon3 - union of polygons 1&2), the polygon i > get is not correct due to precision errors (4). I tried > GeoemtrySnapper on the polygon 4 to snap back to union of 1&2, but it > does not give correct result. Any solution for this? > 1. > Geometry src = reader.read("POLYGON ((0 0.00789, 10 0, 10 10.006543, 0 > 10, 0 0.00789))"); > > 2. > Geometry srcb = reader.read("POLYGON ((5 -5.00321, 5.5432 -10, > 15 -10, 15 -5, 5 -5.00321))"); > > 3. > > POLYGON ((-0.0000000000000009 0.0078899999999982, -0.0000000000000009 > 10.000000000000002, 10 10.006543, 10 -5.001604999999999, > 14.999999999999998 -4.999999999999999, 14.999999999999998 > -9.999999999999998, 5.543199999999999 -9.999999999999998, > 4.455626530994031 0.0043745106670444, -0.0000000000000009 > 0.0078899999999982)) > > 4. > > POLYGON ((-0.0000000000000009 0.0078899999999982, -0.0000000000000009 > 10.000000000000002, 10 10.006543, 0 10, 0 0.00789, 10 0, 10 > -5.001604999999999, 14.999999999999998 -4.999999999999999, > 14.999999999999998 -5, 5 -5.00321, 5.5432 -9.999999999999998, > 5.543199999999999 -9.999999999999998, 4.455626530994031 > 0.0043745106670444, -0.0000000000000009 0.0078899999999982)) > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > > > _______________________________________________ > Jts-topo-suite-user mailing list > Jts-topo-suite-user@... > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user ```