One column for all Shapely types in GeoAlchemy

353 Views Asked by At

By now I have this code:

value_literal = Column(String())
value_point = Column(Geometry('POINT'))
value_multipoint = Column(Geometry('MULTIPOINT'))
value_line = Column(Geometry('LINESTRING'))
value_multiline = Column(Geometry('MULTILINESTRING'))
value_polygon = Column(Geometry('POLYGON'))
value_multipolygon = Column(Geometry('MULTIPOLYGON'))

but I must consider all cases when dealing with an object: indeed, its geometric value can be a point, a line, and so on. It could be great if I would have only one field that would contain either a point, or a line, or a multipoint, etc...

Is it possible?

0

There are 0 best solutions below