bleutner / RStoolbox

Remote Sensing Data Analysis in R 🛰
260 stars 82 forks source link

Error in if (!is.projected(x)) { : missing value where TRUE/FALSE needed #9

Closed Daliben closed 8 years ago

Daliben commented 8 years ago

Hi,

Hello,I am currently working on the classification of hyperspectral imagry, I use the "superclass" function package "RStoolbox" the image to be classified and its corresponding traindata have coordinate reference equal to NA, as you can see below .

class : RasterStack dimensions : 1476, 256, 377856, 145 (nrow, ncol, ncell, nlayers) resolution : 1, 1 (x, y) extent : 0, 256, 0, 1476 (xmin, xmax, ymin, ymax) coord. ref. : NA names : image_brute.1, image_brute.2, image_brute.3, image_brute.4, image_brute.5, image_brute.6, image_brute.7, image_brute.8, image_brute.9, image_brute.10, image_brute.11, image_brute.12, image_brute.13, image_brute.14, image_brute.15, ... min values : 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... max values : 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, ...


class : SpatialPointsDataFrame features : 3248 extent : 18, 252, 118, 1093 (xmin, xmax, ymin, ymax) coord. ref. : NA variables : 1 names : label min values : 1

max values : 14

When I run the classification, the following error message appears: "Error in {if (is.projected (x)!): Where missing value TRUE / FALSE needed". Please help me to resolve this problem. Thank you very much in advance.

bleutner commented 8 years ago

Running geo-analyses without a proper projection attached is always risky business... It fails during a buffering operation, which needs to know whether your data are projected or geographical. Set the argument minDist=0 to circumvent this, i.e. no buffer is enforced between training and validation data.

I've added a check and fall-back to minDist=0 for the next release

Daliben commented 8 years ago

Thanks for your reply. when can i get the next release please?

Daliben

Daliben commented 8 years ago

Thanks for your reply. When can i get the next release please?

Daliben

2016-07-21 15:19 GMT+01:00 Benjamin Leutner notifications@github.com:

Running geo-analyses without a proper projection attached is always risky business... It fails during a buffering operation, which needs to know whether your data are projected or geographical. Set the argument minDist=0 to circumvent this, i.e. no buffer is enforced between training and validation data.

I've added a check and fall-back to minDist=0 for the next release

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bleutner/RStoolbox/issues/9#issuecomment-234267896, or mute the thread https://github.com/notifications/unsubscribe-auth/ATn4aVvAVfuM7-u1cp-Gaw7o2KZ_Z6LDks5qX3_ggaJpZM4JRol0 .

bleutner commented 8 years ago

install it from the Github master branch (see https://github.com/bleutner/RStoolbox) if you want the latest version. The next CRAN release is not scheduled yet.

However, setting the minDist argument works just as well with the current CRAN version.

Daliben commented 8 years ago

Many thanks :)