Skip Menu |

This queue is for tickets about the Map-Tube CPAN distribution.

Report information
The Basics
Id: 103168
Status: resolved
Priority: 0/
Queue: Map-Tube

People
Owner: MANWAR [...] cpan.org
Requestors: SKIM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.97
Fixed in: 2.99



Subject: Map::Tube::get_node_by_name issue
Hi, I created Map::Tube::KualaLumpur metro map and this map has multiple stations with same name and different IDs. These IDs are conform to real situation in Kuala Lumpur. e.g. <station id="KA01" name="KL Sentral" line="Seremban Line" link="KA02,KB01" other_link="Terminal1:6-01,Terminal5:7-01,Walking:MR1,Terminal6:KJ15"/> <station id="KJ15" name="KL Sentral" line="Kelana Jaya Line" link="KJ14,KJ16" other_link="Terminal3:6-01,Terminal4:7-01,Walking:MR1,Terminal6:KA01"/> <station id="6-01" name="KL Sentral" line="KLIA Ekspres Line" link="6-02" other_link="Terminal3:KJ15,Terminal2:7-01,Walking:MR1,Terminal1:KA01"/> <station id="7-01" name="KL Sentral" line="KLIA Transit Line" link="7-02" other_link="Terminal2:6-01,Terminal4:KJ15,Walking:MR1,Terminal5:KA01"/> Issue is, that get_node_by_name() returns one object with this name instead multiple Map::Tube::Node objects. Kind regards, Michal
Hi, Please find below the proposed solution to the issue you raised: https://github.com/Manwar/Map-Tube/commit/920b091532b772f8609d0ec718343f1c3cd8be1e Many Thanks. Best Regards, Mohammad S Anwar
Dne Ne 29.bře.2015 12:48:56, MANWAR napsal(a): Hi, Show quoted text
> Please find below the proposed solution to the issue you raised: > https://github.com/Manwar/Map- > Tube/commit/920b091532b772f8609d0ec718343f1c3cd8be1e
I like changes for get_node_by_name(). But i don't like changes for get_node_by_id() method. 1) In my mind station has unique id in system. These changes breaks it. In Kuala Lumpur metro i have two lines with same station and XML code is: <station id="KA04" name="Putra" line="Seremban Line" link="KA05,KA03" other_link="Walking:ST8"/> <station id="KA04" name="Putra" line="Port Klang Line" link="KA03,KC01" other_link="Walking:ST8"/> In real Kuala Lumpur metro this station has one unique id and stays on two lines. I propose merge these records to one Map::Tube::Node object. 2) Check for undefined node id in get_node_by_id() method. Kind regards, M.
Hi, Show quoted text
> > I like changes for get_node_by_name(). >
Thanks :-) Show quoted text
> But i don't like changes for get_node_by_id() method. > 1) In my mind station has unique id in system. > These changes breaks it. > > In Kuala Lumpur metro i have two lines with same station and XML code > is: > <station id="KA04" name="Putra" line="Seremban Line" link="KA05,KA03" > other_link="Walking:ST8"/> > <station id="KA04" name="Putra" line="Port Klang Line" > link="KA03,KC01" other_link="Walking:ST8"/> > In real Kuala Lumpur metro this station has one unique id and stays on > two lines. > > I propose merge these records to one Map::Tube::Node object.
I agree, it should be merged into into one but that should be done in the xml itself. As I have done it in various map files e.g. London map. The above can be merged like below: <station id="KA04" name="Putra" line="Seremban Line,Port Klang Line" link="KA05,KA03,KA03,KC01" other_link="Walking:ST8"/> Show quoted text
> > 2) Check for undefined node id in get_node_by_id() method. >
I will do that in the next release. Many Thanks, Best Regards, Mohammad S Anwar
Dne Po 30.bře.2015 04:41:00, MANWAR napsal(a): Hi, Show quoted text
> > But i don't like changes for get_node_by_id() method. > > 1) In my mind station has unique id in system. > > These changes breaks it. > > > > In Kuala Lumpur metro i have two lines with same station and XML code > > is: > > <station id="KA04" name="Putra" line="Seremban Line" link="KA05,KA03" > > other_link="Walking:ST8"/> > > <station id="KA04" name="Putra" line="Port Klang Line" > > link="KA03,KC01" other_link="Walking:ST8"/> > > In real Kuala Lumpur metro this station has one unique id and stays > > on > > two lines. > > > > I propose merge these records to one Map::Tube::Node object.
> > I agree, it should be merged into into one but that should be done in > the xml itself. As I have done it in various map files e.g. London > map. The above can be merged like below: > > <station id="KA04" > name="Putra" > line="Seremban Line,Port Klang Line" > link="KA05,KA03,KA03,KC01" > other_link="Walking:ST8"/>
Yes, you are right. After this you can add check for multiple IDs and remove code for returning array of nodes in get_node_by_id() method. Kind regards, M.
Hi, Here is the commit for the above proposed changes: https://github.com/Manwar/Map-Tube/commit/55d818b4a0a440dd423f494993710e9739392f4d Best Regards, Mohammad S Anwar
Dne Po 30.bře.2015 05:41:41, MANWAR napsal(a): Hi, Show quoted text
> Here is the commit for the above proposed changes: > https://github.com/Manwar/Map- > Tube/commit/55d818b4a0a440dd423f494993710e9739392f4d
Great! Thanks, M.
Closing it now :-)