Skip to content

str(HighwaySegment) #134

Description

@yakra

(Or should I more properly call it HighwaySegment.__str__, or HighwaySegment.str, or...?)

In cases where highways have duplicate label errors, the string produced by str(HighwaySegment) will not always uniquely identify a highway segment.
For example:
https://github.com/TravelMapping/HighwayData/blob/master/hwy_data/IL/usaush/il.us066hischi.wpt#L8-L9
and
https://github.com/TravelMapping/HighwayData/blob/master/hwy_data/IL/usaush/il.us066hischi.wpt#L118-L119
are both expressed as
+X01 to +X02 via il.us066hischi

Bringing in info about the waypoint number would be more foolproof.
[117]+X01 to [118]+X02 via il.us066hischi
117{+X01} to 118{+X02} via il.us066hischi
{+X01}118 to {+X02}119 via il.us066hischi
+X01<118> to +X02<119> via il.us066hischi, etc.
The first 2 examples use usual starting-at-zero array indexing a programmer might expect, which matches the waypoint numbers shown in the HB.
The last 2 examples use a starting-at-one approach that matches line numbers you'd see when opening the file in a text editor, or GitHub.
Playing around with a few different styles of brackets here. IMO, regular parentheses should be avoided, due to I-95(42) style labels.

I just took a look around siteupdate.py, and only saw this method used in creating concurrencies.log. Is it used anywhere else?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions