I'm use JSTS 0.17.0 (https://github.com/bjornharrtell/jsts).
How to split the polygon (polygon to multipolygon or two polygons) ?
Input:
POLYGON ((1 1, 1 9, 9 9, 9 1, 1 1))
LINESTRING (0.5 5, 9.6 5, 9.6 3.9)
Result (or):
MULTIPOLYGON (((9 5, 9 1, 1 1, 1 5, 9 5)),((9 9, 9 5, 1 5, 1 9, 9 9)))
GEOMETRYCOLLECTION ( POLYGON ((9 5, 9 1, 1 1, 1 5, 9 5)), POLYGON ((9 9, 9 5, 1 5, 1 9, 9 9)) )
JTS does so:
How do too JSTS ?
PS2
Sorry for my English.