rgee icon indicating copy to clipboard operation
rgee copied to clipboard

Question - rgee inspector tool functionality available?

Open zackarno opened this issue 4 years ago • 2 comments

Hello,

I was wondering if rgee has functionality to use an inspector tool on map visualizations (similar to the Javascript code editor)? If not, is there a known work-around or is this a feasible enhancement/feature request?

zackarno avatar Jan 16 '22 15:01 zackarno

This would be a very useful feature, however, I haven't had the time to implement it. In order to minimize dependencies on rgee, I think this would fit better in another R package (maybe eeProfiler?). We don't need to start from scratch, since much of the mapedit code could be reused.

I'm going to leave this issue open in case someone is interested in implementing it.

csaybar avatar Jan 16 '22 16:01 csaybar

@csaybar & @ambarja - was looking into this possibility. I saw that @ambarja had started the rgeeInspector (nice!) .

I opened an issue/question on the leaflet github repo to see if it was possibly to extract the input data object from a leaflet map object (like that created by rgee::Map$addLayer()). It seems like it may not be possible because it doesn't seem like leaflet stores the input object inside the map object - however {mapview} does store it in an @object slot. I was thinking if we could access the data layer object(s) from the map it would be easy to implement the GEE inspect functionality with rgeeInspector just by passing the map object... something like:

m1 <- map$addLayer(...)

# this would open mapedit, allowing you to draw geom(s), after clicking done it would return a new leaflet map with the points labeled with layer values
m1 |> inspect() 

on the issue @tim-salabim had some helpful suggestions : https://github.com/rstudio/leaflet/issues/813#issuecomment-1210512755 .

zackarno avatar Aug 10 '22 11:08 zackarno