Skip Menu |

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

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

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

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 2.44



Subject: XML changes
Hi, I am proposing changes to XML file, describing metro map. 1) Add line XML element, which contains station XML elements for line. This removes line="" attribute. This removes links to other lines in link="" attribute. 2) Add junction XML element, which can contain 1-n stations. e.g. <junction> <station id="Foo"/> <station id="Bar"/> </junction> There are two situations: a) Line A|Station & Line B|Station b) Line A|Station A with tunnel to Line B|Station B Then i can create better output for: cpanm App::Pod::Example cpanm Map::Tube::GraphViz pod-example -r -n 2 Map::Tube::GraphViz Kiev see Kiev.png PS: See Map::Metro configuration file Regards, Michal Špaček
Hi, I am more than happy to change the structure of xml file. However you have to explain to me in simple English, what exact change you are after? Unfortunately I am not familiar with GraphViz, also couldn't get it installed on my debian box for some strange reason. Here is a sample xml file: <?xml version="1.0" encoding="UTF-8"?> <tube name="sample"> <stations> <station id="1" name="A" line="L1" link="2,3"/> <station id="2" name="B" line="L1" link="1,5"/> <station id="3" name="C" line="L1" link="1,4"/> <station id="4" name="D" line="L1" link="3,5"/> <station id="5" name="E" line="L1" link="2,4"/> </stations> </tube> How do you propose to change the above xml? What are we going to achieve with the new structure that we can't with existing?
Dne St 17.pro.2014 13:00:45, MANWAR napsal(a): Show quoted text
> Unfortunately I am not familiar with GraphViz, also couldn't get it > installed on my debian box for some strange reason.
Image is here: http://www.pinterest.com/pin/401875966723833771/ Other in next mail. M.
Dne St 17.pro.2014 13:00:45, MANWAR napsal(a): Show quoted text
> Here is a sample xml file: > > <?xml version="1.0" encoding="UTF-8"?> > <tube name="sample"> > <stations> > <station id="1" name="A" line="L1" link="2,3"/> > <station id="2" name="B" line="L1,L2" link="1,5,10,11"/> > <station id="3" name="C" line="L1" link="1,4"/> > <station id="4" name="D" line="L1" link="3,5"/> > <station id="5" name="E" line="L1" link="2,4"/> > </stations> > </tube>
I added L2 link to XML above. Show quoted text
> How do you propose to change the above xml?
I propose something like this: <?xml version="1.0" encoding="UTF-8"?> <tube name="sample"> <line name="L1"> <station id="1" name="A" link="2,3"/> <station id="2" name="B" link="1,5"/> <station id="3" name="C" link="1,4"/> <station id="4" name="D" link="3,5"/> <station id="5" name="E" link="2,4"/> </line> <line name="L2"> <station id="2" name="B" link="10,11"/> </line> </tube> What i want (API): 1) List of lines 2) List of stations in line with right order. 3) Better resolution in junction point. What i don't like in actual XML schema: 1) link="1,2,3,4,5" 2) line="lineA,lineB" M.
Hi, Now I understood (partially) what you want with the new proposed xml structure. However I must admit what you are proposing is a big change that might upset others who are using Map::Tube. Therefore, I am willing add two new methods get_lines() and get_stations($line) to the Map::Tube. This should let you carry on what you are doing without changing the xml structure. Please let me know what you think. If you are happy with this proposal then I can add it within an hour time. Best Regards, Mohammad S Anwar
Dne Čt 18.pro.2014 06:11:49, MANWAR napsal(a): Hi, Show quoted text
> Now I understood (partially) what you want with the new proposed xml > structure. However I must admit what you are proposing is a big change > that might upset others who are using Map::Tube.
Yes, i understand. We are three, who are using Map::Tube (i, you and Slaven Rezić). My meaning is, that XML format must be changed in future. Show quoted text
> Therefore, I am willing add two new methods get_lines() and > get_stations($line) to the Map::Tube. This should let you carry on > what you are doing without changing the xml structure.
Ok. That's ok for me now. BTW: Another thing is line color. Most of metro lines has assigned color and actual serialization doesn't conform with this. Thanks :-) M.
Hi, Just pushed the changes Map::Tube v2.43 to github. It should be available on CPAN/MetaCPAN soon. Please refer to the pod document of Map::Tube about the new additions. Best Regards, Mohammad S Anwar
Dne Čt 18.pro.2014 07:14:57, MANWAR napsal(a): Hi, Show quoted text
> Just pushed the changes Map::Tube v2.43 to github. It should be > available on CPAN/MetaCPAN soon. > > Please refer to the pod document of Map::Tube about the new additions.
ok, thanks. I'll try it tonight. M.
Dne Čt 18.pro.2014 07:14:57, MANWAR napsal(a): Show quoted text
> Just pushed the changes Map::Tube v2.43 to github. It should be > available on CPAN/MetaCPAN soon.
Why get_lines() method returns string instead array of lines? M.
Just pushed Map::Tube v2.44 with the patch. Please have a look. Refer to pod document for the changes. Best Regards, Mohammad S Anwar
Dne Čt 18.pro.2014 10:29:19, MANWAR napsal(a): Show quoted text
> Just pushed Map::Tube v2.44 with the patch. Please have a look. > Refer to pod document for the changes.
Super. This is ok for me. :-) Thanks. M.
Closing now as code is patched.