Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntactic problems with specifying a rare map layout (not a code bug report!) #17

Open
gwselke opened this issue Jan 10, 2025 · 0 comments

Comments

@gwselke
Copy link

gwselke commented Jan 10, 2025

For a map that I am currently working on, I find a curious state of affairs in The Real World which I struggle to accommodate in the Map::Tube map syntax. (This is for XML, but I think the same applies to JSON.)

Here is a stripped down version of the situation:

Line X (id x): A <-> B <-> C
Line Y (id y): A -> B -> C -> D -> A (unidirectional; no direct link (neighbour) from B to A)

The best I can come up for the map data is then:

<station id="A" name="A street" line="x,y" link="B"/>
<station id="B" name="B street" line="x,y" link="A,C"/>
<station id="C" name="C street" line="x,y" link="B,D"/>
<station id="D" name="D street" line="y"   link="A"/>

But here the information is lost that, while there is a direct link from B to A using Line X, there is no (direct) link from B to A using Line Y. Consequently, get_shortest_route( 'B street', 'A street' )->preferred will yield
B street (LineX, LineY), A street (LineX, LineY)
instead of
B street (LineX), A street (LineX)

I do not think this is a bug in Map::Tube::get_shortest_path( ) or in preferred( ), since the result is compatible with what the map says. The issue is rather that the map does not say what I need it to say. And I have found no way of making it say what I want it to say.

This is certainly a rare edge case, and the consequences are very mild (the result being just slightly off). I am not sure whether such a case can be modelled given the current XML (or JSON) syntax. But changing the syntax would almost certainly break many existing applications, and that should certainly be avoided. Also, the effort may be too big for little gain. So this should not be regarded as a bug report, but as food for thought -- maybe there is an easy way to express this, after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant