搭建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

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