I recently obtained a CSV containing the locations of all recorded bicycle accidents in Boston over the past few years. As an avid cyclist, I'd like to create a simple contour map that draws attention to the intersections with the greatest accident densities to share with friends, colleagues, and city officials.

Using the Heatmap QGIS plugin and GDAL's contour tool, I created an aesthetically pleasing contour map, but my concern is that the numerical values are not easily digestible, largely because the heatmap plugin computes density using KDE, rather than point density.

I'd like to create contours that reflect the number of crashes within 400m of a given point. (So for example, any point within the highest "elevation" contours is within 400m of at least 8 crashes, while any point within the lowest "elevation is within 400m of at least 1 crash.) Is this possible? Or is there another, better way to visualize point densities using contours?

If it's any help, I generated my heatmap with a radius of 400m, a decay of 0, and X and Y values of 10 (so each cell is 10m x 10m). I converted the heatmap into contours using an elevation value of 1.

I'd be grateful for any tips or solutions to my quandary.


  • 4
    Contours are a visual suggestion (and numerical representation) that there have been accidents at all points wherever those contours appear as well as between them. It would of course be ludicrous then to extend the contours over buildings, lakes, rivers, open land, and so on. That leaves you necessarily limiting your map to locations where bicycles might travel. Such maps look like rainbow spaghetti and are difficult to read. Why don't you consider an alternative means of presenting these data, such as point symbols to symbolize numbers or rates of crashes? – whuber Aug 15 '13 at 21:29
  • Thank you for your response, Whuber. I initially tried to visualize the accidents using point symbols, but the magnitude of the difference in accident density across the city made this pretty ineffective: even at 50% opacity, the points at the most accident-prone intersections looked cluttered and funky, while outlying points were hardly visible. I'm not terribly concerned about the implications of interpolating values using contours – this map is just intended to provide a general, easily digestible visual of the problem. (This map will be accompanied by a couple other statistical analyses). – Reldresal Aug 16 '13 at 16:00
  • 1
    You can summarize data by intersection and scale the symbols so their areas (not diameters) are directly proportional to the accident counts. This ought to resolve the problems you describe. – whuber Aug 16 '13 at 18:02
  • Are fractal approaches like quadtrees OK? – huckfinn Feb 4 '14 at 23:11

For representation along roads, it is better to use line features. You can split your road at an arbitrary size, then use a spatial join to compute the number of accidents. You then simply use a color scale to represent the density of accidents per road segment or unit road length.

  • This is a good solution, especially when accompanied by other cartographic enhancements such as thickening the line segments to make them more prominent, suppressing the visibility of background cartographic elements, and so on. – whuber Feb 4 '14 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.