Commit 4639fc4e authored by dagal's avatar dagal
Browse files

Introduce long line names

parent 1d645993
......@@ -15,7 +15,8 @@ DROP TABLE IF EXISTS line;
CREATE TABLE line
(
id varchar primary key,
name varchar
short_name varchar,
long_name varchar
);
......
......@@ -14,9 +14,10 @@ type Stop struct {
}
type Line struct {
ID string
Name string
Stops []Stop `gorm:"many2many:line_stop;association_foreignkey:ctr_id;jointable_foreignkey:line_id;association_jointable_foreignkey:stop_ctr_id;"`
ID string
ShortName string
LongName string
Stops []Stop `gorm:"many2many:line_stop;association_foreignkey:ctr_id;jointable_foreignkey:line_id;association_jointable_foreignkey:stop_ctr_id;"`
}
type Journey struct {
......@@ -48,7 +49,8 @@ func (l Line) ToGeoJSON() *geojson.Feature {
f := geojson.NewLineStringFeature(coords)
f.Properties["id"] = l.ID
f.Properties["name"] = l.Name
f.Properties["short_name"] = l.ShortName
f.Properties["long_name"] = l.LongName
f.Properties["stops"] = stopIds
return f
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment