Hi Emily,

>> 1) ramps
[...]
> I'm sure we can come up with something reasonable.  I'll have a look at the
> JGrass raster legend.

Nice, thanks.

>> 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.

Keep me updated on your moves, I might be able to help you here. I
will try to have a look at that one asap.

Problem is that it is not only the adding of a combo which defines the
type, right? Some of them would need two values to set in one row
(ramp?), while categories will go for 1 value and one label? We had
this one for grass raster maps.
I find this quite interesting and it would be nice to make the raster
style editor good once for all.


>> 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"

Aha, ok. When using the style editor ui this would never happen
because they are all double values. That is why it looked strange to
me.

> 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)"

Whereas if it is categories it would say just Min and Max near the color boxes?

>> 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.

Yep, novalue is a tricky thing. Also because binary formats most often
use NaN as the novalue. You might have noticed that in the style
editor I put the possibility to add custom values to handle as
novalues.

Ciao,
Andrea











>> 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

Reply via email to