gpt4 book ai didi

org.geotools.ysld.encode.YsldEncoder.encode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 09:09:31 28 4
gpt4 key购买 nike

本文整理了Java中org.geotools.ysld.encode.YsldEncoder.encode()方法的一些代码示例,展示了YsldEncoder.encode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YsldEncoder.encode()方法的具体详情如下:
包路径:org.geotools.ysld.encode.YsldEncoder
类名称:YsldEncoder
方法名:encode

YsldEncoder.encode介绍

[英]Encode the passed StyledLayerDescriptor as YSLD.
[中]将传递的StyledLayerDescriptor编码为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, UomMapper uomMapper)
    throws IOException {
  YsldEncoder e = new YsldEncoder(writer(output), uomMapper);
  e.encode(sld);
}

代码示例来源:origin: geotools/geotools

YamlMap encode(String dirname, String filename) throws Exception {
    SLDParser sldParser = new SLDParser(CommonFactoryFinder.getStyleFactory());
    sldParser.setInput(YsldTests.sld(dirname, filename));

    StyledLayerDescriptor sld = sldParser.parseSLD();

    StringWriter w = new StringWriter();
    YsldEncoder ysldEncoder = new YsldEncoder(w, new UomMapper());
    ysldEncoder.encode(sld);

    // System.out.println(w.toString());
    return new YamlMap(YamlUtil.getSafeYaml().load(new StringReader(w.toString())));
  }
}

代码示例来源:origin: org.geotools/gt-ysld

/**
 * 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, UomMapper uomMapper)
    throws IOException {
  YsldEncoder e = new YsldEncoder(writer(output), uomMapper);
  e.encode(sld);
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com