I m trying to draw the stored polygon points on google map when user clicks on the map. I use postgres database. I successfully stored the polygons into DB. When i try to auto draw the polygon points i get an recursion error. Here is my code
class drawPolygon(Base):
__tablename__ = "tbl_data_area"
id = Column(Integer, nullable=False, primary_key=True)
area = Column(Geometry('Polygon'))
name = Column( Text )
_poly = None
def getPoly(self):
if not self._poly:
self._poly = to_shape(self.area)//i get error here
return self._poly
def getAreaPoints(self):
return self.getPoly().area
area = property(getAreaPoints)
I don't know whats wrong in self.area. when the line self._poly = to_shape(self.area) executes I get this error RuntimeError: maximum recursion depth exceeded while calling a Python object. I m struck with this. Can any one help please.
self.areacallsgetAreaPoints(self)which callsself.getPoly()which usesself.areawhich callsgetAreaPoints(self)which callsself.getPoly()which usesself.areawhich callsgetAreaPoints(self)which callsself.getPoly()which usesself.area...... - Martijn Pieters♦self.areais not the column, it is thearea = property(getAreaPoints)property you defined. Perhaps you wanted to rename that property? - Martijn Pieters♦