mr_as_wkt | R Documentation |
Convert data to WKT
mr_as_wkt(x, fmt = 16, ...)
x |
Output from |
fmt |
(integer) The number of digits to display after the decimal
point when formatting coordinates. Ignored when shp files or
|
... |
Further args passed on to |
WKT, or Well Known Text, is a way to encode spatial data. It's
somewhat similar to GeoJSON, but instead of being in JSON format, it's a
character string (though can also be encoded in binary format). WKT is
often used in SQL databases, and many species occurrence APIs allow only
WKT. You could do the conversion to WKT yourself, but we provide
as_wkt
as a convenience
a character string of WKT data
## Not run:
res <- mr_geojson(key = "Morocco:dam")
mr_as_wkt(res)
# shp files
## path to wkt
mr_as_wkt(mr_shp(key = "Morocco:dam", read = FALSE))
## spatial object to wkt
mr_as_wkt(mr_shp(key = "Morocco:dam", read = TRUE))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.