当前位置: 首页>>代码示例>>Java>>正文


Java OnLineResourceImpl类代码示例

本文整理汇总了Java中org.geotools.metadata.iso.citation.OnLineResourceImpl的典型用法代码示例。如果您正苦于以下问题:Java OnLineResourceImpl类的具体用法?Java OnLineResourceImpl怎么用?Java OnLineResourceImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnLineResourceImpl类属于org.geotools.metadata.iso.citation包,在下文中一共展示了OnLineResourceImpl类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: styleFactoryExample

import org.geotools.metadata.iso.citation.OnLineResourceImpl; //导入依赖的package包/类
/**
 * This example is limited to just the gt-opengis style interfaces which are immutable once created.
 * 
 * @throws Exception
 */
private void styleFactoryExample() throws Exception {
    // styleFactoryExample start
    //
    org.opengis.style.StyleFactory sf = CommonFactoryFinder.getStyleFactory();
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    
    //
    // create the graphical mark used to represent a city
    Stroke stroke = sf.stroke(ff.literal("#000000"), null, null, null, null, null, null);
    Fill fill = sf.fill(null, ff.literal(Color.BLUE), ff.literal(1.0));
    
    // OnLineResource implemented by gt-metadata - so no factory!
    OnLineResourceImpl svg = new OnLineResourceImpl(new URI("file:city.svg"));
    svg.freeze(); // freeze to prevent modification at runtime
    
    OnLineResourceImpl png = new OnLineResourceImpl(new URI("file:city.png"));
    png.freeze(); // freeze to prevent modification at runtime
    
    //
    // List of symbols is considered in order with the rendering engine choosing
    // the first one it can handle. Allowing for svg, png, mark order
    List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
    symbols.add(sf.externalGraphic(svg, "svg", null)); // svg preferred
    symbols.add(sf.externalGraphic(png, "png", null)); // png preferred
    symbols.add(sf.mark(ff.literal("circle"), fill, stroke)); // simple circle backup plan
    
    Expression opacity = null; // use default
    Expression size = ff.literal(10);
    Expression rotation = null; // use default
    AnchorPoint anchor = null; // use default
    Displacement displacement = null; // use default
    
    // define a point symbolizer of a small circle
    Graphic circle = sf.graphic(symbols, opacity, size, rotation, anchor, displacement);
    PointSymbolizer pointSymbolizer = sf.pointSymbolizer("point", ff.property("the_geom"), null,
            null, circle);
    // styleFactoryExample end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:44,代码来源:StyleExamples.java


注:本文中的org.geotools.metadata.iso.citation.OnLineResourceImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。