Changeset 3435


Ignore:
Timestamp:
15/02/08 14:56:00 (12 years ago)
Author:
mkochan
Message:

Added routine for conversion from float degrees to deg, min, sec, and the rest in seconds

Location:
DPPP/kml/csml2kml
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/csml2kml/utils.py

    r3306 r3435  
    1717    return content 
    1818 
     19def toDegreesMinutesSeconds(val): 
     20    if val >= 0:  
     21        sign = 1 
     22    else:  
     23        sign = -1 
     24    val = abs(val) 
     25    degrees = int(val) 
     26    decim = val % 1. 
     27    minute = 1/60. 
     28    second = 1/3600. 
     29    minutes = int(decim / minute) 
     30    remainder = decim % minute 
     31    seconds = int(remainder / second) 
     32    remainder = remainder % second 
     33    remainderInSeconds = remainder / second 
     34    return (sign * degrees, minutes, seconds, remainderInSeconds) 
     35 
    1936def loadConfigElement(configFilename, basePath): 
    2037    tree = ElementTree() 
  • DPPP/kml/csml2kml/testdata/midas.csml2kml.conf.xml

    r3434 r3435  
    88    <GeoServerRequest> 
    99      <URL>http://bond.badc.rl.ac.uk:8089/dummyGeoServer/GetStationCSMLFeatures?gml_id=MIDAS_Stations_with_features</URL> 
    10       <BalloonTemplate>Station $[station_name] (located at $[station_lon] longitude, $[station_lat] latitude). Contains features: $[station_features]</BalloonTemplate> 
     10      <BalloonTemplate>&lt;h2&gt;Station $[station_name]&lt;/h2&gt; Located at: 
     11$[station_lon] longitude, $[station_lat] latitude). &lt;br&gt;Contains features: $[station_features]</BalloonTemplate> 
    1112      <StationData> 
    1213        <Datum name="station_id">#ID#</Datum> 
Note: See TracChangeset for help on using the changeset viewer.