Search code examples
flaskmodelgeom-text

Flask Model with GeoAlchemy column


How to create the geometry column in flask model

   from geoalchemy2 import Geometry
   from app import db
   class process(db.Model):
      wkt = db.Column(Geometry('POINT'))

But it's gives error while creating the table

create table process(
[WKT] geometry(GEOMETRY,-1) NULL)

SQL Error Is:

Incorrect syntax near ','.

Solution

  • It's tricky, I tried this one

    WKT = db.Column(Geometry(''))