Tag Info

New answers tagged

1

Adding a .tif extension to the file name solved the problem.


2

According to the Earth Explorer metadata on NAIP JPEG2000: The U.S. Geological Survey (USGS) Earth Resources Observation and Science (EROS) Center manages and distributes NAIP products in JPEG2000 format, which is a compressed file with embedded georeferencing information. The 10:1 lossy compression makes the file size smaller by reorganizing the ...


2

You cannot have R objects called "2000", so presumably these are fake names? Your example actually should work, so you may want to double check why you think that the results are incorrect. @aaryno's approach should work. I would do this: library(raster) s <- stack(r2000, r2001, r2002, r2003, r2004, r2005) x <- reclassify(s, cbind(0, NA)) r <- ...


3

I wanted to point out that you can rewrite the mean function, mean, which you can write yourself to do anything you want, including ditch the 0 values and calculate the mean. For example, if you want to ignore 0s: meanIgnoringZeroes <- function(x) { mean(x[x!=0],na.rm=T) } Then you can pass the function, meanIgnoringZeroes to overlay: mean <- ...


-2

Perhaps you should try this : new_file=na.omit(file). I think with this you can ignore NAs.


0

Apart from gdal (see other answers) and building a virtual file, you can use the OTB library. This is a C++ open source library including a large set of filters for image processing. Specifically, the otb::MultiChannelExtractROI does the trick. It is also available as an application if you want to use it directly.


0

Use gdal.GDT_Float32 not GDT_Byte. The Byte datatype is unsigned 8 bit integer. That means it can only hold values from 0-255. If you try to include values <0 or >255 they will overflow, i.e -1 will be converted to 255, -2 to 254 and 256 to 0 and 257 to 1 etc... Your code works fine with Float32 datatype, see image below. You may be seeing "values of ...


2

You need to post the input raster (in UTM) information too so a true before-and-after comparison can be made. Representing data using lat/lon in a raster means using a Plate Carree-like projection and treating the decimal degree values as if they're linear measures. UTM data is often 'tilted' in comparison so data is resampled. There'll be 'no data' values ...


1

It looks very strange, but warping with QGIS (which runs its embedded gdalwarp) is much faster! I was able to process 14Gb file in 70 minutes, on windows, without much resource consumption. It still was not looking like it used multiple cores, but did the work, which is great. Also, it seems the same applies to gdal_translate. Probably, they build gdal ...


5

In the text there is basically an error in that there should be another sub heading between the SRTM data download section and the imagery download section. We provide a methodology for obtaining SRTM data, but you are left to your own initiative to find local imagery data. I will update the text to address this.


6

Chris, Your confusion stems from the distinction between the image represented by image 1 (a true color image) and the DEM you downloaded. The two are very different things and this distinction is one of the very great things about raster analysis in geospatial science! Image 1 is a high-resolution true color satellite image or aerial photograph such as ...



Top 50 recent answers are included