uwcart / mapstudy

Integrated, modularized framework for testing cartographic hypotheses
13 stars 8 forks source link

Data volume for isarithmic map crashes browser on reexpress #3

Closed northlandiguana closed 8 years ago

northlandiguana commented 8 years ago

Interesting problem: Turf requires point features with sufficient data density to create an underlying grid with majority non-null values of a minimal resolution. This can reexpress as a (rather crowded) proportional symbol map, but the data must start as polygons for choropleth. Rendering proportional symbols is slow with that many features, but doable. Loading a sufficient polygon dataset as TopoJSON and finding centroids to convert to point data is not a problem, but rendering the polygons as a choropleth on reexpress is very slow and often causes Firefox to choke. This seems to be a limitation of client-side graphics rendering, at least the way Leaflet implements it.

One possible solution is to limit isarithmic maps to point data and prohibit reexpression to choropleth or dot density. Another route to explore is server-side processing instead of using Turf. It may be possible to rasterize a lighter-weight polygon dataset in such a way that it can be interpolated by OGR; the resulting linestrings would be sent back to the browser for rendering. Alternatively, if an oversized polygon dataset is presented, the JavaScript could make a decision to send it in to the server for reprocessing as a georeferenced image and bounding box; of course, this would make retrieve interactions impossible for that layer.

northlandiguana commented 8 years ago

This is not a near-term priority. All script should be maintained on the client side.