shapefiles / projections in Flash / AS3

Below is linked a little teaser from my recent experimentation with loading shapefiles.

projections screenshot

indiemaps.com/shapefile

In the above, the work of loading the shapefiles is mostly done by the Vanrijkom classes I spoke of earlier. When I wrote before, I was more interested in loading shapefiles with PHP, and using Flash Remoting to pass in the shapefile information. It turns out, though, that the AS classes are lightning fast, and applying point transformations is decently swift.

I’ve rewritten some of Vanrijkom’s code, and have written a few new classes to manage the loading, projecting, and drawing of shapefiles. It would take only a few more methods to load in a DBF file with attributes, and apply the symbology (choropleth, dot density, isoline, proportional symbol) to the features. Currently, I can load and draw the three main shapefile types: point, polyline, and polygon.

I’m still confident that the remoting route, whether with AMFPHP and PHP or XML and Python or C, will be the way to go. Especially when I want to add in cartograms. But, for now, it’s nice to know that a lot of this can be handled natively in Flash.

3 Comments

  1. Hello, nice piece of work you have done.
    Can you help me out ? i’m trying to do the same thing dynamically with a couple of projections but i’m not doing so well.
    Can you send me Vanrijkom’s modified code, and the new classes that helped you manage the loading, projecting, and drawing of shapefiles ?
    It’d be a big help.
    Thanks.

    Niz.

    Nizar
    Posted April 8, 2009 at 1:38 pm | Permalink
  2. @Niz — I think the code for my noncontiguous cartogram experiments does just what you’re talking about.

    Posted April 8, 2009 at 6:00 pm | Permalink
  3. I am thankful that I noticed this web site, exactly the right information that I was searching for! .

    christian louboutin
    Posted January 14, 2012 at 6:44 pm | Permalink

4 Trackbacks

  1. [...] Remember, though, that this only works for data that is dynamically stored as the movie runs (a dynamically-loaded shapefile, [...]

  2. [...] experiments relied on the code to load coordinate data in shapefile form at run-time, as did my early experiments that led to indiemapper. I’m hoping I’ll get just as much use out of this parser, for [...]

  3. By indiemaps.com/blog » indiemapper on April 19, 2010 at 12:16 am

    [...] widely available formulae for simple projections like Mercator and Lambert conformal conic I began loading and projecting shapefiles in Flash at run-time pretty quickly. These were heady times, and this seemed pretty [...]

  4. By indiemapper blog » indiemapper: past and future on May 6, 2010 at 4:08 am

    [...] widely available formulae for simple projections like Mercator and Lambert conformal conic I began loading and projecting shapefiles in Flash at run-time pretty quickly. These were heady times, and this seemed pretty [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *