ropensci-archive/wellknown

probably can not have a mix of 2 and (3 or 4) digits for WKT

Closed this issue · 1 comments

so in geojson2wkt(), e.g . if one polygon in a multipolygon has just lat and long, and another polygon has lat, long, and altitude, that i imagine isn't allowed

sf package simply reads it in and converts all 2D points to 3D points

xx <- sf::st_as_sfc("MULTIPOLYGON (((100.000 0.001, 101.000 0.001, 101.000 1.001, 100.000 0.001), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.2)), ((1 4 7, 2 5 8, 3 6 1), (9 12 3, 10 1 4, 11 2 9)))")
#> Geometry set for 1 feature
#> geometry type:  MULTIPOLYGON
#> dimension:      XYZ
#> bbox:           xmin: 1 ymin: 0.001 xmax: 101 ymax: 12
#> epsg (SRID):    NA
#> proj4string:    NA
#> MULTIPOLYGON Z (((100 0.001 0, 101 0.001 0, 101...
unclass(xx)
#> [[1]]
#> MULTIPOLYGON Z (((100 0.001 0, 101 0.001 0, 101 1.001 0, 100 0.001 0), (100.2 0.2 0, 100.8 0.2 0, 100.8 0.8 0, 100.2 0.2 0)), ((1 4 7, 2 5 8, 3 6 1), (9 12 3, 10 1 4, 11 2 9)))