Opened 8 years ago

Last modified 2 years ago

#589 new defect

GEOSBufferWithStyle with mitre style on LinearRing

Reported by: olivier80 Owned by: geos-devel@…
Priority: major Milestone: GEOS Fund Me
Component: Default Version: 3.3.5
Severity: Unassigned Keywords: jtsfail
Cc: mbdavis


I’m not sure if it is a bug or if it is normal behaviour.

Consider this linearring.

10.0000000000000000 10.0000000000000000, 
20.0000000000000000 10.0000000000000000, 
20.0000000000000000 20.0000000000000000, 
10.0000000000000000 20.0000000000000000, 
10.0000000000000000 10.0000000000000000)

Now I do :

GEOSBufferWithStyle(linearring, 1, 3, GEOSBUF_CAP_FLAT, GEOSBUF_JOIN_MITRE, 5)

Result :

10.0000000000000000 10.0000000000000000, 
9.0000000000000000 10.0000000000000000, 
9.0000000000000000 21.0000000000000000, 
21.0000000000000000 21.0000000000000000, 
21.0000000000000000 9.0000000000000000, 
10.0000000000000000 9.0000000000000000, 
10.0000000000000000 10.0000000000000000), 
(11.0000000000000000 11.0000000000000000, 
19.0000000000000000 11.0000000000000000, 
19.0000000000000000 19.0000000000000000, 
11.0000000000000000 19.0000000000000000,
11.0000000000000000 11.0000000000000000))

The first and last points of my buffer are in flat style. I think on a linearring, geos should use the join style, not the cap style for the closing point. Otherwise, how can I mitre the first point and last points on a linearring ?

Change History (10)

comment:1 Changed 8 years ago by strk

Same issue exists with JTS. Martin: rationale for that ?

comment:2 Changed 8 years ago by strk

Martin said:

Yes, that probably makes more sense. The only rationale for not doing this already is that it will take some work to create offset linework that reflects this logic. (Currently linearrings are handled by the same code as linestrings, because when the end cap style is round the ends merge seamlessly anyway. Cap styles were added later, but the linearring handling was not enhanced to respect them).

(it would be lovely if trac accepted mail replies, but unfortunately it doesn't, so I'm copy&pasting mailing list only reply ..)

comment:3 Changed 8 years ago by strk

Keywords: jtsfail added

comment:4 Changed 8 years ago by strk


comment:5 Changed 7 years ago by robe


comment:6 Changed 5 years ago by strk

Cc: mbdavis added

Martin, did anything move in JTS about this ?

comment:7 Changed 5 years ago by robe


comment:8 Changed 4 years ago by strk


Ticket retargeted after milestone closed

comment:9 Changed 2 years ago by robe

Milestone: 3.7.0GEOS Future

given that this has been pushed for 6 years I'm going to relegate it to GEOS Future dump bin for anyone to pick up who really wants it.

comment:10 Changed 2 years ago by robe

Milestone: GEOS FutureGEOS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.