Editor
The Editor module enables network-level, versioned modifications to existing scenarios. It allows users to apply targeted structural changes to the simulation network (e.g., roadworks, incidents, traffic control measures, or policy interventions) without rebuilding the scenario from scratch.
Edits are submitted via the endpoint editor/scenario/<id> and are executed sequentially per scenario.
Each edit is based on a specific scenario version and produces a new version. This guarantees reproducibility and prevents conflicting concurrent changes.
Internally, an edit may:
- generate explicit SUMO network patch files,
- apply them using
netconvert, - validate demand feasibility and optionally repair demand files (
duarouter), - regenerate derived artifacts (thumbnails, GeoJSON files and metadata).
Currently supported patch types:
- Adjusting lane speed limits (
lane.set) - Changing allowed vehicle classes (
lane.set) - Closing lanes via SUMO rerouters (
lane.close) - Re-opening lanes via SUMO rerouters (
lane.open) - Adding lane-to-lane connections (
connection.add) - Delete lane-to-lane connections (
connection.delete)
Endpoint: editor/scenario/<id>
Authorization
This endpoint requires authentication and an enabled Scenario Editor feature in the plan. Access is restricted to scenarios owned by the authenticated user. Built-in scenarios are excluded from editing.
Method: GET
Retrieves the editable network representation of a scenario as a detailed GeoJSON FeatureCollection.
The response represents the current server-side state of the scenario network, including all previously applied edits. It is the authoritative input for client-side editing and validation.
The returned GeoJSON always includes the current scenario version, which must be supplied as base_version when submitting edit operations via PATCH.
GET Response
The response is a GeoJSON FeatureCollection with an additional top-level version field.
The version is an Integer ≥ 1 and reflects the current scenario network version on the server.
It is used for optimistic locking in subsequent PATCH requests.
Each entry in features is a standard GeoJSON Feature with specific properties, depending on the element type.
Supported element types are: edge, lane, junction and tls_connection.
The properties.element field acts as a discriminator for the element type.
See the following example for a GET response.
Lane features
Lane features are the primary editable elements. Properties may include:
id– lane ID (<edgeId>_<index>)index– lane indexmaxSpeed– maximum allowed speed (m/s)allow– list of allowed SUMO vehicle classes (may be empty); an empty list indicates that no vehicle class is permitted on this laneoutgoingLanes– list of connected lane IDswidth– lane width (m)centerLine– lane center geometry (optional)closed– optional boolean, present only if the lane is closed (via a rerouter)
All list-valued properties are returned as arrays, never as comma-separated strings.
Edge features
Properties may include:
id– edge IDname– street name (optional)numLanes– number of lanesfromNode,toNode– junction IDsallow– list of allowed vehicle classes (if present)
The allow list of an edge is computed as the union of the allow lists of its constituent lanes.
Junction features
Properties:
id– junction ID
(will be extended in the future)
TLS connection features
Properties may include:
idtls– traffic light system IDtlIndex– signal index
(will be extended in the future)
Notes for Clients
Geometries are provided as GeoJSON-compatible objects. Edges and lanes are typically represented as polygons. Junctions are represented by their geometric footprint. The geometry is intended for visualization and interaction, not for direct network reconstruction.
The returned network reflects the latest successfully applied edit. Clients must treat the response as read-only input. Any modification must be expressed via PATCH operations using the provided version. Concurrent edits are prevented server-side via explicit edit locks.
Method: PATCH
A PATCH request for the editor/scenario/<id> endpoint applies incremental, versioned modifications to an existing scenario network.
Instead of submitting a modified GeoJSON, clients have to describe the intended changes explicitly as a list of patch operations.
Each PATCH request:
- is based on a specific scenario version (
base_version), - applies one or more atomic edit operations,
- creates exactly one new scenario version,
- is executed asynchronously in the background.
PATCH Request
Each PATCH request must specify the base_version of the scenario it is based on.
If the server-side scenario version has changed since that version, the request is rejected with HTTP 409 (Conflict).
To ensure a strictly linear edit history, only one PATCH request may be processed per scenario at any given time.
Concurrent edit attempts are rejected with HTTP 423 (Locked).
Every successfully applied PATCH request increments the new scenario version.
Lane Properties
The lane.set operation modifies lane-specific attributes such as speed limits and allowed vehicle classes.
An example request body is shown below.
| JSON | |
|---|---|
In the SESAM backend, this results in the following patch being applied to the SUMO scenario network:
| XML | |
|---|---|
Lane Closures
The lane.close and lane.open operations control lane availability by dynamically restricting or restoring access for all vehicle classes within the simulation.
Closed lanes are excluded from routing and simulation until they are reopened.
Lane closures are implemented using SUMO rerouters instead of modifying the network topology.
This allows for reversible restrictions (e.g., roadworks, incidents).
A dedicated SUMO additional file is added to the scenario, containing a single rerouter with the id sesam_lane_closures.
All closed lanes are represented as <closingLaneReroute> entries inside a single time interval spanning over the whole simulation time.
lane.closeadds a closure entry (idempotent)lane.openremoves the closure entry (if no closures remain, the rerouter file is removed and unregistered)
Please see the example below for a patch request which closes lane edge123#1_0 and opens lane edge4313#1_1.
| JSON | |
|---|---|
Manage Connections
The connection.add and connection.delete operations modify directed lane-to-lane connections within the scenario network.
Lane connections define permitted routing transitions at junctions and directly influence vehicle turning behavior and route feasibility.
Existing connections are reflected in the outgoingLanes property of lane features in the GeoJSON representation.
connection.add creates a new directed connection between a source lane and a target lane.
connection.delete removes an existing directed connection between two lanes.
| JSON | |
|---|---|
Parameters:
from- source lane IDto- target lane ID
For connection.add the connection must not already exist and it must be topologically valid (i.e., lanes must be connectable at a common junction).
Invalid operations are rejected with HTTP 400.
Connection edits result in modifications of <connection> elements in the underlying SUMO network.
PATCH Response
If the request is accepted, the server returns immediately with HTTP 202 (Accepted):
| JSON | |
|---|---|
result_id- Unique ID of the background taskstatus_url- Endpoint for tracking progress and retrieving the final result
Applying editor operations can be a long-running task because it may require rebuilding the SUMO network (e.g., via netconvert), validating demand feasibility and conditionally repairing demand using duarouter, and regenerating derived artifacts (thumbnails, GeoJSON, metadata).
Clients should poll the returned status_url until the state becomes SUCCESS or FAILURE.
Therefore, the PATCH request is processed asynchronously.
Example response while processing (state PROGRESS):
Final response on success (state SUCCESS):
statereports the overall task state (e.g.,PENDING,PROGRESS,SUCCESS,FAILURE)logmay provide a short human-readable progress messagestagesprovides a structured breakdown aligned with the runner pipeline- On
FAILURE, anerror_messagefield is provided with diagnostic information
Note
The original, user-provided demand definition is never discarded. SESAM preserves the original demand definition and uses it as the baseline for subsequent edits and saves. Any demand repair is applied only to the derived, scenario-internal artifacts required for simulation, ensuring that no demand information is permanently removed or simplified.