Возьмите недопустимый многоугольник POLYGON((0 100, 100 100, 0 0, 100 0, 0 100))
- форму таймера яйца с необъявленной точкой пересечения
Многие инструкции говорят, что JTS может создать допустимую версию этого метода buffer
:
Geometry input = new WKTReader().read("POLYGON((0 100, 100 100, 0 0, 100 0, 0 100))");
Geometry output = geom.buffer(0);
return output;
Однако это приводит к выходу POLYGON ((0 100, 100 100, 50 50, 0 100))
, где потеряна часть многоугольника:
Есть ли способ заставить JTS проверять полигоны так, чтобы он выдавал вывод MULTIPOLYGON(((0 100, 100 100, 50 50, 0 100)), ((0 0, 100 0, 50 50, 0 0)))
для ввода, заданного?
Это похоже на то, что должно быть встроено в API (возможно, это поведение является ошибкой) - я что-то пропустил?
Спасибо.