Below is linked a little teaser from my recent experimentation with loading shapefiles.
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
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.
@Niz — I think the code for my noncontiguous cartogram experiments does just what you’re talking about.
I am thankful that I noticed this web site, exactly the right information that I was searching for! .
4 Trackbacks
[...] Remember, though, that this only works for data that is dynamically stored as the movie runs (a dynamically-loaded shapefile, [...]
[...] 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 [...]
[...] 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 [...]
[...] 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 [...]