LdDl / osm2ch

Convert OSM-file to graph for contraction hierarchies
Apache License 2.0
7 stars 1 forks source link

[FEATURE REQUEST] export OSM id's #3

Closed LdDl closed 2 years ago

LdDl commented 3 years ago

Is your feature request related to a problem? Please describe. Current utlity doesn't export source OSM ids (way/node).

Describe the solution you'd like and provide pseudocode examples if you can pseudocode'ish

expandedEdge{
    ID:        newEdgeID,
    Cost:      cost,
    Geom:      []geoPoint{a, b},
    WasOneWay: true,
    osm_way_id: %OSM_PARENT_WAY_ID%
    osm_node_ids: [%OSM_PARENT_NODE_ID_SOURCE%, %OSM_PARENT_NODE_ID_TARGET%]
}

And then export it into CSV as separate columns

Describe alternatives you've considered and provide pseudocode examples if you can nope

Additional context nope

LdDl commented 2 years ago

Implemented in https://github.com/LdDl/osm2ch/pull/12

fmt.Sprintf("%d", edge.SourceOSMWayID),
fmt.Sprintf("%d", edge.TargetOSMWayID),
fmt.Sprintf("%d", edge.SourceComponent.SourceNodeID), fmt.Sprintf("%d", edge.SourceComponent.TargetNodeID),
fmt.Sprintf("%d", edge.TargeComponent.SourceNodeID), fmt.Sprintf("%d", edge.TargeComponent.TargetNodeID),

If we will need all Nodes' IDs along the certain Way open new issue for new feature