Skip to content

Conversation

@maximlt
Copy link
Member

@maximlt maximlt commented Dec 21, 2023

Addressing (a tiny) part of #1190 with a different take compared to #1200 whose goal is to cover all kind of exceptions the explorer might raise, while in this PR I focused on finding the best way to let them know they should install GeoViews to enable the geo controls.

I ended up trying to import geoviews on initialization and if that fails disabling all the geo controls:

image

The Checkbox widget has no tooltip so instead I used a Toggle with a label that is updated to indicate GeoViews is required.
Trying to instantiate an explorer by passing geo kwargs (e.g. df.explorer(geo=True)) will raise an import error.

Copy link
Collaborator

@ahuang11 ahuang11 left a comment

Choose a reason for hiding this comment

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

Looks good to me! The only thing is tiles doesn't seem to work without geographic projections, but I think that's a separate issue.

e.g. need to call: lon_lat_to_easting_northing

import holoviews as hv

hv.extension("bokeh")

hv.element.tiles.EsriImagery() * hv.Points(
    hv.util.transform.lon_lat_to_easting_northing(-88, 40)
)

@maximlt
Copy link
Member Author

maximlt commented Dec 21, 2023

@ahuang11 Isn't it that you need to provide a dataset that has coordinates already projected to easting/northing to use tiles? Not all geo datasets are in lat/lon so I'm not sure the explorer should perform the conversion by default.

@maximlt maximlt merged commit 8135f34 into main Dec 21, 2023
@maximlt maximlt deleted the explorer_disable_geo_no_gv branch December 21, 2023 20:54
@ahuang11
Copy link
Collaborator

ahuang11 commented Dec 21, 2023

Maybe an extra toggle in the future that allows conversion to easting northing? Or at the very least, a tooltip that elaborates on that so new users aren't confused.

@maximlt
Copy link
Member Author

maximlt commented Dec 21, 2023

Yes I think that'd make sense.

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

Successfully merging this pull request may close these issues.

3 participants