Changes between Version 16 and Version 17 of NERCPortals

18/03/08 15:50:43 (14 years ago)



  • NERCPortals

    v16 v17  
    2626python filename.conf.xml 
    28 where {{{filename.conf.xml}}} is an XML config file, whose format is described in the section "Configuration". 
     28where {{{filename.conf.xml}}} stands for an XML config file. 
    3030The script interrogates a WMS web service using the {{{GetCapabilities}}} call and thus acquires a <wms:Capabilities> XML document from it, which contains description of WMS layers served by the WMS web service. Then, it exports this into a hierarchy of embedded directories forming a structure which contains a hierarchy of expandable KMZ documents linked together using the ''<kml:NetworkLink>'' tag, and loaded on demand. The files can then be served to the outer world via HTTP. 
     32An example format of the config file is as follows (example config files can be found in the egg's {{{csml2kml/config}}} sub-directory): 
     35  <WMSRequest> 
     36    <URL></URL> 
     37    <ServiceVersion>1.1.1</ServiceVersion> 
     38    <ImageFormat>image/png</ImageFormat> 
     39    <ImageWidth>960</ImageWidth> 
     40    <ImageHeight>480</ImageHeight> 
     41    <CRS>EPSG:4326</CRS> 
     42  </WMSRequest> 
     43  <OutputRootDirectory>/home/users/mkochan/svn-root/kml/csml2kml/output/wms-obs2</OutputRootDirectory> 
     44  <ServerRootDirectory></ServerRootDirectory> 
     47The field {{{URL}}} is a base URL of the WMS web service serving the intended dataset. 
    3249==== The {{{}}} script ==== 
     51Run this script as: 
     53python filename.conf.xml 
     55where {{{filename.conf.xml}}} stands for an XML config file. 
     57This script interrogates a WFS to get a list of (meteorological) stations, recorded using an element ''<np:Station>'' defined for the purposes of this project. It generates a KMZ file that contains a number of ''<kml:Placemark>'' elements, each standing for a single station. Each station has has a balloon filled according to a defined template, which refers to a URL of the running {{{csml2kmlpylon}}} Pylon. Thus dynamic content about each station can be presented. 
     59An example config file looks as follows: 
     62  <DocumentName>MIDAS stations (first 100 of them)</DocumentName> 
     63  <UseRegions>yes</UseRegions> 
     64  <GetAllStationsRequestURL><![CDATA[ 
     66  <BalloonTemplate>&lt;h2&gt;Station $[station_name]&lt;/h2&gt;Click here to see the list of &lt;a href=&quot;$[station_name]&quot;&gt;CSML features associated with this station&lt;/a&gt; (this will open a window of your default web browser).</BalloonTemplate> 
     67  <StationData> 
     68    <Datum name="station_id">#ID#</Datum> 
     69    <Datum name="station_name">#NAME#</Datum> 
     70  </StationData> 
     71   <OutputKmzFilename>/home/users/mkochan/svn-root/kml/csml2kml/output/exampleps_stations.4.kmz</OutputKmzFilename> 
     74The non-obvious settings are as follows: 
     75 - {{{UseRegions}}} - determines whether to use embedding into regions. 
     76   * If set to {{{no}}}, stations will be recorded simply as a list of KML placemarks, and will be visible from all altitudes. May cause slow rendering for large number of placemarks. 
     77   * If set to {{{yes}}}, stations will be divided by recursively splitting the the covered are into 4 smaller KML regions. The actual station KML placemarks will be placed at the bottom of the hierarchy. Therefore, they will be forced to be visible only for closer zooms onto the ground, so rendering will be quick. 
    3679=== Deployment of the {{{csml2kmlpylon}}} server === 
    40 === Configuration === 
    4281== Code notes == 
    4786 - {{{scripts}}} - contains Python stand-alone scripts, runnable from command line, which both use a config file as a means of input 
    4887 - {{{tests}}} - contains tests, which simply print output (rather than fail/pass messages), and are runnable as {{{python}}}, but please look at the contents first to see what the test does 
    49  - {{{config}}} - contains config files for the scripts, in XML format, which define locations of used Web services etc. 
     88 - {{{config}}} - a preferred location for config files for the scripts, in XML format, which define locations of used Web services etc. 
    5089 - {{{output}}} - empty after installation, optionally usable for output of scripts and tests