>>> wkt = 'MULTIPOINT (1.0000000000000000 2.0000000000000000, 2.0000000000000000 3.0000000000000000)' >>> from vectorformats.Formats.WKT import from_wkt, to_wkt >>> from_wkt(wkt) {'type': 'MultiPoint', 'coordinates': [[1.0, 2.0], [2.0, 3.0]]} >>> wkt = 'POINT (1.0000000000000000 2.0000000000000000)' >>> from_wkt(wkt) {'type': 'Point', 'coordinates': [1.0, 2.0]} >>> l1 = 'LINESTRING (0.0000000000000000 1.0000000000000000, 1.0000000000000000 2.0000000000000000)' >>> l2 = 'LINESTRING (10.0000000000000000 11.0000000000000000, 11.0000000000000000 12.0000000000000000)' >>> from_wkt(l1) {'type': 'LineString', 'coordinates': [[0.0, 1.0], [1.0, 2.0]]} >>> multi_ls = 'MULTILINESTRING ((0.0000000000000000 1.0000000000000000, 1.0000000000000000 2.0000000000000000), (10.0000000000000000 11.0000000000000000, 11.0000000000000000 12.0000000000000000))' >>> from_wkt(multi_ls) {'type': 'MultiLineString', 'coordinates': [[[0.0, 1.0], [1.0, 2.0]], [[10.0, 11.0], [11.0, 12.0]]]} >>> multi_poly = 'MULTIPOLYGON(((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 0)),((-1 -1 0,-1 -2 0,-2 -2 0,-2 -1 0,-1 -1 0)))' >>> from_wkt(multi_poly) {'type': 'MultiPolygon', 'coordinates': [[[0.0, 0.0, 0.0], [4.0, 0.0, 0.0], [4.0, 4.0, 0.0], [0.0, 4.0, 0.0], [0.0, 0.0, 0.0]], [[1.0, 1.0, 0.0], [2.0, 1.0, 0.0], [2.0, 2.0, 0.0], [1.0, 2.0, 0.0], [1.0, 1.0, 0.0]], [[-1.0, -1.0, 0.0], [-1.0, -2.0, 0.0], [-2.0, -2.0, 0.0], [-2.0, -1.0, 0.0], [-1.0, -1.0, 0.0]]]} >>> to_wkt(from_wkt(multi_poly)) 'MultiPolygon(((0.000000 0.000000 0.000000,4.000000 0.000000 0.000000,4.000000 4.000000 0.000000,0.000000 4.000000 0.000000,0.000000 0.000000 0.000000)), ((1.000000 1.000000 0.000000,2.000000 1.000000 0.000000,2.000000 2.000000 0.000000,1.000000 2.000000 0.000000,1.000000 1.000000 0.000000)), ((-1.000000 -1.000000 0.000000,-1.000000 -2.000000 0.000000,-2.000000 -2.000000 0.000000,-2.000000 -1.000000 0.000000,-1.000000 -1.000000 0.000000)))' >>> from_wkt(to_wkt(from_wkt(l1))) {'type': 'LineString', 'coordinates': [[0.0, 1.0], [1.0, 2.0]]}