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

Refactor inspector into an ipywidgets subclass #1663

Merged
merged 4 commits into from Aug 16, 2023

Conversation

naschmitz
Copy link
Collaborator

No description provided.

@giswqs
Copy link
Member

giswqs commented Aug 15, 2023

Thank you for refactoring. Overall, it looks good to me. One small bug is that it stucks when clicking at a location that is not covered by all layers.

import ee
import geemap

Map = geemap.Map(center=(40, -100), zoom=4)

dem = ee.Image('USGS/SRTMGL1_003')
states = ee.FeatureCollection("TIGER/2018/States")

vis_params = {
    'min': 0,
    'max': 4000,
    'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],
}

Map.addLayer(dem, vis_params, 'SRTM DEM', True, 0.5)
Map.addLayer(states, {}, "US States")
Map.add_inspector()
Map

Peek 2023-08-14 22-07

else:
return Tree(nodes=[root_node])

def _objects_info(self, latlon, names=None, visible=True, return_node=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactored _object_info() function only has the latlon parameter, missing the names and visible parameters. The bug occurs when the mouse-clicking location does not interact the feature collection.

else:
return Tree(nodes=[root_node])

def _pixels_info(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the refactored _pixels_info() function only has the latlon parameter. It also causes issues when clicking at locations without pixels.

@naschmitz
Copy link
Collaborator Author

I'll take a look. I think I know what's happening. It's likely due to removing some exception handling code when doing the EE computations.

@naschmitz
Copy link
Collaborator Author

@giswqs it should be ready for your review. I fixed the issue with 8a84c0a.

@naschmitz naschmitz added the refactor Used for code refactors label Aug 15, 2023
@giswqs giswqs merged commit 046017f into gee-community:master Aug 16, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Used for code refactors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants