Changes between Version 6 and Version 7 of NERCPortals


Ignore:
Timestamp:
08/02/08 11:12:16 (11 years ago)
Author:
mkochan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NERCPortals

    v6 v7  
    7575 - {{{kmlfeatures.py}}} -- encapsulation of CSML features as KML elements. Does not use {{{KMLDocument}}} 
    7676   and is only used by {{{GridSeriesConvertor}}}. 
     77 
     78= StationConvertor = 
     79 
     80Example run is contained in {{{kml/csml2kml/python/csml2kml/tests/testStationConvertor.py}}}. 
     81This test reads in a GML document from an arbitrary URL (which normally is a GeoServer call). 
     82It also requires a configuration object, which sets context for the conversion. 
     83The format of input is <i>not</i> CSML, but rather XML derived from GML that specifies locations 
     84of meteorological stations; each station can have several csml:PointSeriesFeature's associated with it: 
     85{{{ 
     86... 
     87}}} 
     88 
     89Note: The same server should return CSML of individual CSML features for any station. 
     90At the moment, how exactly this will be done is a matter of debate. 
     91 
     92The configuration is obtained from a config file which has format similar to this: 
     93{{{ 
     94<CSML2KMLConfig> 
     95  <CSMLStationPointSeries> 
     96    <name>MIDAS stations (example)</name> 
     97    <UseRegions>yes</UseRegions> 
     98    <GeoServerRequest> 
     99      <URL>http://bond.badc.rl.ac.uk:8089/dummyGeoServer/GetStationCSMLFeatures?gml_id=MIDAS_Stations</URL> 
     100      <BalloonTemplate>&lt;img src="http://bond.badc.rl.ac.uk:8089/csmlGrapher/plot?feature_id=$[feature_id]"&gt;</BalloonTemplate> 
     101      <StationData> 
     102        <Datum name="feature_id">#ID#</Datum> 
     103      </StationData> 
     104    </GeoServerRequest> 
     105  </CSMLStationPointSeries> 
     106</CSML2KMLConfig> 
     107}}} 
     108The element {{{GeoServerRequest}}} determines how stations list should be obtained (from which URL) 
     109and how information on each station should be shown in a balloon that pops out in Google Earth when a station 
     110is clicked. Each station can how certain data associated with it, which are substituted into the template. 
     111Using the {{{#ID#}}} value will in turn be substituted by the individual feature's ID. 
     112 
     113When the config-file tag {{{UseRegions}}} is set to "yes", the convertor is capable of generating KML 
     114with a very large number of stations, possibly tens of thousands. If all stations were visible in Google Earth at the same time, the rendering would be very slow. Therefore, the stations are organised into a hierarchical structure of regions using the kml:Folder and kml:Region tags (link) that causes stations to be rendered only for closer zooms onto the ground. In code, this is solved using splitting each geographical region (a rectangle) into 4 smaller regions, and continuing until a small number of stations (10) is present in that region. In KML, the stations are saved as kml:Placemark elements in a hierarchy of kml:Folder elements.