This demonstrates raster-based reverse geocoding using canvas and D3.js. Geocoding is based on the color of the pixel at a given projected position. Note that the canvas is only shown here for the sake of explanation and debugging - this would in fact probably work faster if the canvas was not attached to the document at all.
The biggest remaining issue here is precision, which depends on:
- the size of the canvas, and
- the projection used.
Determining the optimum size based on the accuracy of your data is left as an exercise for the reader. Edge cases will also fail here, generally returning
null - one option might be to stroke neighborhoods in a color, and then return an "uncertain" value for any non-grayscale pixel.