Thursday, March 22, 2007

GIS 3D, data support

GIS systems are based on the vast amount of data. And we are talking here about maintaining enormous databases which eventually have to be updated as well. However, still there is a lot of static-data, based on offline sources - CD’s for instance. We have to bear in mind that when it comes to decisions or visualizations made in GIS, we got to keep that data as fresh as possible in order to make GIS and our work valuable. And I’m not talking here about putting it into fridge, but about feeding it with newly comers, as soon as they pop up. The very nice option appeared some years ago, Web Services, which seems to fix the problem. All we need is internet connection and bought/free access to such resources. After that we will be getting most updated data that is available and be always up-to –date. In these days reality likes to change on daily rate, heh even hours or minutes matter. Short cut, as for today, future data support for apps lays exactly in there. That kind of solution would be more than fine for us, as we want our project to posses distributed system as well (that would provide more solutions for future and after all it is server based system). However I think we would like to update it with some more detailed local data as well, monuments made in 3D Studio Max for example, so no worries... I’ll try to cover that as well. What about availability of such a WS you ask? Well yeah, there is not much, but enough to start I would say. Web Services are still in early phases when it comes to GIS. They can provide answers for simple queries like latitude and longitude for given address, but when it comes to more sophisticated data - problems appear. ESRI has Web Services on public/student license available for one year period, with limitations of course. All you need to do is, go to company web page and register then subscribe for Web Services license. I’m not sure exactly what sort of data these services provide at the moment but I’m sure we can make something out of it to show that it works. Ok I’m talking here about data and stuff but did I mention that it is 2D raster, vector or text based data? Nop?
Data - a very important and vital component for our project. It’s nature has to be a bit different than the nature of existing data sources. As we remember we wanted it to describe 3D objects. Hmm.. so not having found existing, satisfying internet solutions I gathered some pointers which I think we should consider. Primarily the basic – the data has to have ability for describing 3D objects as well as 2D. Secondly it has to be simple, so that we could for example parse it by ourselves to write/read some of its properties (even at runtime). It has to be lightweight as it will be struggling through internet from server-side or Web Services if we would use them. There are actually very simple solutions that we could use – first that immediately popped up out of my mind is XML of course. Then there is Collada 3D file based again on XML language – lightweight and supported by almost all of 3D modelling apps. So I think, with storing the data we would have no problem, at least in that early phase.
So the real question here is where we are going to get data from? The most preferable would be using Web Services – but I haven’t found ones that would give us answers, for example like - building boundaries – that we could use to build a polygon. ESRI WS provides you with types of data like text based or Map Image raster generated on server, which is not suitable for us (but we could use it for more fancy things -> making a true texture for sky polygon = true weather). So next step I think, the best one is to look for existing data sources – no matter if it is online or offline resource (as long as we make our solution universal, and ready when that kind of data will be available through the net). Find the ones that are based on XML files (or are easy to convert) and would provide us with true, geographic polygon like data. Here is an example to show you what I mean. Bear in mind that this kind of data simplicity is desired, especially in these days (internet connection speed, 3D browser engine limitations). For instance:
{area id=”1234”}
{building id=”museum” video=”http://museum.com//Welcome.avi” }
{FirstCorner} x=120,y=123,z=0{/FirstCorner}
...
{/building}
...
{/area}

If we could find that kind of data, we are ready to go, to create some visual basics. Yeah, and what if that kind of data doesn’t exist? I’m going to answer that in a non scientific way - I’m always optimistic and my intuition again tells me that there is something that we can make use of, it just seems so logical that it exists.

By Marcin Czech

Thursday, March 15, 2007

FLEX and 3D is it possible?

While I was digging the web trying to answer that question I must say I already had an assumption about it. Well these suspicions were mainly because Adobe Flex is based on Action Script 3.0 and Adobe Flash which is... let’s say the technology which had a big influence on the new child of Adobe, is mostly AS ver. 2.0. And as I have already seen some 3D solutions in Flash AS2, so it was very possible that it is the same with Flex, however it had to be checked.
So by simply typing “Flex 3D” in google I started looking for existing solutions. Well it turned out that there are not many, to be honest just a few. One of the best and very interesting Flex Apps is located here :
http://flexarena.blogspot.com/2006/10/3d-wireframe-renderer-for-flex.html
by Anjali Bhardwaj.
It consists of a wireframe renderer which loads 3Dmax ASE format and XML mesh models from the server side, however it is very primitive and simple, without textures and so on.. but that’s not the point here. By simply watching this example we are in some sort of way assured that it is possible to render and load objects which is really important from our point of view... in which, in the future we would like to use that kind of solution as a basis for our GIS 3D object oriented system. After digging some more, I have to say that it is really little done in 3D and Flex at the moment, and there are several reasons why.
First of all – why do something that is already done. Well as I said before Flash and Flex have more similarities than differences. Main difference is that the source file for Flash is a binary FLA which is compiled among with AS classes in Flash IDE to swf file which is later hosted on a server. Flex can deploy MXML(XML based) files and AS classes on the server which is generating swf files at runtime, that’s cool. Not having source in binary format is also important because it gives Flex ability to do for example ver. control on files. Well there are much more differences in server-client communication structure but my point here is that we should look for some really good 3D solutions for Flash and find out if they are able to take a leap to Flex environment.
Ok. Finding 3D solutions was quite easy. There are already some commercial products and also some open source approaches. Well 3D in Flash requires a bit more explanation because Adobe doesn’t support native 3D – no OpenGL or DirectX. There are some gossips saying that they are working really hard on it. Well these gossips could not be certified until I could get in touch with Adobe team, heh and I don’t think they would share their plans with me. So let’s pause on this thread for a second.
In the meantime let’s look at some non-native 3D solutiuons - software only. First is so called pre-rendered sprite approach. You create object with software such as Maya, Blender, Max or other.. then you render it from several angles and place it in Flash. It’s completely fake 3D. You can create really marvellous and vivid sites with that, because the only limit you get is the one with your software. However interaction is really limited so this is no good for our GIS purposes. Another approach is a real 3D engine, there are several at the moment and they differ on the ways of rendering. After taking a closer look at these beauties – documentation, license, source, examples, features and so on. I specified two possible candidates with are fully open source so that we can mess with the code. The names are Papervision3D (http://www.papervision3d.org) and Sandy3D (http://www.flashsandy.org). PV3D has a great advantage of being already implemented in AS3 what makes him much faster than Sandy. Ok now let’s invoke the thread that we paused before.
In this point a question arises... If the gossips about Adobe and its native 3D are true, is that a proper way that we’re going to follow with open source engines? Huh, well that’s a really good question because in that case most of the existing 3D engines will have to revise again their main goals, because if Adobe would release 3D engine it would probably wipe out all the existing ones. But, we are not sure at the moment what adobe plans right now... and in the other hand I truly doubt that hardware supporting engine for Flash would be such a good move for Adobe, in some way they would lost their platform independence. So, fake 3D engines can live. Especially bearing in mind that their performance is based on CPU speed, which is increasing these days month by month. At the moment PV3D engine based on AS3 is able to view 20.000 polygons per second which gives us 1000 in 20FPS. That is a really nice result and I think it should be enough for our GIS 3D project.
Ok, so now the answer... so Yes it is possible to render 3D environment in Flex. However there are some limitations which we should always keep in mind. Our goal here is to create simplicity, just like google maps or ArcWeb Explorer are using vector representation our priority is also to keep it as simple as possible while supporting many ways of evolution for future purposes.

Thursday, March 8, 2007

Project GIS and FLEX 3D started

Aloha!
I started working on my research about GIS (geographical information systems) few weeks ago. As I explored the subject deeper, I found that its evolving really fast and the possibilities that it gives... well they can have tremendous influence on our society in next years, to be honest I truly believe that the future lays there.. hehe I can imagine governors playing SimCity like game on GIS software, they virtually place a home -> application sends job specification to construction group and they start their work... ok futurismooo but possible.... so after reading some articles especially about ESRI using they latest tool ArcWeb Explorer :
http://mxdj.sys-con.com/read/295386.htm
http://www.spatiallyadjusted.com/2006/06/29/esri-is-a-adobe-flex-2-success-story/
and because I'm quite familiar with the Adobe Flex 2 technology abilities.. I thought, why not to go further and develop three dimensions interface in Flex 2.. Imagine going through the cities and looking from first person perspective view. That would be cool. Well to be honest if we could develop 3D abilities in Flex, that kind of solution would affect not only GIS but also navigation on Web applications and online gaming as well. Its worth seeing what can be done in that direction.. So lets start.. this week I'm gonna dig the web in search of existing solutions for 3D in Flex.

Any comments, pointers and suggestions would be most appreciated.
Saludos!

Marcin
http://sauax.boo.pl