Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processing pixel size is halved when using Python raster function with REST #87

Open
simjoh opened this issue Aug 16, 2024 · 3 comments

Comments

@simjoh
Copy link

simjoh commented Aug 16, 2024

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.

@shenganzhan
Copy link
Contributor

@simjoh yes, if you provide a repro case and we can take a look. Thanks.

@simjoh
Copy link
Author

simjoh commented Aug 19, 2024

@shenganzhan Thanks, in the followin zip you can see a some tif files of different scales and python raster function. In the docx file you can see the steps to replicate the issue.
Case_03598888_InputData.zip

PythonRF_upDatePixels_v01.docx

best regards,
Simon

@shenganzhan
Copy link
Contributor

@simjoh thank you for sharing this. We will investigate and update you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants