summaryrefslogtreecommitdiff
path: root/latLng.py
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-05-02 16:43:12 +0100
committerTim Redfern <tim@eclectronics.org>2012-05-02 16:43:12 +0100
commit3209f698306ab0cf22ef0fe31a722bad22214691 (patch)
treef81c7a0d1e2825bcfb6997554fa2ccc3aeef4cee /latLng.py
parentbe1dd58124b3b4e1ad7a9eeabfb421d246b6ad1b (diff)
building xml loader
Diffstat (limited to 'latLng.py')
-rw-r--r--latLng.py23
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