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 ==
TODO 	Timeline 	Status
Coding begins 	May 30 	Done!
Research about the clustering functionalities and about the marker classes in WWW	May 30 - June 10 	Done!
Implementation of a clustering algorithm in WWW 	June 11 - June 20 	Done!
Phase 1 Evaluation 	June 26 	Done!
Creating a first version of the clustering plugin 	June 26 - June 30 	Done!
Implementing clustering options to cluster markers based on attributes 	July 1 - July 10 	Done!
Vacation Comment code and documentation 	July 11 - July 18 	Done!
Phase 2 Evaluation 	July 24 	Done!
Customize the design of clusters with colors and effects 	July 24 - July 31 	Done!
Filter clusters on predefined attributes 	August 1 - August 10 	Done!
Creating Unit Tests for the code 	August 11 - August 16	Done!
Comment code and documentation Vacation 	August 17 - August 21	Done!
Finalizing documentation and reviewing the code 	August 21 - 28 	Done!
Submit final work product and mentor evaluation 	August 29 	Awaiting..
We will try to follow the schedule and report the status of the project each week.
== Weekly Reports ==
=== Week 1 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
Next week I will set up the unit test environment.
* Are you blocked on anything? 
I already tried this week but had some problems. However, talking with my mentors I got some advice on how to proceed.
=== Week 2 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
Next week I will improve the current functionalities and create new more to allow a better insertion of markers into the plugin.
* Are you blocked on anything? 
I'm not blocked on anything right now
=== Week 3 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
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.
* Are you blocked on anything? 
I'm not blocked on anything right now
=== Week 4 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
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.
* Are you blocked on anything? 
I'm not really blocked, but I need the help of the mentors to proceed because I'm not really sure right now.
=== Week 5 ===
* What did you get done this week?
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/
* What do you plan on doing next week? 
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. 
* Are you blocked on anything? 
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.
=== Week 6 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
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.
* Are you blocked on anything? 
I'm not blocked on anything
=== Week 7 ===
* What did you get done this week?
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).
* What do you plan on doing next week? 
Next week I will create more unit tests, and I will work more on the customization of the clustering functionalities.
* Are you blocked on anything? 
I'm not blocked on anything
=== Week 8 ===
* What did you get done this week?
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
* What do you plan on doing next week? 
Next week I have still to finish some unit test and I will also try to customize more the clustering functionalities
* Are you blocked on anything? 
I'm not blocked on anything
=== Week 9 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
Next week I need to finish the examples and use the build version to improve performances.
* Are you blocked on anything? 
I'm not blocked on anything
=== Week 10 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
Next week I will create some other examples and improve more the documentation.
* Are you blocked on anything? 
I'm not blocked on anything
=== Week 11 ===
* What did you get done this week?
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.
* What do you plan on doing next week? 
Next week I will write some other tests and finalizing the documentation.
* Are you blocked on anything? 
I'm not 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
# 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.
Category:Google Summer of Code