Andrea,
Thanks for the feedback. Further comments in-line
On 9/21/2012 5:25 AM, andrea antonello wrote:
Hi Emily, very nice work, always good to see you active!
Comments:
1) ramps
I am not able to review right now, but I would love to see the legend
ramp enhanced, since that one is not really helpful.
The ramp should be vertical and pass through at least a couple of
colors, which means it also should take up the space of about 5 boxes
usually taken up by the vectore box.
I have done that kind of work for the JGrass raster legend and would
be happy to retire that one to have it all inside the legend.
Do you think we could somehow converge on that?
I'm sure we can come up with something reasonable. I'll have a look at
the JGrass raster legend.
Also, what defines when to use a category or a ramp?
org.geotools.styling.ColorMap has a getType() function which I used to
determine if the color map is "intervals", "ramps" or "values". It
comes from the sld.
For ramp the sld:
<sld:ColorMap type="ramp">
<sld:ColorMapEntry color="#FFFFFF" opacity="0.0" quantity="-9999.0"/>
<sld:ColorMapEntry color="#FFFFFF" opacity="0.0" quantity="-9999.0"/>
<sld:ColorMapEntry color="#FF8080" opacity="1.0" quantity="0.0"/>
<sld:ColorMapEntry color="#004080" opacity="1.0" quantity="4.0"/>
</sld:ColorMap>
For interval the sld:
<sld:ColorMap type="intervals">...
For unique values the sld:
<sld:ColorMap type="values">...
At the moment there is no nice gui to define the different types of
functions. For ramps I was using the existing "Single Band Raster"
style configurator but the other types don't have a UI. You have to
enter the SLD directory in the "XML" style screen.
This is something else I will likely have to address for our client but
I was waiting to get more requirements before starting.
2) In the above screen I see that some values seem to be integers,
whereas others doubles. Why is that happening?
I'm just using what is in the sld. So a color map entry that looks like
this:
<sld:ColorMapEntry color="#004080" opacity="1.0" quantity="0.0"/>
<sld:ColorMapEntry color="#004080" opacity="1.0" quantity="4"/>
will have a label that says: "0.0 - 4"
The sld also has an optional "label" attribute which will be used if
provided. For example:
<sld:ColorMapEntry color="#004080" opacity="1.0" quantity="0.0"
label="Min"/>
<sld:ColorMapEntry color="#004080" opacity="1.0" quantity="4" label="Max"/>
will have a label that says: "Min - Max (0.0 - 4)"
3) I would suggest to consider novalues. I don't think that someone
wants to have the -9999.0 in the legend? Maybe that could even be put
inside a preference panel to set?
I had the same thoughts and this is on my list of things to look into.
I just haven't had the time yet.
4) I would suggest to put borders around the boxes in order to enhance
readability. In the case a color is the same as the background, it
looks odd (ex the -9999.0, but also white of the ramp on white
background)
ok
Cheers,
Andrea
On Thu, Sep 20, 2012 at 10:01 PM, Emily Gouge <[email protected]> wrote:
For the project I'm working on I needed to add the ability to include themed
rasters in the legend. In the process of adding this functionality I've
made a number of improvements to the udig legend.
Updates include:
1) Fixed the legend style configurator so it remembers the style parameters
entered by the user. Previously, it was always displaying the default
values.
2) I added some layer interceptors to track when legend layers are
added/removed and add listeners. I did this so I would watch context
changes and updated the legend when another layer changed. I updated the
legend if the style changed, visibility changed, or the context model
changes. This means the user does not have to refresh the map to update the
legend if they change a layer.
3) Fixed some rendering issues with the height of the legend being bigger
than required.
4) I added code to display ColorMap values for GridCoverage whose styles
include a ColorMap (see attached image for example). If the style does not
include a ColorMap then the default icon is used. I supported the three
types of ColorMap: intervals, values and ramp.
I've made a pull request:
https://github.com/uDig/udig-platform/pull/149
Feedback/comments are welcome.
Emily
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel