Changeset 9147


Ignore:
Timestamp:
May 4, 2011, 8:42:36 PM (14 years ago)
Author:
rick
Message:

Alternative heatmap generation 'framework'. Simple/Single file with no
persistent storage, making debugging easy.

This proves that the heatmap code itself is not causing the issues, but the
image manipulation PIL is not so fast (or properly utilized). Might want to
consider a more advanced image generation toolkit. (2000 entries: 5+ secs).

Also loading a large dataset into Objects seems to be very slow. The database
call is effient (just a single one), but building all the related objects,
makes is slow (2000 entries: 1+ sec). Might want to check if raw queries suit
to avoid conversion our needs:

http://docs.djangoproject.com/en/dev/topics/db/sql/

Location:
src/django_gheat/website
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/static/OpenStreetMap.js

    r9139 r9147  
    154154    CLASS_NAME: "OpenLayers.Layer.Overlay1"
    155155});
     156
     157OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, {
     158    initialize: function(name, options) {
     159        var url = [
     160            "/website/tile/${z}/${x},${y}.png"
     161        ];
     162        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     163        var newArguments = [name, url, options];
     164        OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
     165    },
     166
     167    CLASS_NAME: "OpenLayers.Layer.Overlay2"
     168});
  • src/django_gheat/website/static/heatmap.js

    r9139 r9147  
    2323        layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Overlay 1", {isBaseLayer: false, visibility: true});
    2424        map.addLayer(layerHeatmap);
     25
     26        layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("Overlay 2", {isBaseLayer: false, visibility: false});
     27        map.addLayer(layerHeatmap2);
    2528       
    2629        var lon   = 4.48907;
  • src/django_gheat/website/urls.py

    r9139 r9147  
    1010    ('^$', HomeView.as_view())
    1111)
     12
     13urlpatterns += patterns('website.tile',
     14    url(
     15        # Example : today/fire/12/3,2.png
     16        regex = r'^tile/(?P<zoom>\d+)/(?P<x>\d+),(?P<y>\d+).png$',
     17        view = 'serve_tile',
     18        name = 'serve_tile',
     19       ),
     20    )
Note: See TracChangeset for help on using the changeset viewer.