コード例 #1
0
ファイル: main.go プロジェクト: kirillrdy/train
func osmRelationToTrainLine(osm *osm.Osm, index *osm.Index, relation osm.Relation) (trainLine model.TrainLine) {

	var sections model.Sections

	for _, member := range relation.WayMembers() {
		way := index.WayById(member.Ref)
		if way != nil {
			sections = append(sections, wayToSection(osm, index, *way))
		}
	}

	trainLine.Sections = sections
	return trainLine
}