Skip to content

Commit

Permalink
Merge pull request azavea#2 from kshepard/topic/configurable-geom
Browse files Browse the repository at this point in the history
Make geometry column name of shapes and stops configurable
  • Loading branch information
echeipesh committed Aug 18, 2014
2 parents b8405cd + cc6ed05 commit f6b893c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/com/azavea/gtfs/slick/Profile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trait Profile {
val profile = PostgresDriver
val joda = new GenericJodaSupport(profile)
val gis = new PostGisProjectionSupport(profile)
var geomColumnName = "the_geom"

import profile.simple._

Expand Down Expand Up @@ -44,4 +45,4 @@ trait Profile {
{ int => RouteType(int) }
)

}
}
4 changes: 2 additions & 2 deletions src/main/scala/com/azavea/gtfs/slick/ShapesComponent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ trait ShapesComponent {this: Profile =>

class Shapes(tag: Tag) extends Table[TripShape](tag, "gtfs_shape_geoms") {
def id = column[String]("shape_id", O.PrimaryKey)
def geom = column[Projected[Line]]("the_geom")
def geom = column[Projected[Line]](geomColumnName)

def * = (id, geom) <> (TripShape.tupled, TripShape.unapply)
}
val shapesTable = TableQuery[Shapes]
def shapesTable = TableQuery[Shapes]

object shapes {
def all(implicit session: Session): List[TripShape] =
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/azavea/gtfs/slick/StopsComponent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ trait StopsComponent {this: Profile =>
def desc = column[Option[String]]("stop_desc")
def lat = column[Double]("stop_lat")
def lon = column[Double]("stop_lon")
def geom = column[Projected[Point]]("the_geom")
def geom = column[Projected[Point]](geomColumnName)

def * = (id, name, desc, lat, lon, geom) <> (Stop.tupled, Stop.unapply)
}
val stopsTable = TableQuery[Stops]
def stopsTable = TableQuery[Stops]

object stops {
def all(implicit session: Session): List[Stop] =
Expand Down

0 comments on commit f6b893c

Please sign in to comment.