irstv/orbisgis — pull request #431 by agueganno (2013-06-13 13:37:30+00:00)
Title: Adds interval classification in pattern recognition.

One of my hugest pull requests... It basically intends to offer the ability to manage interval classification for simple symbols. Thee are four main parts that have been done, from modifications in the render engine to additions in the legend UI.

The first part of the modification is a huge refactoring of the Categorize API. It was quite strange until now : we had a class with a first, orphan value and then some kind of mapping between thresholds and values. We only have a mapping now, considering that:

- It is what we need on the legend side
- The orphan value is in fact the mapping of the negative infinity key

The second part of this work is the definition of wrappers that are able to manage transparently Categorize and Literal and to represent them as Categorize instances. This way, we are able to create a Map of Maps, as we did in the unique value classifications. Consequently, we now have CategorizedLegend in the legend library, as well as we had RecodedLegend when I added management of unique value classifications.

The third part is the management of the classifications themselves. i define some Categorized symbols (Line, Point and Area, as usual) that are the maps finally used in the UI. Indeed, there are the API proposed by legend for interval classification management.

I've done the same thing I did for recode: I've implemented Map the same way. Indeed, I've even been able to use what I did back then thanks to the designed architecture of library.

The fourth part is the work I've done in the OrbisGIS UI. We know have panels in the simple legend editor that can be used to manage interval classifications. Here again, I've tried to use existing code as much as possible. It was not particularly foreseen, alas, so a big part of this PR is the factorisation work I've made in the UI. I've tried to make use of generics as much as possible...

There is still a known bug in the UI : unit of measure in points seems to be partially broken... I find this problem minor so I prefer to propose my work now. There are still some wrong labels too, but here again its minor.

What can be done in order to test: compile and test everything with maven, then run the software. Open a layer, edit its style, and check that it is possible to add interval classifications (currently named Categorized *****). you should be able to add/remove thresholds, to edit symbols, to edit keys, to edit the fallback symbol, to change the classification field and so on.

I know this PR is really, really huge. I don't like that but I found it risky to propose it only partially. I could have broken it in two or three in order to ease its reviews, as discussed with Adam, but Nicolas prefer it this way.

Good luck in reading that.