I love YOSMHM. Pascal has done a great job with it, and it’s very cool. In fact, given my desire to map the entire world, I rely on YOSMHM to tell me where to map next. And just recently, it’s improved from updating weekly/monthly to daily! But, there are some limitations.

  1. One blob per changeset. If I map a long highway, a dot at the center of the highway really doesn’t show where I mapped.
  2. Missing data. I have around 12,100 changesets, but YOSMHM only shows 9356. That might explain why it doesn’t show the mapping I did in southern Chad, or eastern Cameroon, or Agadez in Niger, or many other places.

So, I set out to see if I could make my own heatmap. Here are my first steps.

  1. Thanks to a great answer from EdLoach it was easy to get XML files for all my changesets.
  2. I parsed those XML to get the extents (min_lat min_lon max_lat max_lon) of each changeset.
  3. I tried a number of different web-heat-map tools, and settled on Leaflet + Leaflet.heat because it was super easy to use. I just pass the center of each changeset’s extents to Leaflet.heat as a point, and the result looks like this.

Finally, I can see at least some blob in every part of the world I’ve mapped. Unfortunately, unlike YOSMHM, all the changesets are weighted equally (it would take a lot more querying and parsing to weight them) so that, for example, it’s hard to tell that I’ve done 10x more mapping in Namibia than in Japan.

I can dream of a better heatmap! It would have:

  1. Each added/modified/deleted entity, not just the changeset centers. This would mean, in my case, 9 million dots. A simple approach like Leaflet.heat can’t handle that many, because it draws every point, every time, using javascript. If I have to, I could write C++ to make a custom global tileset with thousands of PNGs, but that seems like overkill; maybe there’s a webby way? Mapbox maybe, can it handle 9 million points?
  2. It should show added/modified/deleted in different colors (like green/blue/red) so I can quickly see what places I’ve done more correction, vs. adding new features. India, Africa and Central America are the only places I’ve added huge amounts of detail to OSM, but you can’t tell that by looking at YOSMHM. Is there a better/faster/more polite way to get all that detail without making 12,100 queries to the OSM API? I can’t just parse the planet file, because that only has current state, not history.
  3. Not damn Mercator. Anything else would be better. How about Goode Homolosine? Can I get “free” background tiles (like Mapbox’s) served in anything beside “web mercator”?


Comment from ikonor on 31 October 2015 at 17:30

I fear there is no easy solution.

Haven’t used any of this, just some ideas:

  1. tippecanoe to aggragate/simplify into vector tiles
  2. full history planet has all versions of an object (version=”1” = added, visible=”false” = deleted). Osmium library can read the history planet, e.g. by: * converting to OPL File Format (text) + Unix tools (grep, …) p. 16ff (videos see bottom * writing a handler for Node.js/Python Bindings or C++
  3. maybe a public WMS server has a projection you like, OpenLayers 3 gets client-side raster reprojection

Log in to leave a comment