yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

redundant segment length computation #240

Closed yakra closed 9 months ago

yakra commented 1 year ago

https://github.com/yakra/DataProcessing/blob/3c15c69fc0670e2450117527c2edd54bc68d2956/siteupdate/cplusplus/classes/Route/read_wpt.cpp#L86-L89

Segment length is computed twice here: https://github.com/yakra/DataProcessing/blob/3c15c69fc0670e2450117527c2edd54bc68d2956/siteupdate/cplusplus/classes/Waypoint/Waypoint.cpp#L367

https://github.com/yakra/DataProcessing/blob/3c15c69fc0670e2450117527c2edd54bc68d2956/siteupdate/cplusplus/classes/HighwaySegment/HighwaySegment.cpp#L12

Construct HighwaySegment first, then use stored length. Delete Waypoint::distance_update and just include the relevant bits inline.

Could probably also be a decent benefit for Python.