raster-functions
raster-functions copied to clipboard
Processing pixel size is halved when using Python raster function with REST
The following problem has been reported as an issue to the ESRI support team in Sweden who reported it to Esri Inc Tech Support. Tech support suggested that we should report the problem as an issue here. Since it involved python raster functions
The Swedish forestry agency has the following problem on several of our imageServices and the problem has been replicated by our support.
The problem A dataset with pixel resolution of 50m is published along with rasterfunction templates which is using a python raster function to process the dataset.
If we consume the Imageservice in ArcGIS Pro with the raster function template as processing template. The python raster function works with cellSize 50, the shape of the numpy array in the method updatePixels() corresponds to a 50m pixels.
If we instead consume the raster function template by a “rendering_rule” with REST. The cell size is halved to 25m the shape of the numpy array is doubled in both dimensions. Our ESRI support in Sweden has been very helpful and created a minimal example with dataset of different pixel resolution and comes to the same conclusion. Image services that are consumed with REST are processed at half the pixel resolution.
The information about the raster is logged in updatePixels by:
def updatePixels(self, tlc, shape, props, **pixelBlocks):
pix_array = np.asarray(pixelBlocks['raster_pixels'])
self.logger.log(props)
self.logger.log(pix_array.shape)
in getConfiguration we use ‘resampling’:False
To us it seems that there is something treated differently by the server depending on type of request. Do you have any idea why pixel resolution I halved? We have datasets and an extensive report to provide if someone here would like to take a closer look.