diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-05-02 16:43:12 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-05-02 16:43:12 +0100 |
| commit | 3209f698306ab0cf22ef0fe31a722bad22214691 (patch) | |
| tree | f81c7a0d1e2825bcfb6997554fa2ccc3aeef4cee /latLng.py | |
| parent | be1dd58124b3b4e1ad7a9eeabfb421d246b6ad1b (diff) | |
building xml loader
Diffstat (limited to 'latLng.py')
| -rw-r--r-- | latLng.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/latLng.py b/latLng.py new file mode 100644 index 0000000..f567371 --- /dev/null +++ b/latLng.py @@ -0,0 +1,23 @@ +class latLng: + def __init__(self,lat=0.0,lng=0.0): + self.lat=lat + self.lng=lng + def parse(self,string): + n=string.split(",") + try: + self.lat=float(n[0]) + except: + self.lat=0.0 + try: + self.lng=float(n[1]) + except: + self.lng=0.0 + def __eq__(self,pos): + ret=False + if isinstance(pos,latLng): + if self.lat==pos.lat: + if self.lng==pos.lng: + ret=True + return ret + def __ne__(self,pos): + return not self==pos
\ No newline at end of file |
