【问题标题】:I want to get data from my own server instead of nasa servers in java worldwind我想从我自己的服务器而不是 java worldwind 中的 nasa 服务器获取数据
【发布时间】:2021-11-06 01:49:48
【问题描述】:

在 worldwind java 项目中,我在 layer.xml 文件中编写了自己的 localhost 服务器链接,而不是 nasa 服务器链接。但该项目仍继续从美国宇航局提取数据。我应该怎么做才能从我自己的站点中提取数据?

我编辑的xml文件的代码:

<Layer version="1" layerType="TiledImageLayer">
    <DisplayName>Blue Marble (WMS) 2004</DisplayName>
    <Service serviceName="OGC:WMS" version="1.3">
        <GetCapabilitiesURL>http://localhost:8080/geoserver/www/explorer/index.html</GetCapabilitiesURL>
        <GetMapURL>http://localhost:8080/geoserver/www/explorer/index.html</GetMapURL>
        <LayerNames>bmng200405</LayerNames>
    </Service>
    <RetrievePropertiesFromService>true</RetrievePropertiesFromService>
    <!-- day month year hours:minutes:seconds timezone -->
    <LastUpdate>26 03 2009 00:00:00 GMT</LastUpdate>
    <DataCacheName>Earth/BMNGWMS/BMNG(Shaded + Bathymetry) Tiled - Version 1.1 - 5.2004</DataCacheName>
    <ImageFormat>image/dds</ImageFormat>
    <AvailableImageFormats>
        <ImageFormat>image/png</ImageFormat>
        <ImageFormat>image/dds</ImageFormat>
    </AvailableImageFormats>
    <FormatSuffix>.dds</FormatSuffix>
    <NumLevels count="5" numEmpty="0"/>
    <TileOrigin>
        <LatLon units="degrees" latitude="-90" longitude="-180"/>
    </TileOrigin>
    <LevelZeroTileDelta>
        <LatLon units="degrees" latitude="36" longitude="36"/>
    </LevelZeroTileDelta>
    <TileSize>
        <Dimension width="512" height="512"/>
    </TileSize>
    <Sector>
        <SouthWest>
            <LatLon units="degrees" latitude="-90" longitude="-180"/>
        </SouthWest>
        <NorthEast>
            <LatLon units="degrees" latitude="90" longitude="180"/>
        </NorthEast>
    </Sector>
    <ForceLevelZeroLoads>true</ForceLevelZeroLoads>
    <RetainLevelZeroTiles>true</RetainLevelZeroTiles>
    <UseTransparentTextures>false</UseTransparentTextures>
    <RetrievalTimeouts>
        <ReadTimeout>
            <Time units="milliseconds" value="30000"/>
        </ReadTimeout>
    </RetrievalTimeouts>
    <!-- The following lines are included just to show how to set the values to other than their defaults -->
    <MaxAbsentTileAttempts>2</MaxAbsentTileAttempts>
    <MinAbsentTileCheckInterval>1000</MinAbsentTileCheckInterval>
</Layer>

我在运行项目时仍然看到超时错误,试图从 NASA 的站点提取数据。

Sep 09, 2021 2:44:50 PM gov.nasa.worldwind.util.SessionCacheRetrievalPostProcessor run
SEVERE: Retrieval failed for https://worldwind26.arc.nasa.gov/elev?EXCEPTIONS=application/vnd.ogc.se_xml&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0
Sep 09, 2021 2:44:50 PM gov.nasa.worldwind.util.SessionCacheUtils retrieveSessionData
SEVERE: Exception while retrieving resources for https://worldwind26.arc.nasa.gov/elev?EXCEPTIONS=application/vnd.ogc.se_xml&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0
java.net.SocketTimeoutException: Read timed out

【问题讨论】:

  • 在无法访问代码之前,我们无法确定实际原因
  • 我编辑了主题

标签: java worldwind


【解决方案1】:

首先,确保你正在加载你想要的配置文件(可能有一个 worldwind.jar 所以要明确):

System.setProperty("gov.nasa.worldwind.config.file","path/to/worldwind.xml");

然后清除 WorldWind 下载缓存,以防万一。

Configuration Documentation Here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-09
    • 1970-01-01
    相关资源
    最近更新 更多