Hi,

I have two detached square polygons having following co-ordinates:

Poly 1: [0,0 10,0 10,20 0,20 0,0]

Poly 2 [15,5 20,5 20,17 15,17 15,5]
With JOIN_MITRE parameter, you should obtain :

POLYGON ((0 0, 0 20, 10 20, 10 17, 20 17, 20 5, 10 5, 10 0, 0 0))

(CAP parameter is useful for linestring only, while JOIN parameter
defines how two offset segments are joined in the general case)

Michaël

Minimum distance between the two polygons is 5

In order to merge these two polygons, i use JTS buffer where i initially union the two geometries,
then create a buffer around it with distance 5 and then use minus buffer to come out with a unique
polygon. The result of the polygon is as follows:

POLYGON ((0 0.2456342488473401, 0 19.75436575115266, 0.0220237152585997 19.977976284741402, 0.2456342488473282 20, 9.754365751152672 20, 9.984832985477693 19.977300958663484, 10.18486101601515 19.603074834858514, 15.084553039404692 16.984134885627526, 15.245634248847333 17, 19.75436575115267 17, 19.977976284741402 16.977976284741402, 20 16.75436575115267, 20 5.2456342488473275, 19.977976284741402 5.022023715258599, 19.75436575115267 5, 15 5, 10.024076366639015 0.4900857016478035, 9.9779762847414 0.0220237152585986, 9.754365751152667 0, 0.2456342488473417 0, 0.0220237152585994 0.0220237152585996, 0 0.2456342488473401))

When analysing the output, it does not retain original coordinates of points which should not be affected over buffer operation. For example, the corrdinate 0,0
should remain as it is. But in the result, it seems that it is not. I think in buffer operation, it splits the edges. Is there any method to overcome this. Here is the
JTS code i used.

Geometry funip = UnionWithUnionOp(GeomArray);
//System.out.println(funip);
BufferOp bufOp = new BufferOp(funip);
bufOp.setEndCapStyle(BufferOp.CAP_SQUARE);
Geometry buff = bufOp.getResultGeometry(5.0);

BufferOp buffmin = new BufferOp(buff);
buffmin.setEndCapStyle(BufferOp.CAP_SQUARE);
Geometry buffm = buffmin.getResultGeometry(-5.0);
System.out.println(buffm);

Cheers, Brian.

```------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/```

```_______________________________________________
Jts-topo-suite-user mailing list
Jts-topo-suite-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
```