Sunday, August 9, 2009

iPhone Isometric Shapefile Viewer

Not sure if some of you have see the 3D in-door routing application that I did for the ESRI 2009 User Conference. I used Papervision3D for this app, and was a lot of fun to develop. A couple of weeks before the conference, I decided to implement the same app on an iPhone using Obj-C. Being a newbie in the latter, I ramped up quickly on the language (got quickly over my hang ups on bracket, and kinda like the language :-). I started to look at the 3D built-in engine that uses a derivative of OpenGL and thought that I will not have the time to get this up and running. So I started to look for simpler alternatives. I read Keith Peters' most excellent AdvancED ActionScript 3.0 Animation book and used his A* implementation for client side routing application with barriers. check it out here. The next chapter in the book is all about isometric projection. This is exactly what I needed, an isometric view of the CDCC floors and rooms with a small twist, where the user can rotate the view.
So before doing a full Obj-C dive, I prototyped my application in Flex/AS3. The idea was to read a 3D shapefile (thanks Edwin), apply a rotation matrix on the original coordinates and then pass them through Peters isometric utility class. Once debugged and got it up and running (check out the app here, hold and drag the mouse to rotate the view), I ported the code to Obj-C. Check out this post to see some iPhone app snapshots. Like usual, here is the source code of the flex app.

12 comments:

Kirk and Heather said...

This is a cool app, but I'm looking for something a little more simple. I'd like to see an app that takes an online shapefile from ArcGIS server and overlays it on the native Google Maps application on the iphone. It would be great to see what your GIS data says about your current location! Have you seen anything like this?

Fabien said...

Great application!
Any chance you still have the source code of the flex application around (even the 2008 application source code, the 2008 demo looks like it's down)? I can't find it in your blogpost and view source is not allowed.

Thanks
Fabien

ThunderHead said...

Here is the src url : http://thunderhead.esri.com/readonlyurl/IsoApp/srcview/

Fabien said...

Thanks for the link but i meant the flex application you did for the 2008 (or 2009) conference. :)

Fabien

ThunderHead said...

Oh - that - I'm sorry, I cannot share that :-( some corp policy as this is "paid" work !

ThunderHead said...

But can give u pointers - can be reached @ mraad@esri.com

Fabien said...

Thanks, i understand you can't share much on this one. I'll email you later for sure.
Thanks for your time!
Fabien

Harley said...

you know, I need to point out how cool this particular app is. how is it possible to rotate the floors along the x axis without the use of a 3d engine?

in some applications, like floor plans, the basic 3d perspective is enough for the reader to get oriented.

thanks

ThunderHead said...

Actually, I'm applying a 2D rotation _before_ the isometric projection - that is the trick

Jose Manuel said...

Pretty cool man

Do you think I can apply that rotation to a Map or a layer into that map?

I'm using ArcGIS Server and Flex, and I'm applying a Matrix rotation, but the lines are blurred.

ThunderHead said...

We've tried it here and yes the lines are blurry :-( we are working on a solution, will keep u posted :-)

Andrés Luque Rivera said...

Hi :) nice work there man. Any chance to have the objc source code to check it out in a simulator??