One of the many topics that’s been of interest to me in the past year or so is the visualization of geographical data. Of course, this is nothing new in the computing world but that makes no difference to me! I love everything about nature and as my personal stopwatch of time spent watching the Discovery channel reaches depressing new heights, the fascination only deepens. One particular place on Earth that I’m constantly awed by is the Grand Canyon and since I haven’t been there, I figured that the only way to get a feel first hand was to generate it
With my mission planned (and a few more goals that I won’t reveal until I do them), I set forth on my path. The tools are fairly normal to me by now. I use jMonkeyEngine for the real-time creation of 3D and I write it in Eclipse. I also have a fairly solid footing in the use of GIS data, it was just a matter of putting it all together.
I started by picking a place in Google Earth that I would like to cover. The plan was to create a square of the canyon 10km by 10km. I picked a starting point that looked interesting and began building. Using the mapping tools I had previously built for Betaville, I converted the coordinate to UTM and created a grid of coordinates spanning 10km in each direction(which then got converted back to WGS84). With my desired datapoints picked, I sent requests to the USGS for elevation using their very handy (and very much appreciated!) web service (documentation for which can be found here.
With a whole bunch of data in hand (I ran it at intervals of 1000m, 100m, and am currently running it at 30m, this is 100, 10000, and 110889 points respectively), I set about creating the geometry. Luckily, this is almost painfully simple using jME and I was able to create a TerrainBlock loaded with the data in just a single line of code. Once the geometry was created, I set the application to export the object through both the jME BinaryExporter as well as the OBJExporter I wrote for jME2. The results were unexpectedly delicious.
As an extra treat I began the process of making it a geographic synthesizer where a user’s location would affect the pitch of notes being played. Perhaps we’ll see some geo-choruses popping up soon!
I’m in the process of setting up a Subversion server for myself, so expect to see the sources for this online rather soon.