4

This documentation from xarray outlines quite simply the solution to the problem. xarray allows you to interpolate in multiple dimensions and specify another Dataset's x and y dimensions as the output dimensions. So in this case it is done with # interpolation based on http://xarray.pydata.org/en/stable/interpolation.html # interpolation can't be done ...


4

By resampling a 30m pixel at 1m, you're just breaking each Landsat pixel up into 900 smaller pixels, but they each have the same value as the large pixel. So the borders you see will not go away via resampling alone. If you want to make the borders go away, you're going to have to smooth your resampled image. Not sure what programming language you're using, ...


4

The resample tool does have a method which produces the output you need, NEAREST. ratio = some_number cell_y = str(input_raster.meanCellHeight * ratio) cell_x = str(input_raster.meanCellWidth * ratio) arcpy.Resample_management( 'input_raster', 'output_raster', cell_x + ' ' + cell_y, "NEAREST") If your input raster cells are square, you can omit defining ...


4

You changed the following lines from my original code from: transform = Affine(t.a / scale, t.b, t.c, t.d, t.e / scale, t.f) # <== division height = raster.height * scale # <== multiplication width = raster.width * scale To: transform = Affine(t.a / scale, t.b, t.c, t.d, t.e / scale, t.f) # <== division height =...


3

You need to recreate a DatasetReader manually and you can use a MemoryFile to avoid writing to disk. You can re-use the metadata from the input raster in the DatasetReader, but you'll need to modify the height and width properties and the transform. From documentation: After these resolution changing operations, the dataset’s resolution and the ...


2

To extract pixel values as table you can use arcpy. Adjust and execute in python window: import arcpy import numpy as np in_raster = r'C:\GIS\data\someraster.jp2' #Change out_table = r'C:\GIS\Default.gdb\rastertable' #Change arr = arcpy.RasterToNumPyArray(in_raster) #Create array structured_array = np.core.records.fromrecords(arr) #Convert to structured ...


2

You can use gdalwarp to achieve this. from osgeo import gdal # open reference file and get resolution referenceFile = "Path to reference file" reference = gdal.Open(referenceFile, 0) # this opens the file in only reading mode referenceTrans = reference.GetGeoTransform() x_res = referenceTrans[1] y_res = -referenceTrans[5] # make sure this value is ...


1

Try to specify the scale when reprojecting. var precipref_proj = precipref.reproject(dmProjection, null, 30).reduceResolution(...)


1

According to the resampling docs on the Earth Engine Guides, you can reduce resolution using the ee.Image.reproject() function. Check out the link for more on what's going on under the hood, and make note of the warnings they list there. var myCounty = ee.FeatureCollection('TIGER/2016/Counties') .filter(ee.Filter.eq('NAME', 'Kalawao')); var table = ...


1

It was not clear to me at the time that each srcnodata value corresponds to a single NoData value in a given band, i.e., -srcnodata "1 2 3..." indicates that 1 is the NoData value in band 1, 2 for band 2, and so on. As one commenter suggested, a solution would be to use gdal_calc.py or a similar map algebra procedure to collapse multiple desired NoData ...


1

I fixed it by converting every image to integer 16. As @Kevin posted, collections have different band profiles. Solution is: var resample = function (image){ return image.int16().resample('bilinear').reproject({ crs: L8.first().projection().crs(), scale: 20


1

Edit: See the examples referenced here: https://github.com/mapbox/rasterio/issues/1732 with rasterio.open('image.tif') as dataset: data = dataset.read( out_shape=(dataset.count, dataset.height // 3.75, dataset.width // 3.75), # Integer division using // resampling=Resampling.cubic ) Another simple way to go about it is to use ...


1

Based on the sample (reproduced below) at https://developers.google.com/earth-engine/resample - I think that the following code should work where your existing reduceNeighborhood code is: var image_frac=CDL_2015.eq(2).reduceResolution({ reducer: ee.Reducer.mean(), maxPixels: 4096, // something large enough to not cause it to error out }).reproject(...


1

If you can use rasterio, these modules might help: https://rasterio.readthedocs.io/en/stable/topics/resampling.html


1

What comes to my mind is the idea of an unstructured grid or mesh. This is increasingly used in the field of oceanography where various model phenomena are either more variable or more important close to the coast, and less variable and less important in the deep ocean. Thus, for modelling efficiency, it's desirable to have higher resolution in coastal areas ...


Only top voted, non community-wiki answers of a minimum length are eligible