搭建world wind WMS server(For world wind c# with LandSAT&SRTM30)之server配置

参考资料

How to install NASA World Wind WMS serverhttp://forum.worldwindcentral.com/showthread.php?t=24183

How to configure SRTM elevations in WorldWind WMS:

http://forum.worldwindcentral.com/showthread.php?t=21856

SRTM 30 on NASA WW WMS server and bathmetry datahttp://forum.worldwindcentral.com/showthread.php?p=83270#post83270

server配置

1.  安装GDAL

下载http://download.osgeo.org/gdal/win32/1.6/gdalwin32exe160.zip,并解压至本地。

 

2.  下载NASA WMS Server

http://builds.worldwind.arc.nasa.gov/download_server.asp下载WMS Server。经测试worldwind-wms-0.6.14.12976.zip的版本可以很好的支持landsatsrtm,最新版(worldwind-wms-0.6.17.13403.zip)处理srtm有问题。

 

3.  下载并解压数据

LandSAT: http://worldwind28.arc.nasa.gov/public/BMNG-cache/landsat.tile.cache/

SRTM30: http://worldwind28.arc.nasa.gov/public/WorldWindWMS/srtm30.7z或另外四个包。
本地文件目录结构如下:
注意对于landsat,请把esta.xml放在根目录,不要放在每个单独的目录中。
 

4.  配置wms server

配置worldwind-wms-0.6.14.12976/WEB-INF/config.xml

l  <port>@PORT@</port>

l  <online-resource>@HOSTNAME@:@PORT@/wms?</online-resource>

l  <redirect>http://@HOSTNAME@:@PORT@/wms?SERVICE=WMS&amp;REQUEST=GetCapabilit ies</redirect>

l  <gdal-path>@GDALPATH@</gdal-path>

l  <work-directory>@TEMPDIR@</work-directory>

l  <mapsource>< /mapsource> srtm添加在这里

 

配置好的config.xml文件内容如下

<wms-config>

    <server>

        <!-- port number on which the server listens for WMS requests -->

        <port>8085</port>

        <!-- externally visible hostname and port;

 

        The value of the <online-resource> will be reported in the Capabilities XML document.

 

        Note! port in the <online-resource> could be different from the listenning port

        if you have some kind of caching (like squid) solution that intercepts incomming requests

        (port 81, for example) and forwards WMS requests to the WMS server (on port 8085, for example).

        In case like this, settings should be next:

        <port>8085</port>

        <online-resource>http://MyWmsServer.com:81/wms?</online-resource>

        -->

        <online-resource>http://10.11.5.23:8085/wms?</online-resource>

 

        <!-- Redirect allows you to specify where you want to redirect when some one simply

        types your WMS server URL in the browser, like http://localhost:8080/

       <redirect>http://www.nasa.network.com/wms?SERVICE=WMS&amp;REQUEST=GetCapabilities</redirect>

        -->

        <redirect>http://10.11.5.23:8085/wms?SERVICE=WMS&amp;REQUEST=GetCapabilities</redirect>

 

        <!-- size of the thread pool; i.e., the maximum number of active request threads.

             Requests in excess of this number are queued.

        -->

        <thread-pool-size>8</thread-pool-size>

 

        <!-- Enable Auto-Discovery and Zero-Configuration,

        period specifies a number of seconds to re-run the Auto-Discovery (on the fly add or removal).

        The Auto-Discovery looks in all directories specified in the WEB-INF/DataFileStore.xml file.

        This example will run the AutoDiscovery taks only once

        <auto-discovery run="true" period="0"/>

        -->

        <auto-discovery run="true" period="0"/>

 

 

        <!-- GDAL config: Need path to executables and path to work/temp directory

             Note that these are optional; warning messages will be printed to the logs

             if absent, but the server will continue to run. However, any

             MapGenerator that requires GDAL will not function properly without proper

             configuration here.

        -->

        <gdal-path>C:/gdalwin32-1.6/bin</gdal-path>

        <work-directory>D:/worldwind-wms/Temp</work-directory>

 

    </server>

 

 

    <security>

        <!-- max = maxim hits, period in seconds -->

        <policy name="default" max="1000" period="86400"/>

        <policy name="unlimited" max="1000000" period="3600"/>

        <policy name="block" max="0" period="86400"/>

 

        <access policy="unlimited" range="10.0.0.1-10.0.0.124"/>

        <access policy="unlimited" ip="127.0.0.1"/>

 

        <access policy="block" ip="188.92.76.208"/>

        <access policy="block" range="188.92.76.0-188.92.76.255"/>

 

        <!-- The last line usually defines a default behavior:

 

        allow default access to all other,

            <access access="default" domain="any" />

        or block all others

            <access access="block" domain="any" />

        -->

        <access policy="default" domain="any"/>

    </security>

 

    <!-- MapSource descriptors  -->

 

    <!-- A MapSource must have the name & title attributes, along with the <root-dir> element

       - that describes where the map data are located, and the <class> element which names the

       - Java "MapGenerator" class that reads and generates responses to requests for the data.

       - Each MapGenerator may expect one or more properties that are further configuration points

       - unique to that class.  Finally, note that the name/title attributes, along with the optional

       - <description> element are directly reflected in the WMS's GetCapabilities response; i.e., these

       - may be forward-facing text strings.

       -

       - An example MapSource descriptor:

 

    <mapsource name="1mCIB" title="1m. CIBs">

        <description keywords="RFP;CIB">1m. Controlled Image Base (CIB)</description>

        <root-dir>/usr/local/mapdata/rpf/CIB/1meter</root-dir>

        <class>gov.nasa.worldwind.servers.wms.generators.RPFGenerator</class>

        <property name="wavelet_preload_size" value="32" />

        <property name="wavelet_image_threshold" value="128" />

    </mapsource>

 

 

       -

       - See the javadoc for individual MapGenerator implementations for the set of

       - properties recognized by that MapGenerator.

       -

 

    -->

  <mapsource name="srtm30" title="SRTM30 Plus">

    <description keywords="srtm30 Elevation">srtm30 Elevation Data</description>

    <root-dir>d:/worldwind-wms/data/srtm30</root-dir>

    <class>gov.nasa.worldwind.servers.wms.generators.ElevationSrtm30</class>

    <property name="gov.nasa.worldwind.avkey.MissingDataFlag" value="-9999" />

    <scale-hint min="1.0" max="0.008333330"/>

    <property name="gov.nasa.worldwind.avkey.LastUpdateKey" value="2009-10-06 14:40:00"/>

  </mapsource>

</wms-config>

 

配置worldwind-wms-0.6.14.12976/WEB-INF/DataFileStore.xml

server查找DataFileStore.xml中指定的目录,自动识别、添加layer。你需要在这个文件里面添加自己的数据路径<location property="" wwDir="your data folder path"/>landsat在这里添加

配置好的DataFileStore.xml文件内容如下:

<?xml version="1.0"?>

<!-- World Wind data-file store configuration -->

<!--$Id: DataFileStore.xml 8863 2009-02-15 01:31:50Z tgaskins $-->

<dataFileStore>

    <readLocations>

        <!-- The read locations are searched, in the given order, when World Wind needs a data or image file. -->

        <!-- The write location selected from the writeLocations list is searched before these locations. -->

        <location property="gov.nasa.worldwind.platform.alluser.store" wwDir="WorldWindData"/>

        <location property="gov.nasa.worldwind.platform.user.store"    wwDir="WorldWindData"/>

        <location property="user.dir"  wwDir="WorldWindData"/>

        <location property="user.home" wwDir="WorldWindData"/>

        <!-- The standard install locations are searched after the standard read locations. -->

        <location property="gov.nasa.worldwind.platform.alluser.store" wwDir="WorldWindInstalled" isInstall="true" isMarkWhenUsed="true"/>

        <location property="gov.nasa.worldwind.platform.user.store"    wwDir="WorldWindInstalled" isInstall="true" isMarkWhenUsed="true"/>

        <location property="user.dir"  wwDir="WorldWindInstalled" isInstall="true" isMarkWhenUsed="true"/>

        <location property="user.home" wwDir="WorldWindInstalled" isInstall="true" isMarkWhenUsed="true"/>

        <location property="" wwDir="d:/worldwind-wms/data"/>

    </readLocations>

    <writeLocations>

        <!-- The first writable location in this list is used as the session's data and image file store. -->

        <!-- If a location does not exist and the create attribute is "true", an attempt is made to create it.-->

        <!-- If that creation attempt succeeds, the location becomes the first writable location and thus is used. -->

        <!-- Only the first location that's writable or creatable is used. Subsequent locations are ignored. -->

        <!-- The chosen writable location is also the first search location, searched prior to any readLocations. -->

        <location property="gov.nasa.worldwind.platform.alluser.store" wwDir="WorldWindData" create="true"/>

        <location property="gov.nasa.worldwind.platform.user.store"    wwDir="WorldWindData" create="true"/>

        <location property="java.io.tmpdir" wwDir="WorldWindData" create="true"/>

        <location property="" wwDir="d:/worldwind-wms/data"/>

    </writeLocations>

</dataFileStore>

 

5. 启动server

运行startWMS.bat启动wms server

 

6. 测试server

查询server的影像数据层
http://your-wms-server:port/wms?REQUEST=GetCapabilities
查询server的高程数据层http://your-wms-server:port/elev?REQUEST=GetCapabilities

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章