Skip to content

Production Data

Håvard Hellem edited this page May 14, 2018 · 2 revisions

The production data endpoint is used for inputting production data such as plowing and salting of roads.

Production data is connected to a road segment by a foreign key to the road segment table. There is no restriction on how many production data can refer to a single segment. This could be beneficial if someone in the future wishes to show more accurately the production on the roads has been done instead of being limited to just segments of up to 100 meters. As of now, output of status on a road with single production data precision is not supported.

Format

[
    {
        "time": "YYYY-MM-DDTHH:MM:SS+HH:MM",
        "startlat": <float>,
        "startlong": <float>,
        "endlat": <float>,
        "endlong": <float>,

        # The fields below are optional
        "dry_spreader_active": <True/False>,
        "plow_active": <True/False>,
        "wet_spreader_active": <True/False>,
        "brush_active": <True/False>
        "material_type_code": <Integer>
    },
    ...
]

These are the values for material_type_code and their corresponding meaning (in Norwegian)

  • 1: Tørrsand
  • 2: Saltblandet sand
  • 3: Fastsan
  • 4: Tørt salt (NaCl
  • 5: Befuktet Salt (NaCl)
  • 6: Saltslurry (NaCl)
  • 7: Saltløsning (NaCl)
  • 11: Befuktet salt og saltslurry

Mapping

The mapping of production data to road segments is done by first making a linestring out of the start and end points. Then the segments that are within the search radius (20m) are picked out. For these segments the distance to the production data linestring is calculated. As well as the closest point on the segment from the start point and end point. Then the distance between the start and end point and the distance between the remapped start and end point are calculated. These numbers in and of them selves are not too useful, so they are sort of normalized, as in we use the difference between the distances divided by the distance between the original start and end point. This is to get a measure of how parallel the production data entry and the segment are. Lastly the segments and their calculated values are compared. The point is to pick the segment that is closest but also as parallel as possible to the production data. Even if they overlap, they might cross each other at or close to a 90 degree angle, and this is not desirable. When segments are under 5 meters from the production data entry the choice is made only based on the most parallel segment.

Clone this wiki locally