func wayToSection(osm *osm.Osm, index *osm.Index, way osm.Way) (section model.Section) { var points model.Points for _, nd := range way.Nd { node := index.NodeById(nd.Ref) if node != nil { point := model.Point{X: node.Lon, Y: node.Lat} points = append(points, point) } } //TODO extract stations info from way.Nds section.Points = points return section }