The fedtstats.gov/thememaps example previously mentioned is your best direct example, since they're doing the same thing, with publicly available data: TIGER. Since they're a federal project, they might even be able to release their code. See the module Geo::TigerLine for how to handle (and get) the county border data. Although you can get county outlines as lat-long point pairs from other sources, TIGER is the new standard.

My Perl generated state maps aren't area maps (yet), only point-plots from a flat-file database. I used GD.pm with basemaps from Color Landform Atlas by permission. My maps are online at EMAARES (points) (and with lines too).

For those plotting points and wanting nice state basemaps see Sterner's Color Landform Atlas of the States <A HREF="http://fermi.jhuapl.edu/states/about.html#use">Rights and terms of use</A> and Birrell's tesselation of Sterner's mark 1 <A HREF="http://birrell.org/andrew/copyright.html">Rights and use</A> for the source of my basemaps.

My other dataset is, like yours, weather related, although specifically related to radio propagation, and prognostic & diagnostic rather than climatalogical; I'm currently working from soundings, so also a point-plot situation. When I get it rich enough to be worth plotting areas instead of point values (from model grid fields), it will be contoured and not thematic (county based). For that one, I'm currently using as basemaps a radar plot, Sterner's B&w states, and Birrell's tiling of Sterner's previous maps.

For Thematic work, GD.pm should be adequate. GD.pm has a limitation of 256 colors, a bit awkward with detailed basemaps, but that's enough for thematic work. Recent versions of GD.pm support PNG and JPEG, older versions support GIF and JPEG. For thematic, you'd probably prefer PNG. GD.pm can overlay data onto a basemap read from disk, or generate the whole map, on the fly in a CGI or mod_perl module just fine, as it can write the resulting PNG to STDOUT if instructed to do so. (Just be sure to provide the HTTP header first, and binmode if on WIntel. ActiveState has GD.pm.) I'd recommend saving the basemap(s) and overlaying data on the fly, as the state outlines are often large and nasty chains, while county outlines are more often internally simple -- but your state and server situation may vary, generating the whole thing on the fly may be logical for you. And as the fedstat Monk said, if there are few enough variants, pre-generating them all to disk trades space for time.

bill -- n1vux at arrl.net


In reply to Re: Generating a map using perl by Anonymous Monk
in thread Generating a map using perl by Baz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.