I am creating a WRT string from a specialPolygons object in R.
However I am surprised by the number of digits in the output. Is there a way to reduce it?
x = sp::SpatialPolygons(Srl = list(sp::Polygons(srl = list(sp::Polygon(coords = cbind(c(-19.8, -19.9, -19.9, -19.8, -19.8),c(148, 148, 148.2, 148.2, 148)))), ID = "1")), pO = 1:1)
rgeos::writeWKT(x)
This gives me:
"POLYGON ((-19.8000000000000007 148.0000000000000000, -19.8999999999999986 148.0000000000000000, -19.8999999999999986 148.1999999999999886, -19.8000000000000007 148.1999999999999886, -19.8000000000000007 148.0000000000000000))"