Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer of a Linestring returns a Polygon with hole artifact #1217

Open
nbvfgh opened this issue Jan 2, 2025 · 1 comment
Open

Buffer of a Linestring returns a Polygon with hole artifact #1217

nbvfgh opened this issue Jan 2, 2025 · 1 comment
Labels

Comments

@nbvfgh
Copy link

nbvfgh commented Jan 2, 2025

Considering following queries:

DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;

CREATE TABLE t1 (geom geometry);
CREATE TABLE t2 (geom geometry);

INSERT INTO t1 VALUES (ST_GeomFromText('LINESTRING (1.6 0.7, 0.7 4.7, 145.6 137.7, 146.3 137.1, 146.3 137, 146.6 136.7)', 0));
INSERT INTO t2 VALUES (ST_Buffer(ST_GeomFromText('LINESTRING (1.6 0.7, 0.7 4.7, 145.6 137.7, 146.3 137.1, 146.3 137, 146.6 136.7)', 0)
,13));

SELECT ST_Distance(t1.geom,ST_ExteriorRing(t2.geom)), ST_Distance(t1.geom, ST_InteriorRingN(t2.geom, 1)) FROM t1, t2;
--result: {12.92237619733858, 0.12670001936357617}

SELECT ST_AsText(ST_InteriorRingN(geom, 1)) FROM t2;
--result: {LINESTRING(136.30661486829771 128.78362948415392,136.19999999999973 128.90000000000035,137.10761184457445 127.80761184457532,136.30661486829771 128.78362948415392)}

The buffer has created an unexpected hole and is too close to the original input.
图片

@dr-jts dr-jts added the Bug label Jan 2, 2025
@dr-jts
Copy link
Contributor

dr-jts commented Jan 2, 2025

This is a bug in buffer topology building.

@dr-jts dr-jts changed the title Buffer of a Linestring returns a Polygons with boundary too close to the Linestring Buffer of a Linestring returns a Polygon with boundary too close to the Linestring Jan 4, 2025
@dr-jts dr-jts changed the title Buffer of a Linestring returns a Polygon with boundary too close to the Linestring Buffer of a Linestring returns a Polygon with hole too close to the Linestring Jan 4, 2025
@dr-jts dr-jts changed the title Buffer of a Linestring returns a Polygon with hole too close to the Linestring Buffer of a Linestring returns a Polygon with hole artifact Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants