GSoC 2017 - NASA/ESA WebWorldWind Marker Cluster

Introduction
My project will focus on creating a plugin to allow clusterization of markers in the ESA-NASA Web World Wind framework. These following capabilities are the features I would like to implement: 1. Clustering based on different algorithms 2. Set a custom icon based on user parameters: i.e., number of clusters or custom variables 3. Cluster based on geometries and not just polygons 4. Filter clusters based on user criteria 5. Precache the cluster at the zoom levels for optimized performance

Schedule
We will try to follow the schedule and report the status of the project each week.

Week 1
This week I set-up the development environment and made some research about the clustering algorithms and libraries available. I found out some good library for clustering point and it can be integrated with WebWorldWind. Next week I will set up the unit test environment. I already tried this week but had some problems. However, talking with my mentors I got some advice on how to proceed.
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 2
I prepared the testing environment and unit tests are working. I prepared a sample test but also improved the structure of the project and created some functionalities. Next week I will improve the current functionalities and create new more to allow a better insertion of markers into the plugin. I'm not blocked on anything right now
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 3
I developed some methods to improve the clustering functionalities. It accepts now a single marker, as well a list of markers. Also, some functionalities to show and hide single and groups of markers. I'm able to create a cluster for a specified zoom level and show it in the globe. Next week I would like to show and hide the clusters automatically based on the zoom level and generate at the start all the groups. I'm not blocked on anything right now
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 4
I managed to show and hide clusters based on the zoom level and hide the others. However, I encountered a small performance issue when there all too many markers in the globe. Next week I'm planning to hide all the markers that are not visible in the current view. I started researching and studying some code examples to achieve this. I'm not really blocked, but I need the help of the mentors to proceed because I'm not really sure right now.
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 5
This week, as planned, I managed to hide all the markers outside the current view. I spent almost all week researching about the approaches to do that, and to improve performances I ended up using a camera model for a 2D view. Which works very well on small areas, like in our case. While, on a bigger area, I will implement maybe the 3D camera model, as suggested by my mentors. I also created a smooth navigation to match zoom levels with cluster levels. I also implemented a GitHub page where is possible to test a demo with 200k markers. Demo: https://simonebt92.github.io/NASA-WWW-MarkerCluster/ I will try to understand how to correlate zoom levels from WorldWind (camera range) with zoom levels from the cluster and its radius, and an optimal number of markers to show on each level. I'm not totally blocked but I'm struggling on finding a good way to show the right amount of clusters and select a good radius when clustering.
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 6
This week I finally found how to correlate the zoom levels of World Wind with the cluster levels. I allow now users to set a maximum level on which they can cluster. I created some images, with a color variation depending on the number of markers a cluster contains. I show markers on the visible area while zooming or pressing the +/- buttons. I allow to manage at the same time different clusters (each with his setting). I created an example with all the US cities. I implemented single markers without clusters. Next week I was expected to be on vacation, but since I won't be able to go, I agreed with my mentor that I will skip few days in August and next week I will work on two things: Handling the pan on the globe to show the markers on the visible area (now works only with zoom). Starting commenting the code because it's getting confusing. And create a documentation. I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 7
This week I implemented the possibility to pan in the globe and display the markers in the panning area. I created an option to limit the visible markers to improve performances. I commented all the functions briefly and created many unit tests (more yet to come). Next week I will create more unit tests, and I will work more on the customization of the clustering functionalities. I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 8
This week i've done the followings: Enable the plugin to work with customized navigators and controls Fixed a problem that prevented to click on a cluster and zoom Allow the customization of the marker icons Removed jQuery from the project Implemented a build version for the gh-page Implemented the plugin in a real application, and fixed a few problem that found on the project while doing it Next week I have still to finish some unit test and I will also try to customize more the clustering functionalities I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 9
This week I allowed some customization of the settings from the user interface. I changed the structure for the examples to insert many of them I implemented many new examples with their own UI so that users can follow an HTML+JS example as is done in the WWW examples page. One example for instance run 65k clusters very easily. Next week I need to finish the examples and use the build version to improve performances. I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 10
This week I completed some examples, and I hosted the app using the build version which is much faster. I also created a quick start documentation and a short video showing how to use the plugin. Next week I will create some other examples and improve more the documentation. I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 11
This week I created some examples, showing more functionalities of the plugin, and now users are able to test them directly on the example page. I also started created more advanced unit tests, using mock object and spies. Next week I will write some other tests and finalizing the documentation. I'm not blocked on anything
 * What did you get done this week?
 * What do you plan on doing next week?
 * Are you blocked on anything?

Week 12 - Final Report

 * Project: Plugin Marker Cluster for NASA Web World Wind


 * Abstract: The motivation behind Marker Cluster stands behind the need of porting a useful functionality into a popular framework such as Web World Wind, which, could benefit in different areas thanks to this plugin


 * The state of the art BEFORE my GSoC: Before my project, Web World Wind didn't have any external plugin, made in the same form of mine. Especially there were no cluster functionalities for the markers. Even though the concept of clustering markers is not new to the public, it was not available on this framework.


 * The added value that my project brought to the software: Thanks to my project, now any Web World Wind developer can easily import the clustering functionality in any application. Following the documentation anyone can do it, as we already tried in an example application.


 * Work to be done on the project: The project itself is quite complete, including some basic functionalities. What could miss is trying in more application the product and find problems and new features to implement.


 * Website & Documentation: https://simonebt92.github.io/NASA-WWW-MarkerCluster/
 * Code Developed: https://github.com/simonebt92/NASA-WWW-MarkerCluster/commits/master


 * Image: [[File:https://simonebt92.github.io/NASA-WWW-MarkerCluster/assets/logo.JPG]]

Brief description of the idea
My project consists in the development of a Plugin for the ESA/NASA WebWorldWind framework, to allow clustering of multiple markers.

A link to all my commits is available here: GitHub.

State of the art before this project
Currently there is no plugin for clustering large amounts of markers, even though an app may implement a similar functionality, but not with a modular plugin that can be generically reused for any number of user-specific criteria.

Additions that this project will bring to the software
As a result of the plugin I will develop, it will be possible for anyone to easily import the plugin into the framework and use it as a modular component. In this way it will be possible to cluster markers easily, using any number of options. As an example, it can be useful to use this plugin when visualizing a marker for each city in Italy, because, having thousand of markers in a small area could be very difficult to render on the globe, but also to understand. Thanks to the plugin, users will see only a few clusters while viewing the markers from a far distance and zooming in they will see more and more details.

Public Repository & Testing
The application is available in GitHub at GitHub. More instruction on how to use the plugin will be available soon
 * 1) Instructions

Student's Biography
My name is Simone Battaglia, I'm a Ph.D student in Neuroscience at Alma Mater Studiorum Bologna. I'm passionate about programming, and I like to integrate the IT world inside the neuroscience field. I started learning programming thanks to my scientific researches and the needs of creating experiments in my study field. I got to know about WebWorldWind thanks to Patrick Hogan back in 2016 and I started using it since then. This is my first time in the GSoC and I'm very happy to be coding for these 3 months and have the guidance of my mentors Patrick Hogan and Gabriele Prestifilippo.