Skip to content

Commit

Permalink
Updated code to use SRID entry in app.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
mgilligan committed Jul 26, 2013
1 parent fd06009 commit 7c046e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
1 change: 0 additions & 1 deletion gtfsdb/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 0 additions & 9 deletions gtfsdb/model/__init__.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions gtfsdb/model/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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']
)
Expand Down
4 changes: 2 additions & 2 deletions gtfsdb/model/stop.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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']
)
Expand Down

0 comments on commit 7c046e7

Please sign in to comment.