I'm putting together an application where I need to create a vector grid which will be used to store and display a heatmap. It has the following requirements:
- Can cover the entire planet.
- The vast majority of grid squares won't have values.
- I don't want to have to store the grid itself; I'd like to calculate it on the fly.
- The scale of the data used with the grid could vary massively.
- I anticipate wanting grid squares anything from 1km across to 100km across. (I'm aware how many this will be (~510million for 1km, ~51,000 for 100km)).
- Values will be accumulated/aggregated for each grid square.
- Ideally I'd be able to easily use smaller grid cells to calculate values for larger ones rather than store the larger grid cell values.
- I'll be using OpenLayers to drape it over OpenStreetMap.
- I'll be storing it in SpatiaLite or SQLite, so preferably supported by those natively (i.e. for SpatiaLite = a supported CRS; or for SQLite = a pure numbers based system).
So my question is: What projection should I use for this grid?
Also - is there a good way to designing this? Does anyone know of a good potential solution to this problem or have solved similar before? Or can point me in a useful direction.
Edit Use-case - basically I'm aggregating up bounding boxes of various different shapes and sizes. They can be anything from a few hectares to thousands of square km in size. They may also be in different projections.
Below is a bespoke version of the sort of thing I'm aiming to accomplish automatically on a larger scale.
Many thanks.