diff --git a/gtfsdb/__init__.py b/gtfsdb/__init__.py index 6046fd7..af4d981 100644 --- a/gtfsdb/__init__.py +++ b/gtfsdb/__init__.py @@ -1,4 +1,3 @@ -from gtfsdb.config import config from gtfsdb.model.agency import Agency from gtfsdb.model.calendar import Calendar, CalendarDate, UniversalCalendar from gtfsdb.model.db import Database diff --git a/gtfsdb/model/__init__.py b/gtfsdb/model/__init__.py index ac5ab41..e69de29 100644 --- a/gtfsdb/model/__init__.py +++ b/gtfsdb/model/__init__.py @@ -1,9 +0,0 @@ -required_files = ['agency.txt', 'stops.txt', 'routes.txt', - 'trips.txt', 'stop_times.txt'] -optional_files = ['calendar.txt', 'calendar_dates.txt', 'fare_attributes.txt', - 'fare_rules.txt', 'shapes.txt', 'frequencies.txt', - 'transfers.txt'] -proposed_files = ['feed_info.txt', 'stop_features.txt'] -files = required_files + optional_files + proposed_files - -SRID = 4326 diff --git a/gtfsdb/model/shape.py b/gtfsdb/model/shape.py index 6f7a349..5650492 100644 --- a/gtfsdb/model/shape.py +++ b/gtfsdb/model/shape.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy.sql import func -from gtfsdb.model import SRID +from gtfsdb.config import config from gtfsdb.model.base import Base @@ -90,7 +90,7 @@ def add_geom_to_dict(cls, row): try: from geoalchemy import WKTSpatialElement wkt = 'SRID=%s;POINT(%s %s)' % ( - SRID, + config.get('DEFAULT', 'SRID'), row['shape_pt_lon'], row['shape_pt_lat'] ) diff --git a/gtfsdb/model/stop.py b/gtfsdb/model/stop.py index a3e960d..b6cdbe2 100644 --- a/gtfsdb/model/stop.py +++ b/gtfsdb/model/stop.py @@ -1,7 +1,7 @@ -from gtfsdb.model import SRID from sqlalchemy import Column, Integer, Numeric, String from sqlalchemy.orm import relationship +from gtfsdb.config import config from gtfsdb.model.base import Base @@ -37,7 +37,7 @@ def add_geom_to_dict(cls, row): try: from geoalchemy import WKTSpatialElement wkt = 'SRID=%s;POINT(%s %s)' % ( - SRID, + config.get('DEFAULT', 'SRID'), row['stop_lon'], row['stop_lat'] )