projects
/
treecutter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding distance calculation to the Coord class
[treecutter.git]
/
xinclude
/
address.py
diff --git
a/xinclude/address.py
b/xinclude/address.py
index 3d60b10469ec1652302504d81fb26fffeb419719..fd7e0002589cd843964b5d73fc0d8338bd9bea25 100755
(executable)
--- a/
xinclude/address.py
+++ b/
xinclude/address.py
@@
-85,6
+85,11
@@
class Coord(object):
yo = int(floor((y-floor(y))*TS))
return (xo, yo)
yo = int(floor((y-floor(y))*TS))
return (xo, yo)
+ def distance(self, point):
+ res = Geodesic.WGS84.Inverse(self.latitude, self.longitude,
+ point.latitude, point.longitude)
+ return res['s12']
+
def png(self,zoom=15,size=(TS,TS)):
filename = encode(self.latitude, self.longitude)+'.png'
if path.isfile(filename):
def png(self,zoom=15,size=(TS,TS)):
filename = encode(self.latitude, self.longitude)+'.png'
if path.isfile(filename):
@@
-131,7
+136,6
@@
class Coord(object):
gridc = grid.crop((xp-TS/2,yp-TS/2,xp+TS/2,yp+TS/2))
gridc.save(filename)
gridc = grid.crop((xp-TS/2,yp-TS/2,xp+TS/2,yp+TS/2))
gridc.save(filename)
-
def db_xml(self):
uri = etree.Element(DB+'uri',nsmap=NSMAP)
ln = etree.SubElement(uri, DB+'link')
def db_xml(self):
uri = etree.Element(DB+'uri',nsmap=NSMAP)
ln = etree.SubElement(uri, DB+'link')