Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] BufferOp on polygon exterior ring - End Cap?

Ok, I understand better now.  Yes, I think you need to use CAP_ROUND for rings. 

Not sure what you mean by using Polygonizer to extract rings.  Just interating over the contents of the collection and checking the geometry type would be sufficient to do this.

On Wed, Aug 22, 2018 at 2:41 PM Martin Janda <jandam@xxxxxxxxxx> wrote:
Thank you for fast reply. 

Yes, I don't want the CAP_FLAT to appear in the linear ring.
 I'm not using CAP_ROUND because I need CAP_FLAT for the line string. 
  In general I have GeometryCollection  of Polygons and LineStrings.

  Maybe the best solution is to use Polygonizer to extract polygons and LineStrings. And process each geometry type with different CAP parameter. 

Buffering polygon gives different result than buffering exterior ring.

EXAMPLE:
  Simple polygon - no holes = rectangle

Buffering polygon without holes gives larger polygon again without holes.

 X

Buffering exterior ring gives polygon with hole. 
 (This is suitable for wall around garden)

Martin

22. 8. 2018 v 16:15, Martin Davis <mtnclimb@xxxxxxxxx>:

I may not be understanding correctly, but it seems like you don't actually want the CAP_FLAT to appear in the linear ring buffer.  In that case, why not use CAP_ROUND?  Or else just buffer the polygon itself (instead of extracting the boundary as a linear ring).

On Wed, Aug 22, 2018 at 12:23 AM, Janda Martin <jandam@xxxxxxxxxx> wrote:
Hi,

  please can you help me with my problem.

I want to buffer exterior ring of polygon with join=ROUND, cap=FLAT. This setting works for LineStrings as expected. But there is problem with closed rings.

PSEUDOCODE:

Polygon p = ...;

Geometry outline = p.getExteriorRing(); // linear ring

BufferParameters bufParams = new BufferParameters();
bufParams.setEndCapStyle(CAP_FLAT);
bufParams.setJoinStyle(JOIN_ROUND);
BufferOp.bufferOp(outline, 0.5, bufParams);

I would expect that 'join' will be used for first and last coordinate because outline is closed ring.
Currently cap=FLAT is used for first and last point. Tested on JTS < 1.14. I'm sorry I can't test it on latest JTS.

Is this my misunderstanding? Or is there another parameter?

REAL USAGE:
P is polygon of garden. I would like to construct wall (width=0.5m) around the garden.


Thank you for your help.
  Martin
_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/jts-dev

_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/jts-dev
_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/jts-dev

Back to the top