WYP Scenario Modelling

From stgo
Jump to: navigation, search

When the user evaluate the accesibility of a certain area, is important get a kind of comparison between the current model and one created. That is the reason for this view.

The view has two maps, the original(left) and the new(right).

The score is always calculated on the original map. The other map only allows to draw and generate a scenario that delivers a new score.

The Original

  • This map has all features of the home (Go to related info) [1].
  • When the score is obtained, go to the next map to add a street that modifies the score.
  • When a new street is drawn and sent to the server to generate a new scenario, change the OSC file in setting to csfuente - OSC Test
  • Then get a new Accessibility score.

The New

  • To draw a street, represented by a line, it's necesary go to section Draw Street of the left menu. it is important to decide the kind of the draw, this is by line or point. It is also important to decide the type of street to be drawn (Unclassified, Motorway, Pedestrian, Cycleway, Primary, Secondary or Residential).
  • Then, in the map draw a street to change the score of the original map (The first point is collected in the data to get a point in OSC file, this can be delayed).
  • When the street is complete, is necessary push the button Send.
  • The information that is sent contains the points formed on the map to the original OSC file from which the score is calculated.
  • The file has the following structure (Example):
<osmChange version="A">
   <node id="a" timestamp="2017-06-05T11:40:00Z" version="1" user="rardiles" lat="-33.430154" lon="-70.6311154" changeset="50000000" uid="60000000"/>
   <node id="102" timestamp="2017-06-05T11:40:00Z" version="1" user="rardiles" lat="-33.4299413" lon="-70.6313085" changeset="50000000" uid="60000000"/>
   <node id="103" timestamp="2017-06-05T11:40:00Z" version="1" user="rardiles" lat="-33.429816" lon="-70.6314507" changeset="50000000" uid="60000000"/>
   <node id="104" timestamp="2017-06-05T11:40:00Z" version="1" user="rardiles" lat="-33.4297175" lon="-70.6315633" changeset="50000000" uid="60000000"/>
   <way id="333" timestamp="2017-07-07T18:11:00Z" version="1" user="rardiles" changeset="50000000">
     <nd ref="224414357"/>
     <nd ref="102"/>
     <nd ref="103"/>
     <nd ref="104"/>
     <tag k="highway" v="residential"/>
  • The file generate a new scenario that is used to generate a new score.

File structure in the Frontend and Backend


  • function search_overpass(around,lat,lon): Take the first point of the drawing and search in overpass the node id that contains it.
  • function addInteraction(): Create a layer on the map where the street will go
  • map2.on('singleclick', function(evt)): It is composing the oschange file with the points of the street
  • function removeSelectedFeature(): Erase the street to start over
  • function send_post(): Send the info to the original OSC file to generate a new one.

The view has a menu(left) and a map(right).

The new frequencies generate an other scenario.

Left Menu

  • The first step is select a path among all routes.
  • The second select show all routes of the path. Select one to change its frequency.
  • At the end of the menu there is a list of routes that the user wishes to modify.


  • When the user selects a route, the map shows it.
  • Select any part of the route to display information.
  • Then, Select the time of the route to change.
  • Add new frequency of the route and click edit.
  • The modifications will be seen in the left menu.

File structure in the Frontend and Backend


  • map.on('singleclick', function(evt)): Function that allows to select a point of the route.
  • function add_time_form(): Function that displays information about the route that will be modified. The information shows the schedule and its corresponding frequency.
  • function logValue(): Function that creates the files trip.txt, shapes.txt, and frecuencies.txt that modify the frequency of the route.
  • function add_new_route(): Function that draw a route in the map.
  • function send_trip(): Function that sends the modification to the list.
  • function delete_frequency(id): Function that removes the modification from the list by id.
  • function send_to_graph(): Function that sends all the information to modify the frequencies and generate a new scenario.