Opened 14 years ago

Closed 4 months ago

Last modified 4 months ago

#340 closed enhancement (wontfix)

Buffer creates artefact with flat endcap [JTS fails too]

Reported by: barendgehrels Owned by: strk
Priority: minor Milestone: Upstream
Component: Core Version: main
Severity: Unassigned Keywords: buffer
Cc:

Description

Hi,

A buffer of a quite simple linestring, using endcap=flat, creates two artefacts at the top.

The PostGIS SQL command to reproduce this is:

select ST_AsText(ST_Buffer(ST_GeomFromText('LINESTRING(2 7,3 5,5 4,7 5,8 7)'), 5, 'endcap=flat'));

I've not tested this particular case in GEOS, but have seen similar artefacts originating from GEOS, so suspect GEOS will generate this.

How a buffer with endcap=flat would ideally look like, I'm not sure of, because as soon as a buffer is not having round endcaps and joins, it is not mathematically defined, AFAIK, so the behaviour is more or less up to the implementation. In this case the buffer distance is larger as the vertex distances, so this is probably the cause of this artefact. Anyway, I'm calling it artefact because it's looking strange.

I'm implementing a buffer as well (Boost.Geometry), and especially currently need an asymmetric buffer distance (left/right different) AND end-cap, and the results are different (but also not yet satisfactory).

Regards, Barend

Attachments (1)

flatbuffer.png (6.1 KB ) - added by strk 13 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by strk, 13 years ago

Milestone: GEOS Future
Version: 3.2.0svn-trunk

This would be best discussed with Martin Davis, as JTS is what drives GEOS.

by strk, 13 years ago

Attachment: flatbuffer.png added

comment:2 by strk, 13 years ago

Milestone: GEOS Future3.4.0
Summary: Buffer creates artefact with flat endcapBuffer creates artefact with flat endcap [JTS fails too]

comment:3 by robe, 11 years ago

Milestone: 3.4.03.5.0

I'm going to assume JTS still fails since I don't have JTS to test with. Push back if this is an easy fix.

comment:4 by robe, 9 years ago

Milestone: 3.5.03.6.0

Still an issue

comment:5 by strk, 7 years ago

Milestone: 3.6.03.7.0

Ticket retargeted after milestone closed

comment:6 by robe, 6 years ago

Milestone: 3.7.0GEOS Fund Me

comment:7 by pramsey, 3 years ago

Milestone: GEOS Fund MeUpstream

comment:8 by mdavis, 4 months ago

As the OP observes, the "expected" value of a buffer with flat endcaps and a large buffer distance is not really well-defined. In the absence of a definition, it's not possible to determine how to improve the current result.

comment:9 by mdavis, 4 months ago

Resolution: wontfix
Status: newclosed

comment:10 by mdavis, 4 months ago

What do other computational geometry libraries do in this case?

Note: See TracTickets for help on using tickets.