opentripmodel / otm5-change-requests

Tracking and reporting bugs and change requests of the OTM5 specification.
5 stars 1 forks source link

Road restrictions and environmental zones in OTM5 #88

Open bmeesters opened 7 months ago

bmeesters commented 7 months ago

Introduction

NDW posses information regarding road signs that make certain roads inaccessible for certain type of vehicles. They would like to communicate this information in OTM5 and are wondering what would be the best way to communicate this data. This 'change request' contains the summary of the discussions we had until now.

Example

The following image contains part of a map with a road sign. This road sign prohibits trucks to drive in the red direction. All lines in blue are allowed. image003

Constraints

Constraints in OTM were created exactly to model that certain things are either mandatory or prohibited and are a good fit for this problem. You can create a more complex constraint from several smaller sub-constraints. This makes it possible to create a constraint for a certain route that is only true for certain type of vehicles.

A first attempt of a constraints looks like this:

{
   // The top level entity is the constraint
  "entityType": "constraint",

  // The constraint is mandatory, alternatively it could be preference, for signs that give suggestions
  "enforceability": "enforced",
  "value": {

    // The constraints is made up of multiple sub-constraints, that are combined in an `and`
    "and": [
      {
        // Vehicles must be below 4 meters high 
        "valueType": "height",
        "constraintType": "maximum",
        "maximum": {
          "value": 4,
          "unit": "m"
        },
        "type": "valueBoundConstraint"
      },
      {
        // Vehicles must be below 100000kg
        "valueType": "weight",
        "constraintType": "maximum",
        "maximum": {
          "value": 100000,
          "unit": "kg"
        },
        "type": "valueBoundConstraint"
      },
      {
        // Vehicles must be shorter than 20m
        "valueType": "length",
        "constraintType": "maximum",
        "maximum": {
          "value": 20,
          "unit": "m"
        },
        "type": "valueBoundConstraint"
      },
      {
        // You are NOT allowed to go over the route below
        "not": {
          "route": {
            "entity": {
              "geoReferences": {
                "points": [
                  {
                    "lat": 52,
                    "lon": 4
                  },
                  {
                    "lat": 52,
                    "lon": 5
                  },
                  {
                    "lat": 53,
                    "lon": 5
                  },
                  {
                    "lat": 53,
                    "lon": 4
                  },
                  {
                    "lat": 52,
                    "lon": 4
                  }
                ],
                "type": "latLonArrayGeoReference"
              }
            },
            "associationType": "inline"
          },
          "type": "routeEntityConstraint"
        },
        "type": "notConstraint"
      }
    ],
    "type": "andConstraint"
  }
}

Discussion

We discussed several items when creating this example:

Next steps

  1. We first need to decide whether using constrains as described in this proposal is useful for parties and if it can be improved. Alternative ideas are welcome.
  2. If accepted, we would need to extend OTM to support FRC, FOW and axle load so NDW can communicate this information in OTM5.
werkenr commented 3 months ago

Since it is currently not possible to specify the maximum axleLoad in OTM5, NDW will in a initial version of the mapping specify it as a weight-constraint with a description of axleLoad:

[
    {
        "id": "00000000-0000-0000-0000-000000000000",
        "geoReference": {
            "type": "Feature",
            "geometry": {}
        },
        "constraint": {
            "entity": {
                "value": {
                    "type": "valueBoundConstraint",
                    "valueType": "weight",
                    "constraintType": "maximum",
                    "maximum": {
                        "value": 2300,
                        "unit": "kg"
                    },
                    "description": "axleLoad"
                }
            }
        }
    }
]

A suggestion would be to add a valueType for the axleLoad, so the information doesn't have to be derived from the description.