[OpenLayers-Dev] OpenLayers SLD formatting question
Andreas Hocevar
ahocevar at opengeo.org
Wed Sep 2 17:57:56 EDT 2009
Hey Paul,
Paul Dziemiela wrote:
> Hi folks,
>
> Been putting together a SLD library system and wanting to use the results in
> OpenLayers. From what I see the singular expectation of OpenLayers is that
> SLD documents will follow the structure of
>
> <sld:StyledLayerDescriptor ... >
> <sld:NamedLayer>
> <sld:Name>Foo</sld:Name>
> <sld:UserStyle>
> <sld:Name>Swamp</sld:Name>
> <sld:FeatureTypeStyle>
> <sld:Rule>
> ...
>
> However, the SLDs produced by the recent version of uDig(1.1.1) instead
> create structures like
>
> <sld:StyledLayerDescriptor ...>
> <sld:UserLayer>
> <sld:LayerFeatureConstraints>
> <sld:FeatureTypeConstraint />
> </sld:LayerFeatureConstraints>
> <sld:UserStyle>
> <sld:Name>Swamp</sld:Name>
> <sld:FeatureTypeStyle>
> <sld:Rule>
>
> I'm wondering if the current OpenLayers design is intended to be the only
> way to parse SLDs or if it's just a case of needing someone to do the work
> to accept other formats?
The latter. In the return object of Format.SLD, everything is prepared
for UserLayers already. They are just not being parsed yet.
> The uDig SLD should have some kind of name applied
> to the UserLayer I think.
>
According to the spec, this is not required.
> Seems like the SLD development in general has slowed to some degree of late.
> Has anything further come of Andreas Hocevar's work via 1531?
> http://trac.openlayers.org/ticket/1531
> I particularly like the idea of adding in the FeatureTypeStyle logic into
> the OpenLayers style object. It would be helpful to be able to target
> particular style rule sets onto particular geometry types.
>
Yeah, unfortunately these SLD and Style improvements lack funding, and
the proposed FeatureTypeStyle support would not change anything in the
Style object. That would be even more effort.
> I rummaged around but I can't see a way to set an ogc:filter to restrict by
> geometry type. Or is that wrong? Can the filter refer to the feature's
> geometry's CLASS_NAME? Or could I move the CLASS_NAME into a feature
> attribute called "GTYPE" or such?
>
If you want that in SLD, then SemanticTypeIdentifier would come close. I
am not aware of a way to do this with OGC filters.
But I am sure there are ways to do what you need in OpenLayers, outside
the SLD document. I do not have a clear picture of your use case though.
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Dev
mailing list