Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Heatmaps

  1. #1
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default Heatmaps

    So, one of the things I was working on recently at work was logging the bounding boxes of WMS requests made to GeoServer. This obviously made for a lot of overlapping boxes, which is hard to display with normal symbolization. Geoserver does however have some interesting alternative forms of symbolization, including something called a "heatmap" This is a surface made by drawing the centres of the features into the map and keeping track of how many times they overlap. Then the whole surface is blurred. Then the whole thing is normalized so the maximum ls 1.0.

    Now that normalizing of overlapping levels is really useful, but I needed to preserve the shape. With a bit of work though, I was able to make two changes. Making it render the bounding box of a feature, and normalizing the minimum as well as the maximum to preserve contrast when zooming in.

    The result looked like this

    hot-box.png

    Now, bounding boxes are nice and all I needed for the project I was working on, but it would be even better to render the feature properly. because of the way Heatmap works, it can't just leverage a stock graphics library like Java2D (which most of the rest of GeoServer uses for vector to raster.)

    I didn't have time for polygons (at this point I was on my own time), but rendering a linestring is pretty straight forward. So I added that, took some GPS tracks from my time delivering pizza, and got a pretty cool looking map.

    test-pizza-tracks.png

  2. #2
    Community Leader Korash's Avatar
    Join Date
    Nov 2008
    Location
    Montreal, Canada
    Posts
    1,601

    Default

    That is NEAT!!

    I am thinking Star Lanes....or initial layout for a town, or city with enough samples, using the brightness for poulation usage...or a kobold warren....or trade routes......ad infinitum....
    Art Critic = Someone with the Eye of an Artist, Words of a Bard, and the Talent of a Rock.

    Please take my critiques as someone who Wishes he had the Talent

  3. #3
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by Korash View Post
    That is NEAT!!

    I am thinking Star Lanes....or initial layout for a town, or city with enough samples, using the brightness for poulation usage...or a kobold warren....or trade routes......ad infinitum....
    Well, really this is something where you need the data to begin with and what I've done is create a way to visualize it, although it could be used for some analysis of the data too. For instance, you could drape a road network over the heatmap surface to set its M ordinates. Then you would have the traffic levels on the roads.

  4. #4
    Community Leader Korash's Avatar
    Join Date
    Nov 2008
    Location
    Montreal, Canada
    Posts
    1,601

    Default

    Yeah, I get it about having the data, but really, all we have to do is pick up a GPS and start gathering the info
    Art Critic = Someone with the Eye of an Artist, Words of a Bard, and the Talent of a Rock.

    Please take my critiques as someone who Wishes he had the Talent

  5. #5
    Community Leader Jaxilon's Avatar
    Join Date
    Nov 2009
    Location
    A beach in Ecuador
    Posts
    5,548

    Default

    What is your goal in doing this Hai? You said it was work related so I'm wondering what the purpose is. That might help me to understand what bounding boxes are too
    “When it’s over and you look in the mirror, did you do the best that you were capable of? If so, the score does not matter. But if you find that you did your best you were capable of, you will find it to your liking.” -John Wooden

    * Rivengard * My Finished Maps * My Challenge Maps * My deviantArt

  6. #6
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by Jaxilon View Post
    What is your goal in doing this Hai? You said it was work related so I'm wondering what the purpose is. That might help me to understand what bounding boxes are too
    Heatmaps are a way of showing data that has a lot of overlap or clustering and where the density of that overlap/clustering is the important thing. In my case, I'm working with a GIS Server. It receives requests for sections of a map along the lines of: "Give me the map from N 40° to N 50° and E 130° to E 120°". That range of coordinates defines a "box" that forms the "boundary" of the request and we call it a Bounding Box. I added the ability to log the bounding boxes of requests so the people running a server can figure out which parts of the map are under higher load and might benefit from more caching.

    Obviously this produces a data set that is just a LOT of overlapping boxes which will cover each other up. So you can't just display them normally. So I took the Heatmap we already had, which just worked with points, and made it work with other geometries. But all my data was just boxes, and properly rasterizing geometries is rather more complex than just filling a box, so I cheated and made it render the bounding box of the geometry (The box that just fits the geometry) rather than the geometry itself. This was fast and easy. the result is the top image, you can see where more requests were made as the heatmap is brighter.

    Adding support for Line Strings wasn't that hard either, and I thought it would look cool, so I did it on my own time. It's useful for showing things like traffic levels if you use a set of routes as the input features (as in the case of my pizza delivery map). When I have time, I plan to add proper support for Polygons/Multipolygons as well to round it all out.

    Here's an illustration of Bounding Boxes:

    path3914.png

    The red box is the bounding box for the grey polygon in the coordinate system shown by the grid. The green and blue shapes are the bounding boxes of that same polygon in other coordinate systems, transformed into the coordinate system of the image.

  7. #7
    Community Leader Jaxilon's Avatar
    Join Date
    Nov 2009
    Location
    A beach in Ecuador
    Posts
    5,548

    Default

    Great explaination, thanks. I kind of had an idea along those lines but it wasn't strongly defined.
    “When it’s over and you look in the mirror, did you do the best that you were capable of? If so, the score does not matter. But if you find that you did your best you were capable of, you will find it to your liking.” -John Wooden

    * Rivengard * My Finished Maps * My Challenge Maps * My deviantArt

  8. #8

    Default

    Heat map is geographical representation of data in a form of colored matrix.
    "Our greatest glory is not in never falling, but in rising every time we fall."-Confucius
    Old map and Historic map

  9. #9

    Default

    Quote Originally Posted by Hai-Etlik View Post
    ...
    I didn't have time for polygons (at this point I was on my own time), but rendering a linestring is pretty straight forward. So I added that, took some GPS tracks from my time delivering pizza, and got a pretty cool looking map.

    test-pizza-tracks.png
    Hello,

    I know it is an old post but this is exactly what I was looking for. Can you or someone tell me which program is needed for such a map?

    Thank you

  10. #10
    Guild Grand Master Azélor's Avatar
    Join Date
    Jul 2008
    Location
    Québec
    Posts
    3,363

    Default

    I believe you could achieve the same effect with any software like Gimp, Inkscape or Photoshop. Place dots representing the cities. Link them with large lines. Paint the lines with a different colour to represent the travel frequency.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •