Adobe Edge Article: Geocoding with Papervision3D

| | Comments (10)

The latest issue of Adobe Edge, with my article on using Flex and Papervision3D to geocode, just went live.

Check it out here.

Categories

10 Comments

Vu Truong said:

Thanks for a great article on Geocoding/PPV3d. I'm so inspired by your article and I will definitely build something fun based on your sample app. I didn't know mapping coordinates on a PPV3D Sphere was that easy. :)

Mercator is the wrong projection. A Mercator projection in its 2D form already has tremendous distortion built into it and wrapping it on a globe doesn't change that. It's often the case that Mercator projections are cut off above 81° N&S latitude because the distortion is so great (USGS states that the poles cannot be shown it's so extreme). You should use a Lat/Long (aka Platte Carrée or Equidistant cylindrical) projection. In these projections, the width of the 2D map is 2x the height, just like an "unfolded" sphere. There is distortion as well on this type of projection (most extreme at the poles) but when the map is wrapped onto a sphere the distortion is eliminated by the compression of the pixels.

Yes, I am a cartographer. Visit my small custom mapping site at www.the-m-factory.com

Mark said:

Hey Justin,

That's very interesting.

I definitely don't claim to be a cartographer, but the biggest point of the article was accurately plotting latitude and longitude points on a globe.

From my investigation, most of the major online mapping services use the Mercator projection for their 2D maps.

The easiest way to plot the latitude and longitude points on a globe was to take the Mercator projection and map it over the sphere as well.

While it might be a bit distorted, it does allow for very accurate lat/long plotting. From my digging, Microsoft takes its Mercator 2D map tiles from Virtual Earth and places them over their Local.Live 3D globe as well.

Another thing to keep in mind about using the Mercator projection is that in theory you could view the map in 2D and then have that same map wrap around a 3D globe, retaining all latitude and longitude coordinates.

Harley said:

Mark: really, really great job. Thank you so much for putting this out there.

The last post regarding the proper projection is way to critical for what you are actually providing.

Justin: Why make yourself look like an ass? thank the guy... it's been about 6 months since someone figured out how to geocode a sphere in PV3D and they didn't release the code. The how to do it questions are still on the PV3D list.. with no answer until now.

if your going to talk about projection distortion resulting from projecting the globe/sphere on to a 2d surface; do not then say the projection is not removed when re-projected back on to a sphere!

Is it perfect, no, but close enough if you look at the scale and the precision in the code. Yes, there is need for some generalization... as a cartographer you should understand this.

Vu: nothing easy about coming up with the code. it's good it appears easy... but that's the magic.

I was really frustrated trying to figure out where the origin would be in PV3D and then what scale I should be working at. I made about 10 different scaled globes then settled on one that was 65.78 meters radius. Easy to wrap a texture around it, and I was all proud of myself… where is the origin in PV3D.


Again, thanks Mark for helping us dim ones out.

regards,
Harley


Mark said:

Thanks for the kind words Harley and Vu! :)

Jeroen said:

Great work I'm playing around a bit and try to get some Xtra interaction. You know if it's possible to make de markers interactive? Keep up the good work!

andy said:

Thanks for a really great article. I've been wanting to do this for a long time. I've been trying to implement it in CS3 as I don't have Flex but i'm getting the below error message:

TypeError: Error #1007: Instantiation attempted on a non-constructor.
at com.digitalflipbook.geoglobe::Globe()
at com.digitalflipbook.geoglobe::GlobeView/init()
at com.digitalflipbook.geoglobe::GlobeView()
at Main()

Is there any reason why you need flex to use your custom classes?

Many thanks
Andy

Bill Brown said:

Fantastic article. Thank-you very much. I was able to get it working, but one of the more recent updates to Papervision3D removed the FreeCamera3D object, so your example code no longer works. Do you plan on updating the code?

I've been able to replace the FreeCamera3D with Camera3D after some hacking around, but I'm having trouble getting the Globe back to the same size as in your example (probably something to do with camera focus and zoom or FOV).
Perhaps an update to your Globe code in your blog would help those of us who want to get your example working, but don't follow all the nuances of Papervision updates?

naomi said:

Thanks for an excellent article, Mark. After about two days of adjusting code, I was able to get the files to compile decently in Flash without Flex. (I nixed the geocoding functions in favor of an array of fixed locations) One thing I keep banging my head on is making the marker cubes interactive. No matter what I try with the markers, the InteractiveScene3DEvent just won't fire. And setting the GlobeView interactive to true just slows the animation to a halt. Any ideas?

naomi said:

Andy, I think that particular error is caused by the way the bitmap material is embedded with Flex. The main thing in Globe.as that I removed to make the code work in CS3 was the lines:
[Embed( source="assets/earthmap1k.jpg" )]
protected var EarthImage:Class;

And I changed the "var earthMaterial" line to:

var earthMaterial:BitmapAssetMaterial = new BitmapAssetMaterial("WorldMap");

Where "WorldMap" is the linkage identifier for a bitmap in my library.

There's quite a bit more to adapt for CS3, but that's one of the main things.


Leave a comment

August 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Categories

Archives