polygon.buffer works incorrectly.
See original GitHub issueExpected behavior and actual behavior.
Only buffer(-1e-6) works incorrectly. it makes area to zero. But buffer(-1e-5) and buffer(-1e-7) works well. what makes this difference?
Steps to reproduce the problem.
polygon boundary data :
[(-1567709.3083706305, 21844.531770653648),
(-1567709.3083706305, 21844.53177065363),
(-1567709.3083706896, 21844.53177057533),
(-1567709.3083707409, 21844.531770491605),
(-1567709.3083707835, 21844.531770403268),
(-1567709.3083708175, 21844.531770311165),
(-1567709.3083708421, 21844.53177021619),
(-1567709.3083708573, 21844.531770119247),
(-1567709.308370863, 21844.53177002128),
(-1567709.3083708591, 21844.531769923226),
(-1567709.3083708456, 21844.531769826033),
(-1567709.3083708226, 21844.53176973063),
(-1567709.3083707902, 21844.531769637946),
(-1567709.3083707492, 21844.53176954887),
(-1567709.3083706994, 21844.531769464254),
(-1567709.3083706417, 21844.53176938492),
(-1567709.3083705765, 21844.531769311627),
(-1567709.3083705043, 21844.531769245084),
(-1567709.3083705043, 21844.531769245077),
(-1566848.2390979272, 21125.044030739882),
(-1567633.4133449628, 20185.362391208644),
(-1567633.4133449628, 20185.362391208626),
(-1567633.413345022, 20185.362391130326),
(-1567633.4133450731, 20185.3623910466),
(-1567633.4133451157, 20185.362390958264),
(-1567633.4133451497, 20185.36239086616),
(-1567633.4133451744, 20185.362390771184),
(-1567633.4133451895, 20185.362390674243),
(-1567633.4133451954, 20185.362390576276),
(-1567633.4133451914, 20185.36239047822),
(-1567633.413345178, 20185.36239038103),
(-1567633.4133451548, 20185.362390285627),
(-1567633.4133451225, 20185.362390192942),
(-1567633.4133450815, 20185.362390103866),
(-1567633.4133450317, 20185.36239001925),
(-1567633.413344974, 20185.362389939917),
(-1567633.4133449087, 20185.362389866623),
(-1567633.4133448366, 20185.36238980008),
(-1567633.4133448366, 20185.362389800073),
(-1563671.4730493322, 16874.865135169068),
(-1563671.4730493322, 16874.865135169075),
(-1563671.473049254, 16874.865135109918),
(-1563671.47304917, 16874.865135058724),
(-1563671.4730490819, 16874.86513501598),
(-1563671.4730489897, 16874.865134982105),
(-1563671.4730488947, 16874.865134957417),
(-1563671.4730487978, 16874.86513494216),
(-1563671.4730486998, 16874.86513493648),
(-1563671.4730486018, 16874.865134940428),
(-1563671.4730485044, 16874.865134953972),
(-1563671.4730484092, 16874.865134976975),
(-1563671.4730483163, 16874.865135009222),
(-1563671.4730482274, 16874.865135050397),
(-1563671.4730481426, 16874.865135100103),
(-1563671.4730480635, 16874.865135157866),
(-1563671.4730479901, 16874.865135223128),
(-1563671.4730479235, 16874.865135295262),
(-1563671.4730479235, 16874.865135295244),
(-1559153.4332911205, 22281.96938299714),
(-1559153.4332910613, 22281.96938307546),
(-1559153.43329101, 22281.969383159183),
(-1559153.4332909675, 22281.96938324752),
(-1559153.4332909335, 22281.969383339623),
(-1559153.4332909088, 22281.9693834346),
(-1559153.4332908937, 22281.96938353154),
(-1559153.4332908879, 22281.96938362951),
(-1559153.4332908918, 22281.969383727563),
(-1559153.4332909053, 22281.969383824755),
(-1559153.4332909284, 22281.969383920157),
(-1559153.4332909607, 22281.969384012842),
(-1559153.4332910017, 22281.969384101918),
(-1559153.4332910515, 22281.969384186534),
(-1559153.4332911093, 22281.969384265867),
(-1559153.4332911745, 22281.96938433916),
(-1559153.4332912466, 22281.969384405704),
(-1559153.4332912466, 22281.96938440571),
(-1560022.394099932, 23008.051091188066),
(-1560022.394099932, 23008.05109118806),
(-1560022.3941000102, 23008.051091247216),
(-1560022.394100094, 23008.05109129841),
(-1560022.3941001822, 23008.051091341153),
(-1560022.3941002744, 23008.05109137503),
(-1560022.3941003694, 23008.051091399717),
(-1560022.3941004663, 23008.051091414975),
(-1560022.3941005643, 23008.051091420653),
(-1560022.3941006623, 23008.051091416706),
(-1560022.3941007596, 23008.051091403162),
(-1560022.3941008549, 23008.05109138016),
(-1560022.3941009478, 23008.051091347912),
(-1560022.3941010367, 23008.051091306737),
(-1560022.3941011215, 23008.05109125703),
(-1560022.3941012006, 23008.051091199268),
(-1560022.394101274, 23008.051091134006),
(-1560022.3941013406, 23008.051091061872),
(-1560022.3941013406, 23008.05109106189),
(-1561246.8250177177, 21542.67540491616),
(-1562587.3225330082, 22662.761275431232),
(-1562587.3225330082, 22662.761275431225),
(-1562587.3225330864, 22662.761275490382),
(-1562587.3225331702, 22662.761275541576),
(-1562587.3225332585, 22662.76127558432),
(-1562587.3225333507, 22662.761275618195),
(-1562587.3225334457, 22662.761275642883),
(-1562587.3225335425, 22662.76127565814),
(-1562587.3225336405, 22662.76127566382),
(-1562587.3225337386, 22662.761275659872),
(-1562587.322533836, 22662.761275646328),
(-1562587.3225339311, 22662.761275623325),
(-1562587.322534024, 22662.761275591078),
(-1562587.322534113, 22662.761275549903),
(-1562587.3225341977, 22662.761275500197),
(-1562587.3225342769, 22662.761275442434),
(-1562587.3225343502, 22662.761275377172),
(-1562587.3225344168, 22662.761275305038),
(-1562587.3225344168, 22662.761275305056),
(-1563827.8108540243, 21178.168393675307),
(-1566088.6549106995, 23067.272591508467),
(-1565168.3083691986, 24168.725868050966),
(-1565168.3083691986, 24168.725868050984),
(-1565168.3083691394, 24168.725868129284),
(-1565168.3083690882, 24168.72586821301),
(-1565168.3083690456, 24168.725868301346),
(-1565168.3083690116, 24168.72586839345),
(-1565168.308368987, 24168.725868488425),
(-1565168.3083689718, 24168.725868585367),
(-1565168.308368966, 24168.725868683334),
(-1565168.30836897, 24168.72586878139),
(-1565168.3083689834, 24168.72586887858),
(-1565168.3083690065, 24168.725868973983),
(-1565168.3083690389, 24168.725869066668),
(-1565168.3083690798, 24168.725869155744),
(-1565168.3083691297, 24168.72586924036),
(-1565168.3083691874, 24168.725869319693),
(-1565168.3083692526, 24168.725869392987),
(-1565168.3083693248, 24168.725869459537),
(-1566088.6549107092, 24937.744196777505),
(-1565168.3083692326, 26039.19747329144),
(-1565168.3083691734, 26039.19747336976),
(-1565168.3083691222, 26039.197473453485),
(-1565168.3083690796, 26039.197473541826),
(-1565168.3083690456, 26039.19747363393),
(-1565168.308369021, 26039.19747372891),
(-1565168.3083690058, 26039.197473825854),
(-1565168.308369, 26039.197473923825),
(-1565168.308369004, 26039.19747402188),
(-1565168.3083690174, 26039.197474119075),
(-1565168.3083690405, 26039.197474214478),
(-1565168.3083690729, 26039.197474307162),
(-1565168.3083691138, 26039.197474396242),
(-1565168.3083691637, 26039.197474480858),
(-1565168.3083692214, 26039.19747456019),
(-1565168.3083692866, 26039.197474633485),
(-1565168.3083693588, 26039.197474700028),
(-1565168.308369437, 26039.197474759178),
(-1565168.3083695208, 26039.197474810368),
(-1565168.308369609, 26039.197474853107),
(-1565168.3083697013, 26039.19747488698),
(-1565168.3083697963, 26039.197474911663),
(-1565168.308369893, 26039.197474926917),
(-1565168.3083699911, 26039.197474932596),
(-1565168.3083700892, 26039.197474928646),
(-1565168.3083701865, 26039.1974749151),
(-1565168.3083702817, 26039.1974748921),
(-1565168.3083703746, 26039.19747485985),
(-1565168.3083704636, 26039.197474818677),
(-1565168.3083705483, 26039.19747476897),
(-1565168.3083706275, 26039.197474711207),
(-1565168.3083707008, 26039.197474645945),
(-1565168.3083707674, 26039.197474573815),
(-1565168.3083707674, 26039.197474573833),
(-1567415.8784531695, 23349.348249428767),
(-1567709.3083691455, 23594.530876865312),
(-1567709.3083691455, 23594.530876865305),
(-1567709.3083692237, 23594.53087692446),
(-1567709.3083693075, 23594.530876975652),
(-1567709.3083693958, 23594.530877018395),
(-1567709.308369488, 23594.53087705227),
(-1567709.308369583, 23594.53087707696),
(-1567709.3083696798, 23594.530877092217),
(-1567709.3083697779, 23594.5308770979),
(-1567709.308369876, 23594.530877093952),
(-1567709.3083699732, 23594.53087708041),
(-1567709.3083700684, 23594.530877057412),
(-1567709.308370161, 23594.53087702517),
(-1567709.3083702503, 23594.530876983998),
(-1567709.3083703348, 23594.530876934292),
(-1567709.3083704142, 23594.53087687653),
(-1567709.3083704875, 23594.530876811277),
(-1567709.3083705541, 23594.530876739147),
(-1567709.3083706133, 23594.530876660847),
(-1567709.3083706645, 23594.530876577122),
(-1567709.308370707, 23594.530876488785),
(-1567709.308370741, 23594.530876396682),
(-1567709.3083707658, 23594.530876301702),
(-1567709.308370781, 23594.53087620476),
(-1567709.3083707867, 23594.53087610679),
(-1567709.3083707828, 23594.530876008732),
(-1567709.3083707693, 23594.530875911536),
(-1567709.3083707462, 23594.530875816134),
(-1567709.3083707138, 23594.530875723445),
(-1567709.3083706729, 23594.530875634366),
(-1567709.308370623, 23594.53087554975),
(-1567709.3083705653, 23594.530875470413),
(-1567709.3083705, 23594.53087539712),
(-1567709.308370428, 23594.530875330573),
(-1567709.308370428, 23594.530875330565),
(-1566848.2390978509, 22875.04313682535),
(-1567709.3083706305, 21844.531770653648)]
Operating system
windows 10
Shapely version and provenance
1.6.4.post2 installed with pip
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
polygon.buffer works incorrectly. · Issue #923 · shapely/shapely ...
Expected behavior and actual behavior. Only buffer(-1e-6) works incorrectly. it makes area to zero. But buffer(-1e-5) and buffer(-1e-7) works well. what ...
Read more >Problem: An incorrect buffer distance is generated in the ...
In ArcGIS Pro, the Buffer tool can be used to create a polygon that covers a given distance from a point, line, or...
Read more >Fixed buffers and interior buffers are not working for a polygon ...
I noticed that the buffer shape is different between the two results, but it is more accurate in [OGR] Buffer vectors tool than...
Read more >c++ - Poor or incorrect results when using Boost Geometry for ...
Save this question. Show activity on this post. I am using Boost::Geometry::Buffer to create an inner offset, or dilation, of irregularly ...
Read more >Graphic Buffer (Analysis)—ArcMap | Documentation
Doing so will result in incorrect results. The input features can be point, line or polygon. The options available for the buffer output...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mwtoews I was about to post almost exactly the same screenshot of JTS testbuilder but you beat me to it!
This is a bug with GEOS master (ish) on Linux, as confirmed with PostGIS. The buffer returns
POLYGON EMPTY
. The valid input has hex-encoded WKB:It is not a bug with JTS, which returns a non-empty:
There is a history of buffer robustness issues with JTS/GEOS, see this trac from ~9 years ago. Also, anyone that follows @dr-jts will know there are some fantastic advancements with OverlayNG in JTS that provide more robust buffer outputs, read about them here. Paul Ramsey has started porting this to GEOS, and would appreciate some help.