org.geoserver.ysld.YsldHandler类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(51)

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

YsldHandler介绍

暂无

代码示例

代码示例来源:origin: org.geoserver.community/gs-ysld

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List<Exception> validate(Object input, Version version, EntityResolver entityResolver) throws IOException {
  return (List) Ysld.validate(toReader(input), Collections.singletonList(zoomFinder), uomMapper);
}

代码示例来源:origin: org.geoserver.community/gs-ysld

@Test
public void testRelativePathWithDefaultResourceLocator() throws Exception {
  YsldHandler handler = new YsldHandler();
  StyledLayerDescriptor sld = handler.parse(file, null, null, null);

代码示例来源:origin: org.geoserver.community/gs-ysld

final YsldHandler handler = new YsldHandler();
ResourcePool rp = createNiceMock(ResourcePool.class);
rp.writeStyle((StyleInfo) anyObject(), (InputStream) anyObject());

代码示例来源:origin: org.geoserver.community/gs-ysld

@Override
  public Void answer() throws Throwable {
    Object[] args = getCurrentArguments();
    InputStream is = (InputStream) args[1];
    StyledLayerDescriptor sld = handler.parse(is, null, null, null);
    assertEquals(1, sld.getStyledLayers().length);
    NamedLayer nl = (NamedLayer) sld.getStyledLayers()[0];
    assertEquals(1, nl.getStyles().length);
    Style style = nl.getStyles()[0];
    assertEquals(1, style.featureTypeStyles().size());
    FeatureTypeStyle fts = style.featureTypeStyles().get(0);
    assertEquals(4, fts.rules().size());
    assertEquals("raster", fts.rules().get(0).getDescription().getTitle().toString());
    assertEquals("orange polygon",
        fts.rules().get(1).getDescription().getTitle().toString());
    assertEquals("orange line",
        fts.rules().get(2).getDescription().getTitle().toString());
    assertEquals("orange point",
        fts.rules().get(3).getDescription().getTitle().toString());
    for (org.geotools.styling.Rule r : fts.rules()) {
      assertEquals(1, r.getSymbolizers().length);
    }
    return null;
  }
});

代码示例来源:origin: org.geoserver.community/gs-ysld

@Override
public StyledLayerDescriptor parse(Object input, Version version, @Nullable ResourceLocator resourceLocator,
  EntityResolver entityResolver) throws IOException {
  
  if (resourceLocator == null && input instanceof File) {
    resourceLocator = new DefaultResourceLocator();
    ((DefaultResourceLocator)resourceLocator).setSourceUrl(DataUtilities.fileToURL((File) input));
  }
  
  return Ysld.parse(toReader(input), Collections.singletonList(zoomFinder), resourceLocator, uomMapper);
}

相关文章