You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that using polygonize on a single cell raster leads to an error. With a single column raster, it leads to a warning. Below is an example. This is with spex 0.7.1. Thanks!
library(raster)
library(sf)
library(spex)
r<-setValues(raster(ncol=1,nrow=1),1)
polygonize(r)
## Error in seq_len(ncol(IB)) : ## argument must be coercible to non-negative integer## In addition: Warning messages:## 1: In rbind(aa, aa[2:1, ]) :## number of columns of result is not a multiple of vector length (arg 2)## 2: In c(rbind(aa, aa[2:1, ])) + c(0, 0, nc1, nc1) :## longer object length is not a multiple of shorter object length## 3: In seq_len(ncol(IB)) : first element used of 'length.out' argumentr<-setValues(raster(ncol=1,nrow=2),1)
polygonize(r)
## Simple feature collection with 2 features and 1 field## geometry type: POLYGON## dimension: XY## bbox: xmin: -180 ymin: -90 xmax: 180 ymax: 90## CRS: +proj=longlat +datum=WGS84 +no_defs## layer geometry## 1 1 POLYGON ((-180 90, 180 90, ...## 2 1 POLYGON ((-180 0, 180 0, 18...## Warning messages:## 1: In rbind(aa, aa[2:1, ]) :## number of columns of result is not a multiple of vector length (arg 2)## 2: In c(rbind(aa, aa[2:1, ])) + c(0, 0, nc1, nc1) :## longer object length is not a multiple of shorter object lengthr<-setValues(raster(ncol=2,nrow=1),1)
polygonize(r)
## Simple feature collection with 2 features and 1 field## geometry type: POLYGON## dimension: XY## bbox: xmin: -180 ymin: -90 xmax: 180 ymax: 90## CRS: +proj=longlat +datum=WGS84 +no_defs## layer geometry## 1 1 POLYGON ((-180 90, 0 90, 0 ...## 2 1 POLYGON ((0 90, 180 90, 180...r<-setValues(raster(ncol=2,nrow=2),1)
polygonize(r)
## Simple feature collection with 4 features and 1 field## geometry type: POLYGON## dimension: XY## bbox: xmin: -180 ymin: -90 xmax: 180 ymax: 90## CRS: +proj=longlat +datum=WGS84 +no_defs## layer geometry## 1 1 POLYGON ((-180 90, 0 90, 0 ...## 2 1 POLYGON ((0 90, 180 90, 180...## 3 1 POLYGON ((-180 0, 0 0, 0 -9...## 4 1 POLYGON ((0 0, 180 0, 180 -...
The text was updated successfully, but these errors were encountered:
Hello!
I noticed that using polygonize on a single cell raster leads to an error. With a single column raster, it leads to a warning. Below is an example. This is with spex 0.7.1. Thanks!
The text was updated successfully, but these errors were encountered: