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

Blank texture in gg.visualization.drape_array_over_dem (+ default zmax) #303

Closed
spasquet opened this issue Oct 2, 2023 · 5 comments
Closed

Comments

@spasquet
Copy link

spasquet commented Oct 2, 2023

Hi there,

I want to report an issue with gg.visualization.drape_array_over_dem that I managed to solve.
I was getting a texture filled with an array of ones, associated with a warning from pv.numpy_to_texture telling me my array was not in uint8.

It turns out that skimage.transform.resize was changing the format of the array (scikit-image 0.21.0 installed)
Adding option preserve_range=True to the skimage.transform.resize function solved it :

if resize_array:
            array = resize(image=array,
                           preserve_range=True,
                           output_shape=(dem.shape[0],
                                         dem.shape[1]))
        else:
            dem = resize(image=dem,
                         preserve_range=True,
                         output_shape=(array.shape[0],
                                       array.shape[1]))

Also, could you please change the default zmax in gg.visualization.drape_array_over_dem ?
It is now set to 1000...I was working with data in the Alps at 2500m and it took me forever to figure out why the draping wasn't functioning. There should only be a valid zmax when specifically mentioned. I have now set it to 10000 by default now, it does the trick.

Best
Sylvain

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Hello and welcome! Thanks for posting your first issue in the GemGIS project! Someone from our developers will get back to you. If your question is support related, we may transfer it to the Discussions.

@AlexanderJuestel
Copy link
Collaborator

AlexanderJuestel commented Oct 2, 2023

@spasquet Thank you for the raising this issue, I will have a look at it tomorrow first thing and it will be fixed in the next release! Otherwise, you could open a PR and implement the changes :)

@AlexanderJuestel
Copy link
Collaborator

Your fix was implemented in bfbd01e. However, as we are changing the way we deploy the package to pypi, you can only download the Github repo to get the latest features. Sorry for this inconvenience

@spasquet
Copy link
Author

spasquet commented Oct 3, 2023

Great thanks !

@AlexanderJuestel
Copy link
Collaborator

@spasquet I have released GemGIS 1.1.3 yesterday. You may want to check it out :)

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