Closed GoogleCodeExporter closed 9 years ago
Need some more clarification for this issue: styling of subsets of data is
already possible using the Style Editor, but only for Vector Layers. For
example in
http://lib.heron-mc.org/heron/latest/examples/vectorstyler
For each layer different Rules can be created within a Style, each with their
own Symbology based on conditions. I sort of assumed that this issue could be
solved via the interactive Style Editor. So first some questions for
clarification:
1. is this meant for any Layer? I would guess only Vector Layers. WMS has a
totally different Style (SLD) concept. Issue mentions Implementer and User so
possibly Vector with multiple Rules?
2. "Implementer to create a a categorised/themed style...": how is this
envisioned? Via Heron-configuration?
3. Is it true that this issue is then unrelated to the Style Editor?
Original comment by jus...@gmail.com
on 22 Jan 2014 at 12:41
Hi Just,
You're correct that this item is unrelated to the Style Editor.
Basically we want the user to be able to show only subsets of a layer that is
being served by WMS (and is thus styled with an SLD). The user should be able
to change things just be checking/unchecking a checkbox next to the subset (see
subset.png).
So to answer questions:
1) This is ideally for layers that are WMS, but WFS too if possible (we don't
use WFS currently).
2) I don't really have a vision. SLD's already exist, so the implementer
configuration would simply be a boolean option that's false by default.
3) Yep - nothing to do with the Style Editor.
That all said, I can't think of a way to do it via WMS with SLD's on the
server. So maybe you'll have to go the route of using WFS for this.
Original comment by jonathan...@warwickshire.gov.uk
on 22 Jan 2014 at 2:09
I think the general issue is to have "sublayers", either WFS or WMS, where part
of the layer-data is shown based on a filtering condition, in combination with
custom styling for each sublayer.
Apart from the Layer tree interaction with checkbox+legends, I think this
should be possible as follows:
WFS: create a Vector Layer with WFS Protocol and Style + Filters for each
sublayer, e.g.
new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
}),
styleMap: new OpenLayers.StyleMap({
strokeWidth: 3,
strokeColor: "#333333"
}),
filter: new OpenLayers.Filter.Logical({
type: OpenLayers.Filter.Logical.OR,
filters: [
new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "TYPE",
value: "highway"
}),
new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "TYPE",
value: "road"
})
]
})
})
WMS: create a WMS Layer with subset selection via (E)CQL, as in
http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html. I
think the WMS Layer can have a single SLD with conditional rules. By using CQL
in the Layer config the subset corresponding to the SLD Rule can be selected.
CQL may be GeoServer-only, but one configures this for a specific
GeoServer-Layer anyway. MapServer supports a similar mechanism, think embedded
SQL...
Jonathan: if you agree with the above approach I can make an initial example
today.
Original comment by jus...@gmail.com
on 3 Feb 2014 at 11:22
A first shot at an example for WMS:
http://lib.heron-mc.org/heron/latest/examples/sublayers
(see help button). Remaining:
* dealing with Legend (WMS Legend shows entire Legend for each sublayer). Could
be effected by splitting SLD into 3 SLDs and using STYLES WMS-parameter in
layer definition.
* inline Legend in layertree
* multilayer enabling: switch all sublayers on via directory node (as Road
Accidents above)
* WFS example
Original comment by jus...@gmail.com
on 3 Feb 2014 at 12:41
Added WFS-sublayering to example:
http://lib.heron-mc.org/heron/latest/examples/sublayers
Original comment by jus...@gmail.com
on 3 Feb 2014 at 9:58
Hi Just, This looks like a good start. I'll test it thoroughly at a later point
unless you want any specific thing tested now.
Original comment by jonathan...@warwickshire.gov.uk
on 4 Feb 2014 at 1:23
Made several enhancements. See example:
http://lib.heron-mc.org/heron/latest/examples/sublayers/
Specific:
- checkable parent nodes for selecting all children with new Heron
'hr_cascader' nodeType
- show only the Legend for the sublayer (i.s.o. entire Layer Legend)
- some more text in help text (? button)
Remaining:
- display sublayer Legend in each tree child node. Like in your example image.
This is well possible with GeoExt, as in this example:
http://api.geoext.org/1.1/examples/tree-legend.html but need to find the proper
'hooks' to make this Heron-configurable as part of LayerTree config. Question
is if this is needed at this time.
But at least the optional standard WMS GetLegendGraphic RULE= parameter can be
applied, see e.g.
http://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/legendg
raphic.html. GeoServer supports even more control over the output of the Legend
image.
Original comment by jus...@gmail.com
on 7 Feb 2014 at 3:43
Looking very good.
- We would quite like the legend in the layertree if possible, at least as an
option (some people may prefer it, others not - I think we'd consider it on a
per-project basis).
- The order of items in the legend isn't the same as they are in the layertree
(related to http://code.google.com/p/geoext-viewer/issues/detail?id=332 ?)
- If all sub-layers have been checked, then the "parent" should become checked.
- If at least one of the sub-layers is unchecked, the parent should become
unchecked
Original comment by jonathan...@warwickshire.gov.uk
on 7 Feb 2014 at 4:45
> - We would quite like the legend in the layertree if possible, at least as an
option (some people may prefer it, others not - I think we'd consider it on a
per-project basis).
Added tree node legends for WMS layers. For now via standard ExtJS 'icon'
TreeNode property. See Help text. The icons are assigned with the
GetLegendGraphic URLs with each respective RULE. See Config.js. Some reuse by
defining the rules once:
http://lib.heron-mc.org/heron/latest/examples/sublayers/Config.js
You may switch on the Legend for the Layer as well (via noLegend: false WMS
Layer prop.).
> - The order of items in the legend isn't the same as they are in the
layertree (related to
http://code.google.com/p/geoext-viewer/issues/detail?id=332 ?)
Yes I think so
>- If all sub-layers have been checked, then the "parent" should become checked.
>- If at least one of the sub-layers is unchecked, the parent should become
unchecked
Related to the new cascader tree node type. I've added this to issue 170 which
is now about the new cascader node.
Original comment by jus...@gmail.com
on 7 Feb 2014 at 5:08
> - The order of items in the legend isn't the same as they are in the
layertree (related to
http://code.google.com/p/geoext-viewer/issues/detail?id=332 ?)
Yes I think so
Do we re-open 332?
Original comment by jonathan...@warwickshire.gov.uk
on 7 Feb 2014 at 5:13
I now think it is/requires a separate issue: it is not related to "Styling of
subsets of data" nor issue 332. It is an issue in the GeoExt LegendPanel. The
solution may be similar but the component is different and not even in Heron
but GeoExt LegendPanel.js. The LegendPanel listens to add/remove Layer from the
LayerStore, and just adds/removes legends within its own tree without any
ordering.
Original comment by jus...@gmail.com
on 7 Feb 2014 at 5:28
Well, 332 required ordering of the legend to reflect ordering of the layer
tree, so can't what was done there be used for resolving this?
Original comment by jonathan...@warwickshire.gov.uk
on 7 Feb 2014 at 5:32
>- If all sub-layers have been checked, then the "parent" should become checked.
>- If at least one of the sub-layers is unchecked, the parent should become
unchecked
FIXED
Original comment by jus...@gmail.com
on 8 Feb 2014 at 3:46
Example http://lib.heron-mc.org/heron/latest/examples/sublayers now illustrates
also two basic ways to include Legends in layer tree leafs:
- via the gx_layer config option 'legend: true'
- explicitly per node by setting the HTML of the gx_layer 'text' property with
bot layer name and GFI HTML img
See also help text. This is now quite close to the original example above.
Original comment by jus...@gmail.com
on 10 Feb 2014 at 4:34
Attachments:
Looks good. Took me a second to realise the legend was there though.
Is it possible to remove the non-legend icons? The one that looks like a window
with some lines of text on it? They don't add anything (or at least, I've never
figured out what they represent). That should make the actual-legend-icons
obvious.
Original comment by jonathan...@warwickshire.gov.uk
on 10 Feb 2014 at 4:39
Ok see example and att. This is now quite easy via a new LayerTreePanel config
option layerIcons: 'none'.
The original icons were 'document icons' like one finds in MS Windows. Like the
map icons probably an attempt to give a comfortable L&F. I tried to replace
these with icons that show the kind of layer: 'raster' or 'vector' (or 'atom')
but in this context they may be confusing, so set to none.
So LayerTreePanel, layerIcons can be: 'none', 'bylayertype', 'default' (as
before). Every icon can also be explicityly configured in 'gx_layer' if needed
(as in original example).
The LayerTree and other examples example use 'bylayertype':
http://lib.heron-mc.org/heron/latest/examples/layertree/
Original comment by jus...@gmail.com
on 10 Feb 2014 at 4:58
Attachments:
Refined the tree. See attachment. 'Themes' was a bit redundant and indented.
Original comment by jus...@gmail.com
on 10 Feb 2014 at 5:04
Attachments:
Excellent - much better for a very simple improvement. Thanks! :-D
Original comment by jonathan...@warwickshire.gov.uk
on 10 Feb 2014 at 5:09
Ok, can we consider this issue done? I think the building blocks are all there
for an implementer to create WMS- or even WFS-sublayers, and for the user the
interaction to select/deselect, one or more or all sublayers with inlined
legend images as in the original screenshot.
Original comment by jus...@gmail.com
on 11 Feb 2014 at 2:49
One thing I've just noticed - it seems to be possible to query the layers even
when they're turned off. So I turn on Population < 2m and then click Texas and
the texas Feature Info comes up. Shouldn't not Feature Info appear?
Original comment by jonathan...@warwickshire.gov.uk
on 11 Feb 2014 at 2:53
Interesting: what I see is that GFI does not include the CQL parameter, hence
queries the whole layer. This problem is that in OL:
OpenLayers.Control.WMSGetFeatureInfo function buildWMSOptions() where
CQL_FILTER is not added to params sent to server. There is a venderOptions
possibility but then we get into the same kind of issue as with STYLES
https://code.google.com/p/geoext-viewer/issues/detail?id=215.
When multiple Sublayers would be active only one of the CQLs would be used
since OL bundles requests for the same WMS-URL for multiple Layers (makes
single request).
Somehow we need to force OL to not bundle the WMS GFI requests when CQL
(vendorparams) active.
Original comment by jus...@gmail.com
on 11 Feb 2014 at 4:07
> One thing I've just noticed - it seems to be possible to query the layers
even when they're turned off. So I
> turn on Population < 2m and then click Texas and the texas Feature Info comes
up. Shouldn't not
> Feature Info appear?
As said: "Somehow we need to force OL to not bundle the WMS GFI requests when
CQL (vendorparams) active.". Made a local Heron override to force OL to make
one request per CQL Layer. That caused some other issues, but all should work
now as if each sublayer is a real separate Layer. Please check in the example.
Original comment by jus...@gmail.com
on 13 Feb 2014 at 1:04
Yep, that's fine then.
Original comment by jonathan...@warwickshire.gov.uk
on 14 Feb 2014 at 5:14
Ok can we close this issue then?
Original comment by jus...@gmail.com
on 19 Feb 2014 at 10:27
Sure. I'll create new tickets as applicable if I find anything. Thanks again!
Original comment by jonathan...@warwickshire.gov.uk
on 19 Feb 2014 at 10:28
Closing time: a step nearer to v1.0.1
Original comment by jus...@gmail.com
on 19 Feb 2014 at 10:51
Original issue reported on code.google.com by
jonathan...@warwickshire.gov.uk
on 21 Jan 2014 at 3:31Attachments: