首页 > 解决方案 > Repast 在示例文件中不显示背景地图

问题描述

我是 Repast 的新手,并且有兴趣最终在北极创建一个海上交通模拟。我正在浏览“Import Repast Examples”,我浏览的所有模型都没有在模拟显示中显示地图。例如,Geotracks 演示的这张照片显示蓝色大理石地图显然没有加载。缺少背景图

在地理演示中,可以看到芝加哥的小缩略图,但看不到周围的地图。就餐地理演示

我找不到任何文档来解决这个问题。当我进入 GIS 显示设置时,文件似乎已启用,所以我不知道还有什么可以解决的。 显示选项

这是我收到的控制台错误的图片。 在此处输入图像描述

我使用 Windows 的默认安装设置安装了 Repast。

标签: gissimulationrepast-simphony

解决方案


我能够复制这个问题。背景地图图层由 NASA WorldWind 服务提供,服务器似乎有时很慢或没有响应。此数据由第三方提供,而 Repast 团队无法直接控制提供背景地图图层。他们的一位开发人员在这里发布了一个解决方案:https ://github.com/NASAWorldWind/WorldWindJava/issues/219 ,他们在其中描述了如何改进一些 WorldWind 网络属性以帮助处理慢速服务器,并且我已经测试过这确实有效。

您需要将以下内容复制到项目中名为“worldwind.xml”的文件中:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2006-2009, 2017, 2020 United States Government, as represented by the
  ~ Administrator of the National Aeronautics and Space Administration.
  ~ All rights reserved.
  ~ 
  ~ The NASA World Wind Java (WWJ) platform is licensed under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~ 
  ~ Unless required by applicable law or agreed to in writing, software distributed
  ~ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  ~ CONDITIONS OF ANY KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations under the License.
  ~ 
  ~ NASA World Wind Java (WWJ) also contains the following 3rd party Open Source
  ~ software:
  ~ 
  ~     Jackson Parser – Licensed under Apache 2.0
  ~     GDAL – Licensed under MIT
  ~     JOGL – Licensed under  Berkeley Software Distribution (BSD)
  ~     Gluegen – Licensed under Berkeley Software Distribution (BSD)
  ~ 
  ~ A complete listing of 3rd Party software notices and licenses included in
  ~ NASA World Wind Java (WWJ)  can be found in the WorldWindJava-v2.2 3rd-party
  ~ notices and licenses PDF found in code directory.
  -->

<!--$Id: worldwind.xml 2348 2014-09-25 23:35:46Z dcollins $-->
<!--Default WorldWind configuration values-->
<!--Any of these can be overridden by specifying an application configuration document-->
<!--An alternate document to this one can also be specified-->
<!--See the javadoc for the Configuration class for details-->
<WorldWindConfiguration version="1">
    <!--The initial layer list can be embedded here or linked as below. To change the set of initial layers,-->
    <!--modify the file identified by the href or replace the link with your own-->
    <LayerList href="config/worldwind.layers.xml"/>
    <!--Most configuration information is defined in attribute-value pairs-->
    <Property name="gov.nasa.worldwind.avkey.ModelClassName" value="gov.nasa.worldwind.BasicModel"/>
    <Property name="gov.nasa.worldwind.avkey.GlobeClassName"
              value="gov.nasa.worldwind.globes.Earth"/>
    <Property name="gov.nasa.worldwind.avkey.EarthElevationModelConfigFile"
              value="config/Earth/EarthElevations2.xml"/>
    <Property name="gov.nasa.worldwind.globes.GeographicProjectionClassName"
              value="gov.nasa.worldwind.globes.projections.ProjectionEquirectangular"/>
    <Property name="gov.nasa.worldwind.avkey.InitialLatitude" value="38"/>
    <Property name="gov.nasa.worldwind.avkey.InitialAltitude" value="19.07e6"/>
    <Property name="gov.nasa.worldwind.avkey.ViewClassName" value="gov.nasa.worldwind.view.orbit.BasicOrbitView"/>
    <Property name="gov.nasa.worldwind.avkey.ViewInputHandlerClassName"
              value="gov.nasa.worldwind.view.orbit.OrbitViewInputHandler"/>
    <Property name="gov.nasa.worldwind.avkey.InputHandlerClassName" value="gov.nasa.worldwind.awt.AWTInputHandler"/>
    <Property name="gov.nasa.worldwind.avkey.LoggerName" value="gov.nasa.worldwind"/>
    <Property name="gov.nasa.worldwind.avkey.WorldWindowClassName"
              value="gov.nasa.worldwind.WorldWindowGLAutoDrawable"/>
    <Property name="gov.nasa.worldwind.avkey.ElevationModelFactory"
              value="gov.nasa.worldwind.terrain.BasicElevationModelFactory"/>
    <Property name="gov.nasa.worldwind.avkey.LayerFactory" value="gov.nasa.worldwind.layers.BasicLayerFactory"/>
    <Property name="gov.nasa.worldwind.avkey.ShapefileLayerFactory"
              value="gov.nasa.worldwind.formats.shapefile.ShapefileLayerFactory"/>
    <Property name="gov.nasa.worldwind.avkey.WebViewFactory"
              value="gov.nasa.worldwind.util.webview.BasicWebViewFactory"/>
    <Property name="gov.nasa.worldwind.avkey.TessellatorClassName"
              value="gov.nasa.worldwind.terrain.RectangularTessellator"/>
    <Property name="gov.nasa.worldwind.avkey.MemoryCacheSetClassName"
              value="gov.nasa.worldwind.cache.BasicMemoryCacheSet"/>
    <Property name="gov.nasa.worldwind.avkey.SessionCacheClassName" value="gov.nasa.worldwind.cache.BasicSessionCache"/>
    <Property name="gov.nasa.worldwind.avkey.RetrievalServiceClassName"
              value="gov.nasa.worldwind.retrieve.BasicRetrievalService"/>
    <Property name="gov.nasa.worldwind.avkey.SceneControllerClassName"
              value="gov.nasa.worldwind.StereoOptionSceneController"/>
    <Property name="gov.nasa.worldwind.avkey.NetworkStatusClassName"
              value="gov.nasa.worldwind.util.BasicNetworkStatus"/>
    <Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultImagePath"
              value="images/pushpins/plain-yellow.png"/>
    <Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultLabelFont"
              value="Arial-BOLD-14"/>
    <!-- The following lists the sites to test for public network access. Specify an empty string, "", for no sites.-->
    <!-- Don't specify the property at all to use the default list. -->
    <Property name="gov.nasa.worldwind.avkey.NetworkStatusTestSites"
              value="www.nasa.gov, worldwind.arc.nasa.gov, google.com, microsoft.com, yahoo.com"/>
    <Property name="gov.nasa.worldwind.avkey.TaskServiceClassName" value="gov.nasa.worldwind.util.ThreadedTaskService"/>
    <Property name="gov.nasa.worldwind.avkey.DataFileStoreClassName"
              value="gov.nasa.worldwind.cache.BasicDataFileStore"/>
    <Property name="gov.nasa.worldwind.avkey.DataRasterReaderFactoryClassName"
              value="gov.nasa.worldwind.data.BasicDataRasterReaderFactory"/>
    <Property name="gov.nasa.worldwind.avkey.DataFileStoreConfigurationFileName" value="config/DataFileStore.xml"/>
    <Property name="gov.nasa.worldwind.avkey.WorldMapImagePath" value="images/earth-map-512x256.dds"/>
    <Property name="gov.nasa.worldwind.StarsLayer.StarsFileName" value="config/Hipparcos_Stars_Mag6x5044.dat"/>
    <!--The following are tuning parameters for various WorldWind internals-->
    <Property name="gov.nasa.worldwind.avkey.RetrievalPoolSize" value="32"/>
    <Property name="gov.nasa.worldwind.avkey.RetrievalQueueSize" value="400"/>
    <Property name="gov.nasa.worldwind.avkey.RetrievalStaleRequestLimit" value="60000"/>
    <Property name="gov.nasa.worldwind.avkey.TaskPoolSize" value="32"/>
    <Property name="gov.nasa.worldwind.avkey.TaskQueueSize" value="60"/>
    <Property name="gov.nasa.worldwind.avkey.ScheduledTaskPoolSize" value="1"/>
    <Property name="gov.nasa.worldwind.avkey.VerticalExaggeration" value="1"/>
    <Property name="gov.nasa.worldwind.avkey.URLConnectTimeout" value="8000"/>
    <Property name="gov.nasa.worldwind.avkey.URLReadTimeout" value="10000"/>
    <Property name="gov.nasa.worldwind.avkey.TextureCacheSize" value="500000000"/>
    <Property name="gov.nasa.worldwind.avkey.ElevationTileCacheSize" value="20000000"/>
    <Property name="gov.nasa.worldwind.avkey.ElevationExtremesLookupCacheSize" value="20000000"/>
    <Property name="gov.nasa.worldwind.avkey.SectorGeometryCacheSize" value="10000000"/>
    <Property name="gov.nasa.worldwind.avkey.TextureTileCacheSize" value="10000000"/>
    <Property name="gov.nasa.worldwind.avkey.PlacenameLayerCacheSize" value="4000000"/>
    <Property name="gov.nasa.worldwind.avkey.AirspaceGeometryCacheSize" value="32000000"/>
    <Property name="gov.nasa.worldwind.avkey.VBOUsage" value="true"/>
    <Property name="gov.nasa.worldwind.avkey.VBOThreshold" value="30"/>
    <Property name="gov.nasa.worldwind.avkey.OfflineMode" value="false"/>
    <Property name="gov.nasa.worldwind.avkey.RectangularTessellatorMaxLevel" value="30"/>
    <Property name="gov.nasa.worldwind.StereoFocusAngle" value="1.6"/>
    <Property name="gov.nasa.worldwind.avkey.ForceRedrawOnMousePressed" value="f"/>
    <!-- Here's one way to specify proxy settings -->
    <!--<Property name="gov.nasa.worldwind.avkey.UrlProxyHost" value="100.215.10.20"/>-->
    <!--<Property name="gov.nasa.worldwind.avkey.UrlProxyPort" value="8080"/>-->
    <!--<Property name="gov.nasa.worldwind.avkey.UrlProxyType" value="Proxy.Type.Http"/>-->

    <!-- Location of icons for MIL-STD-2525C symbol set. This can be a URL to a web server, to a local zip or jar archive.
         See https://goworldwind.org/developers-guide/symbology/tactical-symbols/#offline-use for more information on how
         to configure a local symbol repository.
         Examples: http://myserver.com/milstd2525/   (web server)
                   jar:file:milstd2525-symbols.zip!  (local zip archive)  -->
    <Property name="gov.nasa.worldwind.avkey.MilStd2525IconRetrieverPath"
              value="https://worldwind.arc.nasa.gov/milstd2525c/rev1/"/>
</WorldWindConfiguration>

为了使用 Repast Geography 演示进行测试,我将 worldwind.xml 文件放在 geograph.styles 文件夹中。然后在 ContextCreator.java 中添加以下内容:

static
        {
            System.setProperty("gov.nasa.worldwind.app.config.document",
                "geography/styles/worldwind.xml");
        }

这将告诉 WorldWind 在哪里可以找到修改后的 worldwind.xml 文件。您需要对使用背景 NASA 图层的任何其他 Repast 模型重复此过程。为这个笨拙的解决方法道歉。我们将在下一个 Repast 版本中修复此问题,这样您就无需手动执行这些更改。


推荐阅读