Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] buffer(0) is dropping a polygon in a multipolygon

Hi, Fernando.  Glad that JTS is helpful for you. 

Thanks for the issue report.  Github is the best place to file issues, but since you can't for some reason this is the next best place.

I can reproduce your problem in JTS 1.20.  This wasn't a problem in JTS 1.19.  And good news - it has been fixed in the current JTS code base.  (I'm not sure which change fixed this - there were a number of fixes for the buffer code since the 1.20 release.,).  

By the way, the buffer(0) trick has be superseded by the GeometryFixer class, so you might want to try using that.

cheers - Martin




On Wed, Jun 10, 2026 at 2:13 AM Fernando González Cortés via jts-dev <jts-dev@xxxxxxxxxxx> wrote:
Hi all,

First of all, I've been using JTS for around 25 years and I would like
to thank you for all the work these many years.

Recently (JTS 1.20.0) I found a case where running buffer(0) is dropping
a polygon from a multipolygon. The input[1] consists of two polygons and
is valid. But running the buffer(0) operation just drops one of the
polygons.

Is this a bug? It is at least worrying, buffer(0) being the way I try to
get out of trouble in JTS :S

Wanted to open a github issue but couldn't. Please, let me know if this
is not the right channel.


[1]

MULTIPOLYGON (((214830.95 6388204.12, 214829.08 6388209.43, 214827.77
6388212.04, 214825.97 6388216.43, 214825.29 6388219.74, 214826.03
6388223.43, 214829.03 6388227.85, 214829.46 6388227.95, 214832.86
6388227.65, 214836.87 6388224.59, 214839.3 6388222.27, 214841.26
6388220.79, 214842.22 6388219.75, 214843.21 6388218.2, 214844.34
6388216.88, 214845.03 6388214.69, 214844.96 6388214.68, 214844.89
6388214, 214844.69 6388213.34, 214844.37 6388212.74, 214843.94
6388212.21, 214843.41 6388211.77, 214842.8 6388211.45, 214842.14
6388211.25, 214841.46 6388211.18, 214841.39 6388210.5, 214841.19
6388209.84, 214840.87 6388209.24, 214840.44 6388208.71, 214839.91
6388208.27, 214839.3 6388207.95, 214838.64 6388207.75, 214837.96
6388207.68, 214837.89 6388207, 214837.69 6388206.34, 214837.37
6388205.74, 214836.94 6388205.21, 214836.41 6388204.77, 214835.8
6388204.45, 214835.14 6388204.25, 214834.46 6388204.18, 214830.96
6388204.18, 214830.95 6388204.12)), ((214921.96 6388211.29, 214921.96
6388214.68, 214921.28 6388214.75, 214920.62 6388214.95, 214920.24
6388215.15, 214920.63 6388216.43, 214921.67 6388218.48, 214923.17
6388220.12, 214923.71 6388220.47, 214924.58 6388221.83, 214925.36
6388222.63, 214928.95 6388225.36, 214930.71 6388226.22, 214933.07
6388226.73, 214933.73 6388227.14, 214933.22 6388229.44, 214933.31
6388230.43, 214931.8 6388232.27, 214929.54 6388236.26, 214928.23
6388239.18, 214926.52 6388241.99, 214925.4 6388243.45, 214924
6388244.92, 214920.72 6388246.61, 214919.89 6388246.82, 214917
6388247.01, 214912.75 6388246.98, 214909.94 6388247.17, 214906.56
6388246.65, 214901.85 6388244.56, 214897.33 6388241.25, 214896.83
6388240.71, 214896.58 6388240.06, 214895.71 6388238.91, 214894.99
6388237.43, 214892.43 6388230.66, 214892.09 6388228.78, 214891.76
6388225.18, 214890.46 6388225.18, 214889.78 6388225.25, 214889.12
6388225.45, 214888.52 6388225.77, 214888.08 6388226.13, 214888.89
6388230.43, 214889.82 6388233.66, 214891.62 6388237.43, 214894.09
6388241.52, 214895.71 6388243.21, 214897.27 6388244.43, 214903.53
6388247.81, 214906.21 6388250.24, 214908.67 6388251.19, 214909.71
6388251.89, 214916.14 6388250.58, 214919.87 6388250.2, 214922.06
6388249.78, 214924.64 6388248.87, 214925.62 6388247.93, 214926.68
6388247.4, 214927.21 6388246.65, 214928.56 6388245.78, 214929.14
6388244.43, 214929.9 6388243.62, 214930.68 6388240.96, 214931.78
6388239.21, 214932.14 6388238.36, 214932.32 6388237.43, 214934.15
6388233.88, 214941.21 6388227.22, 214942.6 6388224.82, 214943.72
6388223.43, 214944.01 6388222.73, 214944.71 6388222, 214945.4 6388220.1,
214945.65 6388216.7, 214944.81 6388209.43, 214945.52 6388206.4, 214946.7
6388205.08, 214947.59 6388204.35, 214948.7 6388204.08, 214952.07
6388204.36, 214955.21 6388206.1, 214956.79 6388207.23, 214958.84
6388209.31, 214961.01 6388212.09, 214961.67 6388213.06, 214962.21
6388214.43, 214964.87 6388216.72, 214965.5 6388218.19, 214965.71
6388218.33, 214966.16 6388218.05, 214966.57 6388217.29, 214966.66
6388216.66, 214967.09 6388216.06, 214968.88 6388214.58, 214970.23
6388213.09, 214971.14 6388212.5, 214973.13 6388211.65, 214976.21
6388211.08, 214980.51 6388210.66, 214983.33 6388209.55, 214984.56
6388208.65, 214987.25 6388206.12, 214988.91 6388204.04, 214991.5
6388199.72, 214992.66 6388197.25, 214992.64 6388197.25, 214991.96
6388197.18, 214991.89 6388196.5, 214991.69 6388195.84, 214991.37
6388195.24, 214990.94 6388194.71, 214990.41 6388194.27, 214989.8
6388193.95, 214989.14 6388193.75, 214988.46 6388193.68, 214985.93
6388193.68, 214984.92 6388198.93, 214983.61 6388202.28, 214980.81
6388206.13, 214979.33 6388206.97, 214972.71 6388208.9, 214971.91
6388209.43, 214967.42 6388211.45, 214966.08 6388212.24, 214965.71
6388212.29, 214965.33 6388212.22, 214962.03 6388210.42, 214960.61
6388208.33, 214958.14 6388205.93, 214956.92 6388204.22, 214955.21
6388202.76, 214954.49 6388202.43, 214953.58 6388200.56, 214952.36
6388198.93, 214953.27 6388192.35, 214953.38 6388190.18, 214944.71
6388190.18, 214945.3 6388191.55, 214946.2 6388195.06, 214946.21
6388195.81, 214945.56 6388198.69, 214945.36 6388199.05, 214944.77
6388199.35, 214944.45 6388199.92, 214943.34 6388202.43, 214942.56
6388203.78, 214941.75 6388206.08, 214941.91 6388213.26, 214941.39
6388214.87, 214941.21 6388214.98, 214941.06 6388214.82, 214940.72
6388213.42, 214940.17 6388212.93, 214939.62 6388211.74, 214939.28
6388211.36, 214938.88 6388211.11, 214938.14 6388210.98, 214937.52
6388210.57, 214936.06 6388207.59, 214934.21 6388205.81, 214932.76
6388203.89, 214930.86 6388202.01, 214928.96 6388200.81, 214928.96
6388203.94, 214930.71 6388204.86, 214931.4 6388205.54, 214932.74
6388207.4, 214934.03 6388209.61, 214935.59 6388211.56, 214937.45
6388214.66, 214938.68 6388216.04, 214939.34 6388219.93, 214939.18
6388220.87, 214938.67 6388221.6, 214937.23 6388222.96, 214934.86
6388224.43, 214933.96 6388224.45, 214930.5 6388223.64, 214928.01
6388222.02, 214926.1 6388220.35, 214924.79 6388218.17, 214921.96
6388211.29)))

_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jts-dev

Back to the top