Description Usage Arguments Details Value Note Author(s) Examples
Representing each raster cell as a polygon. In comparison to common GIS raster to vector conversion, where neighbor cells with the same value are combined to the single polygon, the number of output polygons is equal to number of non-NA
values.
1 | polygonize(obj, fname, engine = c("native", "sp", "sf"), verbose = NA, ...)
|
obj |
Object of class |
fname |
Missing or character. If specified, then ESRI Shapefile is created. Default is missing. |
engine |
Character keyword from list |
verbose |
Logical. If |
... |
Additional arguments, which are passed to internal function for writting ESRI Shapefile.
|
Some GIS software (e.g., QGIS) has broad tools for display vector data. Excepting choroplets, it is assumed that visualization of each cell separately is more attractive than displaying of polygons with different forms, which are produced, for example, by GDAL convertion utillity gdal_polygonize.py.
If missing fname
and tools from sp then object of class "SpatialPolygonsDataFrame" (package sp).
If missing fname
and tools from sf then object of class "sf" with geometry of class "sfc_POLYGON" (package sf).
If fname
is specified, then NULL
.
Implementation is very slow even for moderate image size. Use progress bar (verbose=TRUE
) to control this process.
Nikita Platonov platonov@sevin.ru
1 2 3 4 5 6 7 8 9 | session_grid(NULL)
a <- ursa_dummy(mul=1/16)
a <- a[a>100]
print(a)
print(band_mean(a))
b2 <- polygonize(a,engine="sp") ## try 'engine="sf"'
print(colMeans(spatial_data(b2),na.rm=TRUE))
print(ursa_bbox(a))
print(spatial_bbox(b2))
|
name mean sd sum min max n nNA
[1] Wednesday 30 142.906 27.2601 46158.7 100.044 208.099 323 209
[2] Thursday 31 162.447 38.6445 64004.1 100.208 242.141 394 138
[3] Friday 01 157.333 32.2029 69541.0 100.260 233.472 442 90
Wednesday 30 Thursday 31 Friday 01
142.9062 162.4470 157.3325
================================================================================
Wednesday 30 Thursday 31 Friday 01
142.9062 162.4470 157.3325
xmin ymin xmax ymax
-3850000 -5350000 3750000 5850000
attr(,"crs")
[1] "+proj=stere +lat_0=90 +lat_ts=70.0 +lon_0=-45.0 +k=1 +x_0=0.0 +y_0=0.0 +a=6378273.000 +b=6356889.449 +units=m +no_defs"
xmin ymin xmax ymax
-3850000 -5350000 3750000 5850000
attr(,"crs")
[1] "+proj=stere +lat_0=90 +lat_ts=70.0 +lon_0=-45.0 +k=1 +x_0=0.0 +y_0=0.0 +a=6378273.000 +b=6356889.449 +units=m +no_defs"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.