Terrain Model Generation and Analysis


Introduction

The 52°North Triturus library is extremely powerful and provides a lot of functionalities. This library is used in a lot of interesting projects such as the 52°North terrainServer and the 52°North WorldViz. Currently, the terrainServer offers web-based services providing perspective terrain views. The idea of this project is to extend terrain model generation and analysis to practical scenarios, where it would be desirable to have web-based access to tools (e.g., difference surfaces, mass calculations, inclination analysis) and to model generation functions, using the 52°North Triturus library. In the Google Summer of Code 2016 program, we shall try to achieve web-based access for some of these tools. This new module will be named ‘terrainTools’ and will be a standalone project.

Task management: https://trello.com/b/MuqBTuXw/terraintools

Repository: https://github.com/52north/terraintools

Demo: https://terraintools.herokuapp.com

Blog Posts

Introductory Blog Post: http://blog.52north.org/2016/05/25/terrain-model-generation-and-analysis

Mid-term Blog Post: http://blog.52north.org/2016/06/28/terrain-model-generation-and-analysis-2/

Lets be clear - What has Adhitya done during Google Summer of Code?

Well for a start, the entire terrainTools module was not present before the start of Google Summer of Code 2016. By the end of last year's program, I had got acclimatized with the Triturus project. The Triturus project is powerful and provides a wide variety of Geo-Visualization algorithms. However, to showcase the strength of Triturus, we needed a cloud based application as a proof of concept. terrainTools does exactly that - In this project, I demonstrate how Triturus can be used in day to day terrain applications, on the cloud with tight integration of Google's services. We can create elevation grids, visualize flooding applications, generate cross-section for a terrain and even calculate difference models!

For the development of terrainTools, we needed to update few of the existing algorithms. For each service provided, we had to write Servlets to access the Triturus library. Since there was a focus on security, we used Google's Authentication service. We also wanted to allow users to store and share results seamlessly. Therefore, we used the Drive API. In order to have the look-and-feel of Google Drive, we also included the Picker API for better performance.

So, Adhitya has created the web service. Christian and Benno check for code smells. All of us contribute towards algorithm development. smile

Here are list of my commits on terrainTools: https://github.com/52North/terraintools/commits?author=kamakshidasan

Here are list of my commits on triturus: https://github.com/52North/triturus/commits?author=kamakshidasan

You can find the demo to the terrainTools: https://terraintools.herokuapp.com

You can find the blog posts and the weekly reports on this page! Feel free to contact me!

You can find the service specification documentation over here and the extended manual over here!

Instructions

  • Since terrainTools is a Maven repository, simply download the sources and execute `mvn clean install`.
  • We recommend running terrainTools with Apache Tomcat 8 and Java 8.
  • All algorithms can be accessed from index.html. However, if you plan on extending the API, the service specification can be found here.

Deployment on IDE

  • terrainTools was developed using Netbeans 8.0.
  • For testing and development, download the sources of both Triturus and terrainTools. Build both the projects within Netbeans.
  • Add Triturus as a dependency, if you would like to modify the algorithms.
  • Run the file named launch/Main.java for deployment on Tomcat. Or you could just create the .war manually and then deploy it.

Weekly Reports

Report Week 1

Status

  • We have set up our initial repository at - https://github.com/52North/terraintools - This was done from scratch and has taken some time for us.
  • We integrated code that was done during the Code Challenge
  • Initially, I went the AJAX route embedded with JavaScript. But that led to unforeseen bugs that were hard to eliminate. I quickly scratched it off, and haven't used any JavaScript for now.
  • We had discussion about using Google Drive API, for file management in our previous meeting. Both, Benno and Christian felt we could give it a shot. I spent this week reading about the API, going through the sample code and making few examples of my own. You could check this out: here
  • We now have a proper file management system, with our intended project structure! :)

Problems

  • We are yet to find a place to host our server. Adhitya is looking into it!

Next tasks

  • Specification of Service Interfaces
  • Creation of regular data-lattice (using Triturus library)
  • Server-side storing of created data-lattice

Report Week 2

Status

  • Last week, I had created an interface to the Google Drive API and written Java Servlet code for it. However, I wasn't able to host it on a webserver. It turns out that, code wasn't meant to be hosted and was mean to be standalone server.
  • Therefore, I had to clean up the way we call our servlets and further the Google Drive API.
  • We have set up a Heroku App - Here is a link!
  • Changed parts of the Triturus repository, to be able to interface with the Webapp - specifically allowing access of X3DOM files.

Problems

  • There seems to be few problems with rendering of JS files on Heroku - Adhitya will solve it soon!
  • The X3DOM file seems to be much smoother than the X3D file. What's going on!

Next tasks

  • Allow selection of points on the Lattice

Report Week 3

Status

  • An X3DOM scene generation showing the elevation grid has been generated
  • Points can be selected on the scene!

Problems

  • The website can only be used with https - A redirect has to be set for http

Next tasks

  • Allow selection of multiple points on the Lattice
  • Flooding algorithms

Report Week 4

Status

  • A flood fill demo has been made
  • An example to generate multi-terrains example has been implemented
  • Google Picker API has been used and files generated by TerrainTools application can be selected

Problems

  • None till now

Next tasks

  • Show flooding algorithms on the server

Report Week 5

Status

  • Problems regarding PROTO were encountered
  • Refractoring code had to be done

Problems

  • This week was marred by constant electricity cuts and internet outages

Report Week 6

Status

  • JavaScript is now inserted and does not come by default in all ElevationGrid 's
  • We have removed PROTO concept
  • We are able to combine terrains and display flooded terrains

Problems

  • None till now

Next Tasks

  • Service specification for cross-section functionality

Report Week 7

Status

  • Tried to do draw on top of the X3DOM scene for the cross-section functionality - We found two aproaches to do this
  • We could dynamically plot a cylinder as a line in X3DOM (I couldn't find any examples yet)
  • We could use an external plugin such as D3.js - which has good capability with X3DOM and draw a line using that
  • Benno suggested to go with the first approach and try to use a pin and Christian felt that it would nice to go with the second approach

Problems

  • Both approaches have their pros and cons.
  • In the first approach, we have to set the viewpoint and refresh the scene
  • In the second approach, we have to get an external library

Next Tasks

  • Service specification for cross-section functionality

Report Week 8

Status

  • For drawing points on top of the scene, we dynamically plotted spheres.
  • The User-Interface is much more smoother and more friendly, with tighter integration with Google Drive. Files and can be picked right from the required service specification.
  • Delete specification works as desired

Problems

  • The User- Interface still looks a bit ancient - We could use Twitter's Bootstrap

Report Week 9

Status

  • New datasets have been visualized
  • A Bootstrap mockup has been created
  • Automatic recognition and conversion of files takes place

Problems

  • The User- Interface still looks a bit ancient - We could use Twitter's Bootstrap

Report Week 10

Status

  • Code was refactored, Comments added - Phew that took some time!
  • Google Plus API was removed, and replaced with a better and more generic Google OAuth

Next Tasks

  • Documentation

Report Week 11

Status

  • Difference Model Calculation was added
  • Blog Post Written - to be published

Next Tasks

  • Documentation

Report Week 12

  • Documentation. Documentation. Documentation. Should I say more?

Topic revision: r14 - 23 Aug 2016 14:23:03, AdhityaKamakshidasan
This site is powered by FoswikiCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback