Happy to hear it's working for you use case. For every edge that is used as depart or arrival edge by any of the vehicles, a taz definition with the same id as that edge must exist in order for the described approach to work. regards, Jakob
2017-05-03 9:56 GMT+02:00 mohsen hs <[email protected]>: > Hi Jakob, > > Thanks once again for your consideration and thoughtfulness. > > Worked perfectly! Amazing: ). In the weekend, I will try it on our > city(larger scale). > > For other people who may face this issue in the feature, I used this > command: > > duarouter --trip-files=trip.trips.xml --net-file=map.net.xml > --output-file=Test.rou.xml > --taz-files=TazGeneratedBygenerateBidiDistricts.taz.xml > --with-taz > > > Just a quick question: > Taz file that I need to use should have all the edges, right? > Because this approach does not work on the small taz file that I generated > manually, but it worked on the taz file which I generated by the > generateBidiDistricts > script. > > > Thanks once again. This was a great help. > > Cheers > Mohsen > > > On Tuesday, May 2, 2017 10:56 PM, Jakob Erdmann < > [email protected]> wrote: > > > Hello, > the problem is due to a misunderstanding. OD2Trips treats taz differently: > a fixed source/arrival edge is selected randomly from all edges in the TAZ. > > Instead, you should > - generate the trip file with your own process which arbitrarily uses > either downstream or upstream edge that fit the coordinates but instead of > 'from' and 'to' write that edge to the attributes 'fromTaz' and 'toTaz' > - run generateBidiDistricts.py to generate TAZ of the following form > <tazs> > <taz id="-16686683#3" edges="-16686683#3 16686683#3" /> > <taz id="16686683#3" edges="-16686683#3 16686683#3" /> > </tazs> > > - load those trips into sumo and enjoy better routes. > > Explanation: these TAZ encode the fact that for both upstream and > downstream edges both departure (and arrival) directions are ok. > > regards, > Jakob > > > 2017-05-02 12:19 GMT+02:00 mohsen hs <[email protected]>: > > Hi Jacob, > > Thanks a lot for your reply and consideration. I tried that, but I did not > get what I expected. I am suspicious that I have done something wrong and > would be grateful if you could advise. > Please note we are left-hand side. > > I put the code, input, and output below. > > Looking forward to hearing from you. > > Many thanks > Mohsen > > First: I created a taz file as follows: > <tazs> > <taz id="1" edges="-16686683#3 16686683#3" /> > <taz id="2" edges="-256521845#1 256521845#1" /> > </tazs> > > Second: My ofm file > $O;D2 > 8.01 8.02 > 1 > 1 2 5 > 2 1 1 > > Third: command > od2trips -n taz.taz.xml -d input_od_o.fma -o tripmatrix.trips.xml --scale > 1 > > Forth: output (tripmatrix.trips.xml) > <routes xmlns:xsi="http://www.w3.org/ 2001/XMLSchema-instance > <http://www.w3.org/2001/XMLSchema-instance>" > xsi:noNamespaceSchemaLocation= "http://sumo.dlr.de/xsd/ routes_file.xsd > <http://sumo.dlr.de/xsd/routes_file.xsd>"> > <trip id="1" depart="28869.51" from="16686683#3" to="-256521845#1" > fromTaz="1" toTaz="2" departLane="free" departSpeed="max"/> > <trip id="2" depart="28870.32" from="16686683#3" to="-256521845#1" > fromTaz="1" toTaz="2" departLane="free" departSpeed="max"/> > <trip id="4" depart="28878.88" from="-16686683#3" to="256521845#1" > fromTaz="1" toTaz="2" departLane="free" departSpeed="max"/> > <trip id="0" depart="28895.35" from="-16686683#3" to="256521845#1" > fromTaz="1" toTaz="2" departLane="free" departSpeed="max"/> > <trip id="3" depart="28898.16" from="-16686683#3" to="256521845#1" > fromTaz="1" toTaz="2" departLane="free" departSpeed="max"/> > <trip id="5" depart="28915.65" from="-256521845#1" to="16686683#3" > fromTaz="2" toTaz="1" departLane="free" departSpeed="max"/> > </routes> > > > > As shown above, for the first 5 trips (from zone 1 to zone 2), the 'from' > should be the negative edge (-16686683#3) and arrival should be the > positive edge (256521845#1). Unfortunately, the first two do not follow > this rule. > > One more question please: how does od2trips can detect which edge is > upstream and downstream without having the net.xml file as a parameter? > > > > > > On Tuesday, May 2, 2017 4:47 AM, Jakob Erdmann <[email protected]> > wrote: > > > The solution lies in letting the router decide from which of the two > directional edges to start / arrive. > This can be done using traffic assignment zones which puts both edges > (positive and negative number) into one zone. These zones can be generated > automatically. > See > http://sumo.dlr.de/wiki/ Definition_of_Vehicles,_ > Vehicle_Types,_and_Routes# Traffic_assignement_zones_. 28TAZ.29 > <http://sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Traffic_assignement_zones_.28TAZ.29> > http://sumo.dlr.de/wiki/Tools/ District# generateBidiDistricts.py > <http://sumo.dlr.de/wiki/Tools/District#generateBidiDistricts.py> > regards, > Jakob > > 2017-04-30 8:03 GMT+02:00 mohsen hs <[email protected]>: > > Hello all, > I have some data from actual traffic devices and would like to generate > the traffic based on the collected traffic data. My collected data is like > this: > Source Street(SS), latitude of SS, longitude of SS, number of observed > vehicles, Destination (DS), DS latitude, DS longitude, arrival time at DS > I have generated net.xml for my city and I wrote an application to extract > edges and store them in my database (db). I also wrote an application that > can generate trips.xml for me based on the data in my db. I also stored > lat, long, and street names from map.osm in my db. So I can easily > correlate lat and long (from map.osm) with edges (from net.xml). The > problem that I am facing is related to generating the trips based on the > edges (to and from). I can find the closest edge to my SS/SD by finding the > minimum Euclidean distance between SS/DSs' lat/long and edges' lat/long. > But, I have difficulty in selecting the negative edge or positive edge as > from/to. For example, after calculating the minimum Euclidean distance, > the start point matches the following edges (see below screenshot) and the > direction of travel (SS->SD) in my case is North. So, I have to select the > negative one, but I can not do this manually. I was wondering if you could > help me to find a way to automate this process. > > > Please let me know if you need more information. > Looking forward to hearing from you. > > Regards,Mohsen > > > ------------------------------ ------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ______________________________ _________________ > sumo-user mailing list > [email protected]. net <[email protected]> > https://lists.sourceforge.net/ lists/listinfo/sumo-user > <https://lists.sourceforge.net/lists/listinfo/sumo-user> > > > > > > > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
