Skip to content

str(HighwaySegment) #134

Closed
Closed

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?

Activity

  1. jteresco commented on Nov 22, 2018

    @jteresco
    Contributor

    I'm not seeing other uses of it. Do we want to introduce this fix or just make sure it doesn't happen by regular checking of the datacheck for duplicate waypoints? In the extreme, we could instead make duplicate waypoint labels a fatal error that causes the site update to terminate.

  2. michihdeu commented on Nov 22, 2018

    @michihdeu
    Contributor

    In the extreme, we could instead make duplicate waypoint labels a fatal error that causes the site update to terminate.

    Seconded!

  3. yakra commented on Nov 23, 2018

    @yakra
    ContributorAuthor

    Downvoted. There are enough duplicate labels spread out around the world, and enough contributors with slow enough update schedules, that this could play havoc with maintaining a working site.

    I don't really favor a fix for this now -- it's only used for concurrencies.log, which isn't something that gets or needs much attention at all. It's not crucial to my concurrency detection fixes, which are about done anyway.
    Not worth the extra CPU time, RAM, or hassle of coding it.

    Feel free to close this.

  4. jteresco commented on Nov 23, 2018

    @jteresco
    Contributor

    Discussion about duplicate labels moving to the forum: http://forum.travelmapping.net/index.php?topic=2796.0

  5. reopened this on Nov 26, 2018
  6. yakra commented on Nov 26, 2018

    @yakra
    ContributorAuthor

    Reopening due to a different thought:
    Would it make more sense to format these as a .list file line? IE,
    [ME I-295 6 7] instead of [6 to 7 via me.i295]?

  7. self-assigned this
    on Dec 5, 2018
  8. jteresco commented on Dec 5, 2018

    @jteresco
    Contributor

    I'd say yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions