harry-gibson / ee-access-tool

Earth Engine Accessibility Tool
0 stars 0 forks source link

make computation resolution dynamic (improve performance) #11

Open harry-gibson opened 6 years ago

harry-gibson commented 6 years ago

It is difficult to pick an appropriate computationScale for the cumulativeCost call to allow the map to be reasonably interactive but ensure consistent results.

The interactive map is restricted to max zoom level of 9 which is c.305m/pixel at the equator.

To date the tool has been configured with a fixed computationScale of 2445m (AccessToolConstants.INTERACTIVE_RESOLUTION)which means the output pixels are ~8*8 screen pixels at the highest allowed map zoom level. This keeps things usable but it's still slow (too fine) when zoomed out, and looks a little blocky when zoomed in as far as possible.

How to make the map more timely but without disrupting accuracy too much, or at least, inconsistently?

It seems that ideally we would fix the computation scale in some circumstances but not others. For example allow the API to pick a resolution automatically when zoomed out but have a floor that is say 3* actual pixel size when zoomed in, and certainly never finer than the 1k native resolution of the data.

Also for querying the map, this should be done at a fixed computationScale regardless of map zoom so that clicking in a given place always gives same result. It's probably always too slow to do this at AccessToolConstants.NATIVE_RESOLUTION, though, so results will always be inaccurate.

harry-gibson commented 6 years ago

The issue is that once the map has been created, python is out of the loop and we just have Maps API talking to EE, so I don't see that we can change computationScale according to zoom. Is this correct? If so could we: