alexbol99 / flatten-js

Javascript library for 2d geometry
MIT License
535 stars 56 forks source link

Support WKT format #179

Closed alexbol99 closed 1 month ago

alexbol99 commented 1 month ago

Add method to parse WKT string to legal Flatten shape or array of shapes: point, segment, multiline, polygon, Support WKT types: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION

alexbol99 commented 1 month ago

In v1.5.6 added function parseWKT(str) to convert single WKT element to flatten-js shape. Type converted as following POINT -> Point, LINESTRING -> Multiline POLYGON -> Polygon MULTIPOINT -> Array MULTILINESTRING -> Array MULTIPOLYGON -> Polygon GEOMETRYCOLLECTION -> Array<Point | Multiline | Polygon>