Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Point type in sqlalchemy?

I found this regarding Point type in Postgres: http://www.postgresql.org/docs/current/interactive/datatype-geometric.html

Is there the SQLAlchemy version of this?

I am storing values in this manner: (40.721959482, -73.878993913)

like image 661
user2899444 Avatar asked May 15 '16 00:05

user2899444


1 Answers

You can use geoalchemy2 whis is an extension to sqlalchemy and can be used with flask-sqlalchemy too.

from sqlalchemy import Column
from geoalchemy2 import Geometry
# and import others

class Shop(db.Model):
    # other fields
    coordinates = Column(Geometry('POINT'))
like image 130
Amin Alaee Avatar answered Sep 22 '22 00:09

Amin Alaee