I'm following a tutorial on Remote Sensing within R and I'm attempting to crop a Landsat image, however I'm getting the error: Error in validityMethod(object) : invalid extent: ymin >= ymax
My code is:
# Find the current extent
extent(landsat)
class : Extent
xmin : 269625
xmax : 337155
ymin : 3221685
ymax : 3289215
# Create new extent object
e <- extent(250000, 325000, -3150000,-3250000)
# Crop Landsat
l_crop <- crop(landsat, extent(e))
Is there an error in the syntax or have I missed something?
extent
, but positive coordinates in yourlandsat
data. Is this simply a typo? Did you really meane <- extent(250000, 325000, 3150000, 3250000)
Error in .local(x, y, ...) : extents do not overlap
when I tryl_crop <- crop(landsat, extent(250000, 325000, -3250000, -3150000))
, I have removed the e object.