• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WMSCapabilities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gov.nasa.worldwind.ogc.wms.WMSCapabilities的典型用法代码示例。如果您正苦于以下问题:Java WMSCapabilities类的具体用法?Java WMSCapabilities怎么用?Java WMSCapabilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WMSCapabilities类属于gov.nasa.worldwind.ogc.wms包,在下文中一共展示了WMSCapabilities类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createLayerInfo

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
protected LayerInfo createLayerInfo(WMSCapabilities caps, WMSLayerCapabilities layerCaps, WMSLayerStyle style)
{
    // Create the layer info specified by the layer's capabilities entry and the selected style.

    LayerInfo linfo = new LayerInfo();
    linfo.caps = caps;
    linfo.params = new AVListImpl();
    linfo.params.setValue(AVKey.LAYER_NAMES, layerCaps.getName());
    if (style != null)
        linfo.params.setValue(AVKey.STYLE_NAMES, style.getName());
    String abs = layerCaps.getLayerAbstract();
    if (!WWUtil.isEmpty(abs))
        linfo.params.setValue(AVKey.LAYER_ABSTRACT, abs);

    linfo.params.setValue(AVKey.DISPLAY_NAME, makeTitle(caps, linfo));

    return linfo;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:19,代码来源:WMSLayersPanel.java


示例2: createComponent

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
protected static Object createComponent(WMSCapabilities caps, AVList params)
{
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try
    {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, params);
    }
    catch (Exception e)
    {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:23,代码来源:WMSLayersPanel.java


示例3: getFactoryKeyForCapabilities

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
protected static String getFactoryKeyForCapabilities(WMSCapabilities caps)
{
    boolean hasApplicationBilFormat = false;

    Set<String> formats = caps.getImageFormats();
    for (String s : formats)
    {
        if (s.contains("application/bil"))
        {
            hasApplicationBilFormat = true;
            break;
        }
    }

    return hasApplicationBilFormat ? AVKey.ELEVATION_MODEL_FACTORY : AVKey.LAYER_FACTORY;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:17,代码来源:WMSLayersPanel.java


示例4: createComponent

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
private Object createComponent(WMSCapabilities caps, AVList params) {
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, configParams);
    } catch (Exception e) {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:WmsHandler.java


示例5: createLayerInfo

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
private LayerInfo createLayerInfo(WMSCapabilities caps, WMSLayerCapabilities layerCaps, WMSLayerStyle style) {
    // Create the layer info specified by the layer's capabilities entry and the selected style.

    LayerInfo linfo = new LayerInfo();
    linfo.caps = caps;
    linfo.params = new AVListImpl();
    linfo.params.setValue(AVKey.LAYER_NAMES, layerCaps.getName());
    if (style != null)
        linfo.params.setValue(AVKey.STYLE_NAMES, style.getName());
    String abs = layerCaps.getLayerAbstract();
    if (!WWUtil.isEmpty(abs))
        linfo.params.setValue(AVKey.LAYER_ABSTRACT, abs);

    linfo.params.setValue(AVKey.DISPLAY_NAME, makeTitle(caps, linfo));

    return linfo;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:18,代码来源:WmsHandler.java


示例6: makeTitle

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
protected static String makeTitle(WMSCapabilities caps, LayerInfo layerInfo)
{
    String layerNames = layerInfo.params.getStringValue(AVKey.LAYER_NAMES);
    String styleNames = layerInfo.params.getStringValue(AVKey.STYLE_NAMES);
    String[] lNames = layerNames.split(",");
    String[] sNames = styleNames != null ? styleNames.split(",") : null;

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < lNames.length; i++)
    {
        if (sb.length() > 0)
            sb.append(", ");

        String layerName = lNames[i];
        WMSLayerCapabilities lc = caps.getLayerByName(layerName);
        String layerTitle = lc.getTitle();
        sb.append(layerTitle != null ? layerTitle : layerName);

        if (sNames == null || sNames.length <= i)
            continue;

        String styleName = sNames[i];
        WMSLayerStyle style = lc.getStyleByName(styleName);
        if (style == null)
            continue;

        sb.append(" : ");
        String styleTitle = style.getTitle();
        sb.append(styleTitle != null ? styleTitle : styleName);
    }

    return sb.toString();
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:34,代码来源:WMSLayersPanel.java


示例7: getFactoryKeyForCapabilities

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
private String getFactoryKeyForCapabilities(WMSCapabilities caps) {
    boolean hasApplicationBilFormat = false;

    Set<String> formats = caps.getImageFormats();
    for (String s : formats) {
        if (s.contains("application/bil")) {
            hasApplicationBilFormat = true;
            break;
        }
    }

    return hasApplicationBilFormat ? AVKey.ELEVATION_MODEL_FACTORY : AVKey.LAYER_FACTORY;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:14,代码来源:WmsHandler.java


示例8: makeTitle

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
private String makeTitle(WMSCapabilities caps, LayerInfo layerInfo) {
    String layerNames = layerInfo.params.getStringValue(AVKey.LAYER_NAMES);
    String styleNames = layerInfo.params.getStringValue(AVKey.STYLE_NAMES);
    String[] lNames = layerNames.split(",");
    String[] sNames = styleNames != null ? styleNames.split(",") : null;

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < lNames.length; i++) {
        if (sb.length() > 0)
            sb.append(", ");

        String layerName = lNames[i];
        WMSLayerCapabilities lc = caps.getLayerByName(layerName);
        String layerTitle = lc.getTitle();
        sb.append(layerTitle != null ? layerTitle : layerName);

        if (sNames == null || sNames.length <= i)
            continue;

        String styleName = sNames[i];
        WMSLayerStyle style = lc.getStyleByName(styleName);
        if (style == null)
            continue;

        sb.append(" : ");
        String styleTitle = style.getTitle();
        sb.append(styleTitle != null ? styleTitle : styleName);
    }

    return sb.toString();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:32,代码来源:WmsHandler.java


示例9: importElevations

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
protected void importElevations()
        {
            try
            {
                // Parse the capabilities document from the WMS
                final String GET_CAPABILITIES_URL = "http://localhost:8080/geoserver/wms?request=getCapabilities";
                WMSCapabilities caps = WMSCapabilities.retrieve(new URI(GET_CAPABILITIES_URL));
                caps.parse();

                // Configure parameters for the Spearfish elevation model.
                AVList params = new AVListImpl();
                params.setValue(AVKey.LAYER_NAMES, "sf:sfdem");           // Layer name configured in GeoServer
                params.setValue(AVKey.IMAGE_FORMAT, "application/bil32"); // Data format to request
                params.setValue(AVKey.BYTE_ORDER, AVKey.BIG_ENDIAN);      // Byte order of BIL files returned by server
                params.setValue(AVKey.MISSING_DATA_SIGNAL, -9.999999933815813E36); // Missing data flag

                Factory factory = (Factory) WorldWind.createConfigurationComponent(AVKey.ELEVATION_MODEL_FACTORY);
                final ElevationModel spearfish = (ElevationModel) factory.createFromConfigSource(caps, params);

                SwingUtilities.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        // Get the WorldWindow's current elevation model.
                        Globe globe = AppFrame.this.getWwd().getModel().getGlobe();

                        // Replace elevation model with imported elevations. This makes the elevation 0 everywhere
                        // except in the region imported, so it is easy to tell that the elevations are being pulled
                        // from GeoServer. For production use create a CompoundElevationModel and add the new elevations
                        // to the compound model.
                        globe.setElevationModel(spearfish);

                        // Example of how to add the elevation model to a CompoundElevationModel
//                        if (currentElevationModel instanceof CompoundElevationModel)
//                            ((CompoundElevationModel) currentElevationModel).addElevationModel(elevationModel);
//                        else
//                            globe.setElevationModel(elevationModel);


                        // Set the view to look at the imported elevations.
                        Position spearfishSouthDakota = Position.fromDegrees(44.4709, -103.6812, 10000);
                        getWwd().getView().setEyePosition(spearfishSouthDakota);
                    }
                });
            } catch (Exception e)
            {
                e.printStackTrace();
            }
        }
 
开发者ID:parkerabercrombie,项目名称:worldwind-examples,代码行数:50,代码来源:GeoserverElevations.java


示例10: makeElevationModel

import gov.nasa.worldwind.ogc.wms.WMSCapabilities; //导入依赖的package包/类
private static ElevationModel makeElevationModel() throws URISyntaxException, ParserConfigurationException,
        IOException, SAXException {
    final URI serverURI = new URI("http://www.nasa.network.com/elev");

    final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    docBuilderFactory.setNamespaceAware(true);
    if (Configuration.getJavaVersion() >= 1.6) {
        try {
            docBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        } catch (ParserConfigurationException e) {   // Note it and continue on. Some Java5 parsers don't support the feature.
            String message = Logging.getMessage("XML.NonvalidatingNotSupported");
            Logging.logger().finest(message);
        }
    }
    final DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

    // Request the capabilities document from the server.
    final CapabilitiesRequest req = new CapabilitiesRequest(serverURI);
    final Document doc = docBuilder.parse(req.toString());

    // Parse the DOM as a capabilities document.
    // CHANGED
    //final Capabilities caps = Capabilities.parse(doc);
    final WMSCapabilities caps = new WMSCapabilities(doc);

    final double HEIGHT_OF_MT_EVEREST = 8850d; // meters
    final double DEPTH_OF_MARIANAS_TRENCH = -11000d; // meters

    // Set up and instantiate the elevation model
    final AVList params = new AVListImpl();
    params.setValue(AVKey.LAYER_NAMES, "|srtm3");
    params.setValue(AVKey.TILE_WIDTH, 150);
    params.setValue(AVKey.TILE_HEIGHT, 150);
    params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, LatLon.fromDegrees(20, 20));
    params.setValue(AVKey.NUM_LEVELS, 8);
    params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
    params.setValue(AVKey.ELEVATION_MIN, DEPTH_OF_MARIANAS_TRENCH);
    params.setValue(AVKey.ELEVATION_MAX, HEIGHT_OF_MT_EVEREST);

    final CompoundElevationModel cem = new CompoundElevationModel();
    cem.addElevationModel(new WMSBasicElevationModel(caps, params));

    return cem;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:45,代码来源:AppPanel.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClientExecChain类代码示例发布时间:2022-05-23
下一篇:
Java LegendPosition类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap