conveyal / browsochrones

Create isochrones and accessibility images in the browser
MIT License
6 stars 2 forks source link

grid fetch function with default values #74

Open abyrd opened 7 years ago

abyrd commented 7 years ago

In gridualizer, I needed to write a function to fetch values from a specific (x, y) location in a grid. It seems like this should be a built in method of grid objects.

We also want to return a specific value when a cell is requested outside the grid. See function getGridValue (grid, gx, gy) in dot.js in Gridualizer.

abyrd commented 7 years ago

We might also want the default value to be specified in the grid, or (more simply) specified as a parameter to the getValue function, because the default value for travel time grids (infinite) is not the same as that for opportunity density (zero).