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

Raster band statistics type error #64

Open
mloranty opened this issue Jan 28, 2025 · 3 comments
Open

Raster band statistics type error #64

mloranty opened this issue Jan 28, 2025 · 3 comments

Comments

@mloranty
Copy link

Hello,

I receive the following error when attempting to run the Geo-SAM Image Encoder. This is on a PC, the encoder will run on this image on my Mac, and it will also run on either platform on a clipped subset of the image created in QGIS. Any ideas on how I can get the encoder to run on the entire image would be appreciated. Thanks!

Image

@mloranty
Copy link
Author

Hi there, just an update to note that this error seems to be occurring only when NoData areas beyond the edge of the image are included. If the extent for image encoding is reduced to a rectangle within the image area the encoder runs (as shown below). But for the whole image encoding fails with the error shown above, but only on PC.

Image

@Fanchengyan
Copy link
Collaborator

Hi @mloranty

When using QGIS to calculate the maximum and minimum values of an image, if there are NaN values present, the maximum and minimum values will also become NaN. Currently, there are two solutions:

  1. Manually set the maximum and minimum values of the image value range.
Image
  1. Use GeoSAM-Image-Encoder (Python package), which calculates the maximum and minimum values using NumPy and does not have this issue.

@mloranty
Copy link
Author

This is great, thanks so much!

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