我正在尝试在Geoserver中设置一个sld样式,它引用了PostGIS视图"Route Type“中的一列。我希望我的列名中有空格,因为我的目标是为我的所有空间数据创建用户友好的视图。使用下面的sld,我得到一个错误。我已经尝试用空格替换  以及<![CDATA[Property Name]]>,但这些都不能解决问题。
在propertyName中可以有空格吗?
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>Truck Routes and Restrictions</Name>
<UserStyle>
<Title>Truck Routes and Restrictions</Title>
<FeatureTypeStyle>
<Rule>
<Name>Designated Municipal Truck Route</Name>
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
<ogc:PropertyName>Route Type</ogc:PropertyName>
<ogc:Literal>*Designated Municipal Truck Route*</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#006600</CssParameter>
<CssParameter name="stroke-width">3</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>发布于 2020-12-17 06:26:49
据我所知,here PropertyName应该能够被网络功能服务检索到。接下来我读了How to request WFS propertyName containing parentheses,在那里我读到了所有这类元素必须匹配XML element naming,它不允许有任何空格。
所以你不能在PropertyName中使用空间。你应该以用户看不到的方式使用“我的列名”。
https://stackoverflow.com/questions/65331557
复制相似问题