Giter VIP home page Giter VIP logo

googlemapsheatmap's Introduction

NAME:
     Geo::Heatmap
     
     overlay a density map (aka heatmap) over googlemaps

     see example here

     http://www.trust-box.at//dev/gm/GoogleMapsHeatmap/www/GoogleMapsHeatmap.html

GET CODE
    https://github.com/MarkHofstetter/GoogleMapsHeatmap

SYNOPSIS
    Create a Heatmap layer for GoogleMaps

    my $ghm = Geo::Heatmap->new();
    $ghm->palette('palette.store');
    $ghm->zoom_scale( {
      1 => 298983,
      2 => 177127,
      3 => 104949,
      4 => 90185,
      5 => 70338,
      6 => 37742,
      7 => 28157,
      8 => 12541,
      9 => 3662,
      10 => 1275,
      11 => 417,
      12 => 130,
      13 => 41,
      14 => 18,
      15 => 10,
      16 => 6,
      17 => 2,
      18 => 0,
    } );
  
    $ghm->cache($cache);
    $ghm->return_points( \&get_points );
    my $image = $ghm->tile($tile);


    You need a color palette (one is included) to encode values to colors, in Storable Format as an arrayref of arrayrefs eg
      [50] = [34, 45, 56]
    which means that a normalized value of 50 would lead to an RGB color of 34% red , 45% blue, 56% green

    zoom_scale
      the maximum number of points for a given google zoom scale, you would be able to extract to values from the denisity log
      or derive them from your data in some cunning way

    cache 
      you need some caching for the tiles otherwise the map would be quite slow. Use a CHI object with the cache you like

    return_points
      is a function reference which expects a single hashref as a parameter which defines two LAT/LONG points to get all
      data points within this box
      $r->{LATN}, $r->{LNGW}), $r->{LATS}, $r->{LNGE}
      the function has to return an arrayref of arrayrefs of the points within the box

    tile 
      returns the rendered image


googlemapsheatmap's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.