comparison python/metadata.py @ 805:180b6b0231c0

added saving/loading points of interests
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 09 Jun 2016 15:36:21 -0400
parents 1262faae12e7
children fc8b3ce629d1
comparison
equal deleted inserted replaced
801:c5f98916297e 805:180b6b0231c0
16 idx = Column(Integer, primary_key=True) 16 idx = Column(Integer, primary_key=True)
17 name = Column(String) # same as path, relative to the database position 17 name = Column(String) # same as path, relative to the database position
18 description = Column(String) # longer names, eg intersection of road1 and road2 18 description = Column(String) # longer names, eg intersection of road1 and road2
19 xcoordinate = Column(Float) # ideally moving.Point, but needs to be 19 xcoordinate = Column(Float) # ideally moving.Point, but needs to be
20 ycoordinate = Column(Float) 20 ycoordinate = Column(Float)
21 mapImageFilename = Column(String) # path to filename, relative to site name, ie sitename/mapImageFilename
22 nUnitsPerPixel = Column(Float) # number of units of distance per pixel in map image
21 23
22 def __init__(self, name, description = "", xcoordinate = None, ycoordinate = None): 24 def __init__(self, name, description = "", xcoordinate = None, ycoordinate = None, mapImageFilename = None, nUnitsPerPixel = 1.):
23 self.name = name 25 self.name = name
24 self.description = description 26 self.description = description
25 self.xcoordinate = xcoordinate 27 self.xcoordinate = xcoordinate
26 self.ycoordinate = ycoordinate 28 self.ycoordinate = ycoordinate
29 self.mapImageFilename = mapImageFilename
30 self.nUnitsPerPixel = nUnitsPerPixel
27 31
28 def getFilename(self): 32 def getFilename(self):
29 return self.name 33 return self.name
30 34
31 class EnvironementalFactors(Base): 35 class EnvironementalFactors(Base):