Пример #1
0
 def get_position(self):
 
    position = dict(clon='',
                    clat='')
    try:
        if self.xml:
            Nodes = self.xml.getElementsByTagName("property")
            for Node in Nodes:
                if Node.hasAttribute('key') and Node.attributes['key'].value == "china_lng":
                    position['clon'] = int(float(Node.childNodes[0].data) / 1.024)
                elif Node.hasAttribute('key') and Node.attributes['key'].value == "china_lat":
                    position['clat'] = int(float(Node.childNodes[0].data) / 1.024)
    except Exception as e:
        logging.exception("GE: Parse ge position exception:%s", e.args[0]) 
    return position