如何从Geoserver中的图层获取样式

时间:2018-11-22 06:38:20

标签: gis openlayers-3 geoserver openlayers-5

我想从sql视图层中获取样式(sld或css无关紧要,但更喜欢css),但是我无法实现。 这是我的层的SQL视图

select 
    value,
    location,
    'mark: symbol(square);mark-size: 6px;:mark {fill: #0099cc;}' STYLE
from TABLE t

这是我的风格:

/* @title point */
* {
    [STYLE]
}

预览图层时,出现以下错误:

org.parboiled.errors.ParserRuntimeException: Error at line 3. Encountered "<EOF>" at line 1, column 5. Was expecting one of: "(" ... ":" ... <IDENTIFIER> ... "." ... "not" ... "in" ... "tequals" ... "before" ... "after" ... "during" ... "*" ... "/" ... "+" ... "-" ... "like" ... "ilike" ... "exists" ... "does-not-exist" ... "is" ... "between" ... "=" ... ">" ... "<" ... ">=" ... "<=" ... "<>" ... Parsing : STYLE.

有什么方法可以从数据库中获取样式信息?

1 个答案:

答案 0 :(得分:0)

我认为不可能(正如您的问题所支持)。您当然可以从数据库中读取各个值,并在样式中允许使用表达式的任何地方使用它们。