Rule does not include filter when converted to XML
--------------------------------------------------
Key: GEOT-2162
URL: http://jira.codehaus.org/browse/GEOT-2162
Project: GeoTools
Issue Type: Bug
Components: core styling
Affects Versions: 2.6-M0
Environment: udig trunk
Reporter: Jody Garnett
Assignee: Jody Garnett
The following was reported by Harald on the udig-devel list:
It's not uDig, the Geotools SLDTransformer is broken (on trunk).
This is an excerpt from my original SLD:
<sld:Rule>
<sld:Name>admin0</sld:Name>
<sld:Title>LINE_ROAD_ADMIN_0</sld:Title>
<sld:Abstract>Abstract</sld:Abstract>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>feat_type</ogc:PropertyName>
<ogc:Literal>LINE_ROAD_ADMIN_0</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<sld:MinScaleDenominator>300000</sld:MinScaleDenominator>
<sld:MaxScaleDenominator>6000000</sld:MaxScaleDenominator>
<sld:LineSymbolizer>
...
</sld:LineSymbolizer>
</sld:Rule>
This gets parsed into a Style, which is added to the StyleBlackboard. But the
Memento created by SLDTransformer looks like this:
<sld:Rule>
<sld:Name>admin0</sld:Name>
<sld:Title>LINE_ROAD_ADMIN_0</sld:Title>
<sld:Abstract>Abstract</sld:Abstract>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>feat_type</ogc:PropertyName>
<ogc:Literal>LINE_ROAD_ADMIN_0</ogc:Literal>
</ogc:PropertyIsEqualTo>
<sld:MinScaleDenominator>300000</sld:MinScaleDenominator>
<sld:MaxScaleDenominator>6000000</sld:MaxScaleDenominator>
<sld:LineSymbolizer>
...
</sld:LineSymbolizer>
</sld:Rule>
i.e. the <ogc:Filter> tags are missing, and after reopening uDig and loading
the memento from the *.umap file, this is what is left:
<sld:Rule>
<sld:Name>admin0</sld:Name>
<sld:Title>LINE_ROAD_ADMIN_0</sld:Title>
<sld:Abstract>Abstract</sld:Abstract>
<sld:MinScaleDenominator>300000</sld:MinScaleDenominator>
<sld:MaxScaleDenominator>6000000</sld:MaxScaleDenominator>
<sld:LineSymbolizer>
...
</sld:LineSymbolizer>
</sld:Rule>
Moreover, my original
<sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
gets transformed into
<sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
<sld:SemanticTypeIdentifier>ANY</sld:SemanticTypeIdentifier>
I'm not sure if that is a problem.
To fix this problem, I changed SLDTransformer.SLDTranslator.visit(Rule),
replacing
filterTranslator.encode(filter)
by
element("Filter", filter).
With that change, my styles work as they should even after resurrection from
the memento.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel