Open matburnham opened 2 years ago
Looks like something the following should work, based on INSERT INTO flights(date, sender_id, flight_type, multilinestring, simple_multilinestring)
from geoalchemy2.types import Geometry
from app import db
class Flight(db.Model):
__tablename__ = "flights"
date = db.Column(db.Date, primary_key=True)
flight_type = db.Column(db.SmallInteger, primary_key=True)
multilinestring = db.Column("multilinestring", Geometry("MULTILINESTRING", srid=4326))
simple_multilinestring = db.Column("simple_multilinestring", Geometry("MULTILINESTRING", srid=4326)) # this is the path simplified with ST_Simplify(path, 0.0001)
# Relations
sender_id = db.Column(db.Integer, db.ForeignKey("senders.id", ondelete="CASCADE"), index=True)
sender = db.relationship("Sender", foreign_keys=[sender_id], backref=db.backref("flights"))
def __repr__(self):
return "<Flight %s: %s,%s>" % (self.date, self.path_wkt, self.path_simple_wkt)
db.Index("ix_flights_date_sender_id", Flight.date, Flight.sender_id)
Trying to extract flights for today causes an exception:
So flights relation is missing. There's no
flights.py
inapp/model
. It looks like `flights2d.py' was removed in a18e6aeab3b2c62ac967b3bb6f319556cda02577. I could try and re-create an appropriate table, but is this simply a file not committed to git?