Tuesday, August 26, 2008

Heat Map + Papervision3D

Doug McCune (one of my all time Flex heroes) contributed heavily to SpatialKey, which looks and works great. Got to see it last week at 360|Flex in San Jose. I've been wanting to do something similar, but in 3D! Dabbled a bit with Papervision3D, but wanted to get into it, and that was the perfect opportunity. The idea that I had was to read a country shapefile, and thematically map all the cities in that country based on some attribute. And do all that on the client using Flex. I did a little bit of research, and here is a list of sites that "inspired" me:
And here is a snapshot of the result:


You can download the source code of the application from here. And you can see a sample demo here.

14 comments:

Doug McCune said...

damnit, I guess I have to step up my game. Aight, fine, I'll start working on animated 3D heatmaps of millions of datapoints.

ThunderHead said...

Very cool - Cannot wait to see what you will come up with - Fresh !

Robert said...

Dear Thunderhead,

Great 3D dem0! One question. Is this done in flex 3 and if so how do you load the source into flex 3?

ThunderHead said...

Yes - this was done using the flex3 sdk - eh...by loading the source, flex builder helped - or you mean the source of the data - then it is embedded.

Robert said...

I am having problems getting your source code into Flex 3. Do you have to import it? Or copy it into a new project. Does it require the ESRI swc? Does it need anything from the PaperVison Framework? Thanks for your help.

ThunderHead said...

Create a flex application using FlexBuilder and copy the content of src into your project - no need for ESRI swc - but u _do_ need to download the greatwhite papervision3d swc and reference it in your library path. You need to to the same for the dbf swc - I referenced the url where u can download the swcs or source sin the post. hope that helps :-)

Robert said...

Thanks for the fast responce Thunderhead. I have been able to get the demo into Flex 3 thanks to your instructions. I however am getting some errors. The PaperVision greatwhite does not seem to exist on the paper vision repository. The closest match to your demo seems to be the trunk for cs4. I am getting errors related to the CameraObject3D.as. What version of PaperVision do you suggest?

ThunderHead said...

check out the code using subversion from http://papervision3d.googlecode.com/svn/trunk/as3/trunk

Robert said...

Thanks for the link to the proper version of Papervision. Worked great. Fantastic potential here with ESRI,Flex and Papervision. I have a few questions: I noticed that the full world shape file slowed the performance compared to your online demo. Is this due to the the use of a different shape file or did you reduce the data for the online version. Also I am not sure but i think i may have heard you on a online interview on one of the flex community sites or blogs. Are you the the thunderhead that works at ESRI and if so is there a way to talk to you in your official capacity about a project we are considering ArcGis server for?

ThunderHead said...

Yes, that was me :-) and yes I do work for ESRI and can be reached at mraad@esri.com - hope to hear from you.

Jon said...

This application works great, no problem loading into Flex. But as Robert mentioned, it does seem to be quite a bit slower running locally than the online version you have posted.

Any suggestions to improve the speed?

Thanks!

ThunderHead said...

Try FP10 !

Jon said...

Ha, sure enough that helped. One more question, I'm trying to figure out how I can just load a specific shapefile rather than using the FIPS to select. I tried embedding my file where you have cntry06.shp, but nothing will show up until I select a country via FIPS. How do I force the embedded map to display?

Thanks!

Jon said...

To be less abstract, I am trying to use the Heatmap with this shapefile:

http://www.weather.gov/geodata/catalog/national/html/us_state.htm

I know I need to either edit the DBF file or the DBF parsing in the project to get it to work correctly, but I'm not quite sure the best solution. Thanks.