本文整理了Java中org.geoserver.ysld.YsldHandler
类的一些代码示例,展示了YsldHandler
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YsldHandler
类的具体详情如下:
包路径:org.geoserver.ysld.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);
}
内容来源于网络,如有侵权,请联系作者删除!