- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.geotools.ysld.Ysld.encode()
方法的一些代码示例,展示了Ysld.encode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ysld.encode()
方法的具体详情如下:
包路径:org.geotools.ysld.Ysld
类名称:Ysld
方法名:encode
[英]Encodes a GeoTools style object as Ysld.
[中]将GeoTools样式的对象编码为Ysld。
代码示例来源:origin: geotools/geotools
/**
* Encodes a GeoTools style object as Ysld.
*
* @param sld The sld to encode.
* @param output The output object, anything accepted by {@link #writer(Object)}
*/
public static void encode(StyledLayerDescriptor sld, Object output) throws IOException {
encode(sld, output, new UomMapper());
}
代码示例来源:origin: geotools/geotools
/**
* Transforms an SLD stream to Ysld.
*
* @param sld SLD xml reader.
* @param ysld Ysld writer.
*/
public static void transform(InputStream sld, Writer ysld) throws IOException {
SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory(), sld);
StyledLayerDescriptor style = parser.parseSLD();
Ysld.encode(style, ysld);
}
代码示例来源:origin: geotools/geotools
@Test
public void testFTSVendorOption() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
fts.getOptions().put("foo", "bar");
StringWriter out = new StringWriter();
Ysld.encode(sld(fts), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result = obj.seq("feature-styles").map(0);
assertThat(result.str("x-foo"), equalTo("bar"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testExpressionNil() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
p.getGraphic().setSize(Expression.NIL);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
// System.out.println(out.toString());
}
代码示例来源:origin: geotools/geotools
@Test
public void testSymbolizerUoMOther() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
p.setUnitOfMeasure(USCustomary.LIGHT_YEAR);
StringWriter out = new StringWriter();
exception.expect(IllegalArgumentException.class);
Ysld.encode(sld(fts), out);
}
代码示例来源:origin: geotools/geotools
@Test
public void testSymbolizerVendorOption() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
p.getOptions().put("foo", "bar");
StringWriter out = new StringWriter();
Ysld.encode(sld(fts), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point");
assertThat(result.str("x-foo"), equalTo("bar"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testSymbolizerUoMMetre() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
p.setUnitOfMeasure(UomOgcMapping.METRE.getUnit());
StringWriter out = new StringWriter();
Ysld.encode(sld(fts), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point");
assertThat(result.str("uom"), equalTo("metre"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testSymbolizerUoMPixel() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
p.setUnitOfMeasure(UomOgcMapping.PIXEL.getUnit());
StringWriter out = new StringWriter();
Ysld.encode(sld(fts), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point");
assertThat(result.str("uom"), equalTo("pixel"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testSymbolizerUoMFoot() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
FeatureTypeStyle fts = fts(p);
p.setUnitOfMeasure(UomOgcMapping.FOOT.getUnit());
StringWriter out = new StringWriter();
Ysld.encode(sld(fts), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point");
assertThat(result.str("uom"), equalTo("foot"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testEmptyColorMap() throws Exception {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
StyledLayerDescriptor sld = sld(styleFactory.createRasterSymbolizer());
StringWriter out = new StringWriter();
Ysld.encode(sld, out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap symbMap =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("raster");
assertThat(symbMap, not(yHasEntry("color-map")));
}
代码示例来源:origin: geotools/geotools
@Test
public void testFilter() throws Exception {
FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2();
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor();
UserLayer layer = styleFactory.createUserLayer();
sld.layers().add(layer);
Style style = styleFactory.createStyle();
layer.userStyles().add(style);
Rule rule = styleFactory.createRule();
rule.setFilter(filterFactory.less(filterFactory.property("foo"), filterFactory.literal(2)));
style.featureTypeStyles().add(styleFactory.createFeatureTypeStyle());
style.featureTypeStyles().get(0).rules().add(rule);
PointSymbolizer p = styleFactory.createPointSymbolizer();
rule.symbolizers().add((Symbolizer) p);
StringWriter out = new StringWriter();
Ysld.encode(sld, out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result = obj.seq("feature-styles").map(0).seq("rules").map(0);
assertThat(result, yHasEntry("filter", equalTo("${foo < 2}")));
}
代码示例来源:origin: geotools/geotools
@Test
public void testFilterEscape() throws Exception {
FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2();
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor();
UserLayer layer = styleFactory.createUserLayer();
sld.layers().add(layer);
Style style = styleFactory.createStyle();
layer.userStyles().add(style);
Rule rule = styleFactory.createRule();
rule.setFilter(
filterFactory.less(filterFactory.property("foo"), filterFactory.literal("}$")));
style.featureTypeStyles().add(styleFactory.createFeatureTypeStyle());
style.featureTypeStyles().get(0).rules().add(rule);
PointSymbolizer p = styleFactory.createPointSymbolizer();
rule.symbolizers().add((Symbolizer) p);
StringWriter out = new StringWriter();
Ysld.encode(sld, out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result = obj.seq("feature-styles").map(0).seq("rules").map(0);
assertThat(result, yHasEntry("filter", equalTo("${foo < '\\}\\$'}")));
}
代码示例来源:origin: geotools/geotools
@Test
public void testEmptyContrastEnhancement() throws Exception {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
StyledLayerDescriptor sld = sld(styleFactory.createRasterSymbolizer());
StringWriter out = new StringWriter();
Ysld.encode(sld, out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap symbMap =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("raster");
assertFalse(symbMap.has("contrast-enhancement"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testNonNameExpressionAttribute() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Expression expression = CommonFactoryFinder.getFilterFactory2().property("test");
p.setGeometry(expression);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.str("geometry");
assertThat(result, equalTo("${test}"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testFunction() throws Exception {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory();
StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor();
UserLayer layer = styleFactory.createUserLayer();
sld.layers().add(layer);
Style style = styleFactory.createStyle();
layer.userStyles().add(style);
Rule rule = styleFactory.createRule();
style.featureTypeStyles().add(styleFactory.createFeatureTypeStyle());
style.featureTypeStyles().get(0).rules().add(rule);
Function func =
filterFactory.function(
"strEndsWith", filterFactory.property("foo"), filterFactory.literal("bar"));
rule.setFilter(filterFactory.equal(func, filterFactory.literal(true), false));
StringWriter out = new StringWriter();
Ysld.encode(sld, out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String filter = obj.seq("feature-styles").map(0).seq("rules").map(0).str("filter");
assertEquals("${strEndsWith(foo,'bar') = true}", filter);
}
代码示例来源:origin: geotools/geotools
@Test
public void testNonNameExpressionLiteral() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Expression expression = CommonFactoryFinder.getFilterFactory2().literal("test");
p.setGeometry(expression);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.str("geometry");
assertThat(result, equalTo("test"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testEmbededExpressionEscapeLiteral() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Expression expression = CommonFactoryFinder.getFilterFactory2().literal("$}\\");
p.setGeometry(expression);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.str("geometry");
assertThat(result, equalTo("\\$\\}\\\\"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testTextSymbolizerPriority() throws Exception {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory();
TextSymbolizer symb = styleFactory.createTextSymbolizer();
symb.setPriority(filterFactory.property("foo"));
StringWriter out = new StringWriter();
Ysld.encode(sld(symb), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap text =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("text");
assertEquals("${foo}", text.str("priority"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testNameExpressionAttribute() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Expression nameExpression = CommonFactoryFinder.getFilterFactory2().property("test");
Mark mark = CommonFactoryFinder.getStyleFactory().createMark();
mark.setWellKnownName(nameExpression);
p.getGraphic().graphicalSymbols().add(mark);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.seq("symbols")
.map(0)
.map("mark")
.str("shape");
assertThat(result, equalTo("${test}"));
}
代码示例来源:origin: geotools/geotools
@Test
public void testEmbededExpression() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Expression expression =
CommonFactoryFinder.getFilterFactory2()
.function(
"Concatenate",
CommonFactoryFinder.getFilterFactory2().literal("literal0"),
CommonFactoryFinder.getFilterFactory2().property("attribute1"),
CommonFactoryFinder.getFilterFactory2().literal("literal2"));
p.setGeometry(expression);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
String result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.str("geometry");
assertThat(result, equalTo("literal0${attribute1}literal2"));
}
本文整理了Java中org.geotools.ysld.Ysld.encode()方法的一些代码示例,展示了Ysld.encode()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.geotools.ysld.Ysld.validate()方法的一些代码示例,展示了Ysld.validate()的具体用法。这些代码示例主要来源于Github/Stack
本文整理了Java中org.geotools.ysld.Ysld.parse()方法的一些代码示例,展示了Ysld.parse()的具体用法。这些代码示例主要来源于Github/Stackoverfl
本文整理了Java中org.geotools.ysld.Ysld类的一些代码示例,展示了Ysld类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些
本文整理了Java中org.geotools.ysld.YamlSeq类的一些代码示例,展示了YamlSeq类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平
本文整理了Java中org.geotools.ysld.YamlUtil类的一些代码示例,展示了YamlUtil类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven
本文整理了Java中org.geoserver.ysld.YsldHandler类的一些代码示例,展示了YsldHandler类的具体用法。这些代码示例主要来源于Github/Stackoverflo
本文整理了Java中org.geotools.ysld.encode.YsldEncoder类的一些代码示例,展示了YsldEncoder类的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中org.geotools.ysld.parse.YsldParser类的一些代码示例,展示了YsldParser类的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.geotools.ysld.parse.YamlParseContext类的一些代码示例,展示了YamlParseContext类的具体用法。这些代码示例主要来源于Gith
本文整理了Java中org.geotools.ysld.parse.ZoomContext类的一些代码示例,展示了ZoomContext类的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中org.geotools.ysld.parse.ZoomContextFinder类的一些代码示例,展示了ZoomContextFinder类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.geotools.ysld.YamlSeq.raw()方法的一些代码示例,展示了YamlSeq.raw()的具体用法。这些代码示例主要来源于Github/Stackover
我正在尝试在地理服务器中使用 CSS 样式来设置点图层的样式。 Geoserver 版本 2.11.3 从 tomcat:8-jre8 docker 容器构建(从这个 repo fork :https
本文整理了Java中org.geotools.ysld.encode.YsldEncoder.()方法的一些代码示例,展示了YsldEncoder.()的具体用法。这些代码示例主要来源于Github/
本文整理了Java中org.geotools.ysld.encode.YsldEncoder.encode()方法的一些代码示例,展示了YsldEncoder.encode()的具体用法。这些代码示例
本文整理了Java中org.geotools.ysld.parse.YamlParseContext.()方法的一些代码示例,展示了YamlParseContext.()的具体用法。这些代码示例主要来
本文整理了Java中org.geotools.ysld.parse.YamlParseContext.setDocHint()方法的一些代码示例,展示了YamlParseContext.setDocH
本文整理了Java中org.geotools.ysld.parse.YamlParseContext.getDocHint()方法的一些代码示例,展示了YamlParseContext.getDocH
本文整理了Java中org.geotools.ysld.parse.YamlParseContext.push()方法的一些代码示例,展示了YamlParseContext.push()的具体用法。这
我是一名优秀的程序员,十分优秀!