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

Negative buffer of a polygon can lie outside the input #1208

Open
rohan-shah-nearmap opened this issue Dec 18, 2024 · 2 comments
Open

Negative buffer of a polygon can lie outside the input #1208

rohan-shah-nearmap opened this issue Dec 18, 2024 · 2 comments
Labels

Comments

@rohan-shah-nearmap
Copy link

It's my understanding that the negative buffer of any polygon A must be contained within A (this seems confirmed by the wikipedia page on minkowski addition, which says that (A - B) + B \subseteq A).

But here's an example where taking the buffer by -91 gives a result which is partially outside the original polygon:

geosop -a "POLYGON ((142840271 214449730, 142840245 214449781, 142840188 214449866, 142840184 214449874, 142840172 214449869, 142840170 214449873, 142840103 214449835, 142840107 214449826, 142840058 214449801, 142840065 214449788, 142840037 214449770, 142839987 214449857, 142839983 214449855, 142839982 214449857, 142839972 214449851, 142839967 214449859, 142839920 214449835, 142839864 214449797, 142839866 214449794, 142839857 214449788, 142839930 214449661, 142839946 214449670, 142839953 214449658, 142839955 214449659, 142839967 214449665, 142840012 214449591, 142840029 214449592, 142840029 214449592, 142840036 214449580, 142840051 214449588, 142840049 214449587, 142840071 214449548, 142840128 214449580, 142840127 214449583, 142840193 214449618, 142840195 214449614, 142840203 214449620, 142840203 214449620, 142840211 214449626, 142840218 214449614, 142840221 214449615, 142840221 214449615, 142840221 214449615, 142840222 214449614, 142840269 214449643, 142840296 214449658, 142840296 214449659, 142840303 214449663, 142840303 214449663, 142840304 214449664, 142840300 214449671, 142840300 214449671, 142840296 214449680, 142840296 214449680, 142840292 214449686, 142840288 214449694, 142840289 214449695, 142840287 214449698, 142840291 214449700, 142840273 214449731, 142840271 214449730))" buffer N-91

And the result, for me:

MULTIPOLYGON (((142840062.4897473 214449683.1136721, 142840069.80288216 214449685.11789986, 142840086.2089408 214449693.45275873, 142840114.2089408 214449711.45275873, 142840127.56063256 214449721.91545373, 142840138.7385621 214449734.67435458, 142840143.25818524 214449742.33933526, 142840148.3568011 214449744.94066986, 142840156.24776685 214449749.9608188, 142840166.39488494 214449734.82915148, 142840178.7188775 214449710.65516612, 142840170.91552484 214449707.6959904, 142840166.4896567 214449704.98355108, 142840150.36626068 214449698.3950513, 142840084.89875516 214449663.67743474, 142840071.98609337 214449672.20720527, 142840068.1301442 214449673.8383527, 142840062.4897473 214449683.1136721)), ((142840067.2819317 214449615.1009162, 142840118.02823982 214449600.90243497, 142840090.12982073 214449509.6721526, 142840053.75396985 214449580.09246227, 142840067.2819317 214449615.1009162)), ((142840039.4729357 214449607.73923406, 142840030.32957518 214449625.43994105, 142840044.8366927 214449621.38094556, 142840039.55330694 214449608.18086326, 142840039.4729357 214449607.73923406)), ((142840053.2720298 214449642.407194, 142840028.6929039 214449628.6083865, 142840016.1220111 214449652.94448155, 142840053.2720298 214449642.407194)))

image

My environment is

conda list | grep geos
geos                      3.13.0               h5888daf_0    conda-forge
@dr-jts dr-jts added the Bug label Dec 19, 2024
@dr-jts
Copy link
Contributor

dr-jts commented Dec 19, 2024

This is a bug. It's likely a robustness issue in the noding/topology building which is done inside the buffer algorithm.

@dr-jts
Copy link
Contributor

dr-jts commented Dec 19, 2024

Also a problem in JTS.

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