summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-08-09 11:58:54 +0100
committerTim Redfern <tim@eclectronics.org>2012-08-09 11:58:54 +0100
commitb058cfc85fd8770c0ef20bb6f976fb5b33e90a57 (patch)
tree6f01683b11197bdfa5ab55f40c35c53489683a5b
parentd658ce2496999ea5a38a4691f7a21e937cbed825 (diff)
sorting coords
-rwxr-xr-xlayers.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/layers.py b/layers.py
index 603b60d..5737b36 100755
--- a/layers.py
+++ b/layers.py
@@ -12,8 +12,14 @@ class layer:
except:
print "gps layer: failed to open", file
try:
- self.tl.parse(ll1)
- self.br.parse(ll2)
+ l1=latlng()
+ l2=latlng()
+ l1.parse(ll1)
+ l2.parse(ll2)
+ tl.lat=max(l1.lat,l2.lat)
+ tl.lng=min(l1.lng,l2.lng)
+ br.lat=min(l1.lat,l2.lat)
+ br.lng=max(l1.lng,l2.lng)
self.pixsize=latLng(abs(self.tl.lat-self.br.lat)/self.image.size[1],abs(self.tl.lng-self.br.lng)/self.image.size[0])
except:
print "gps layer: failed to parse", file