TROBDB: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
(Get traffic obstructions)
(Get traffic obstructions)
Zeile 35: Zeile 35:
 
* Parameters:  
 
* Parameters:  
 
** osmid - Value type: long integer (mandatory) - Description: id of OSM way (positive).
 
** osmid - Value type: long integer (mandatory) - Description: id of OSM way (positive).
** lat - Latitude
+
** lat - Latitude as decimal number
** lon - Longtitude
+
** lon - Longtitude as decimal number
** radius - Search radius
+
** radius - Search radius in Meters
 
** togeojsonio - If defined, the user is directly linked to geojson.io to see all selected Traffic Obstructions
 
** togeojsonio - If defined, the user is directly linked to geojson.io to see all selected Traffic Obstructions
  

Version vom 3. Dezember 2013, 09:06 Uhr

Projekt "Traffic Obstruction Database" (TROBDB) mit Webservices

Website (inkl. DB, Webservice/API) für Verkehrshindernisse. Traffic Obstruction Database (TROBDB). Teil des BLUgis-Projekts.

Definition/Abgrenzung: Unter Verkehrshindernisse (engl.: "Traffic Obstructions", Driving Bans) verstehen wir hier temporäre Fahrverbote oder temporär gesperrte Strassen u.a. wegen Baustellen oder Veranstaltungen, die geplant und angekündigt sind. Staus oder andere Echtzeitinformationen gehören nicht dazu.

Datenquellen

  1. Verkehrszentrale des Bundes (Baustellen, Pässe, Tunnelzufahrten und andere Verkehrssperrungen). Die Daten werden jeweils vor 11h und vor 16h von truckinfo.ch abgeholt.
  2. Stadt Zürich, Baustellen, als Download-Service.
  3. Rettungsdienst BLUgis/Regio144 (geplant)
  4. Registrierte Nutzer über das Webinterface (geplant)

Hinweis: Die konsolidierten TROBDB-Daten werden jeweils täglich um ca. 11h und 16h aktualisiert.

Webservices

General information about API

  • Current API version is 'v1'.
  • Base URL is http://trobdb.hsr.ch/
  • The current API only allows GET (read) requests. Modifying request are not implemented and not allowed.
  • Usage policy: restricted use!

Common parameters

  • format - Values: 'geojson' (optional)
  • key - Values: 'demo'|<<user_id>>. Used for simple authentication. Please contact us for registration.
    • Status
      • geoJSON standard. Nothing else to choose atm.

Get traffic obstructions

  • Description: Returns a traffic obstruction (trobs) as an array of way_id's.
  • URL: /api/[version]/trobs/
  • Method: HTTP GET
  • Parameters:
    • osmid - Value type: long integer (mandatory) - Description: id of OSM way (positive).
    • lat - Latitude as decimal number
    • lon - Longtitude as decimal number
    • radius - Search radius in Meters
    • togeojsonio - If defined, the user is directly linked to geojson.io to see all selected Traffic Obstructions
  • Returns:
    • HTTP 200 OK - Description: Everything is Ok.
    • HTTP 401 Unauthorized - Description: Wrong key?
    • HTTP 400 Bad Request - Description: Parameter(s) unknown, parameter(s) not existent, or way_id does not exist.

Examples:

{ "type": "FeatureCollection", "features": [ {"type": "Feature","properties": { "sysdate": "2013-11-26 14:18:42", "traffic_obstruction_end": "2013-11-30 05:00:00", "direction": "as_is", "truckInfoImagePath": "mapserver2/symbols/icone35.png", "traffic_obstruction_start": "2013-11-27 21:00:00", "description": "[Schweiz] rechter Fahrstreifen gesperrt|Bern Richtung Zürich|Zwischen AS Lenzburg und AS Mägenwil rechter Fahrstreifen gesperrt, vorübergehende Begrenzung der Breite auf 3.0 Meter, Höchstgeschwindigkeit: 80 km/h, Baustelle in der Nacht, Dauer: 27.11.2013 21:00 Uhr bis 30.11.2013 05:00 Uhr|", "emergency": "", "title": "[Schweiz] rechter Fahrstreifen gesperrt Bern Richtung Zürich", "issued": "2013-11-26 14:18:16", "traffic_obstruction_string": "27.11.2013 21:00 Uhr bis 30.11.2013 05:00 Uhr", "isTunnel": "False", "issuer_name": "truckinfo.ch", "country": "Schweiz", "roadNarrow": "3", "category": "1_31", "isCarLoad": "False", "isPass": "False", "road": "A1"},"geometry": {"type": "LineString", "coordinates": [[8.2121933, 47.4065703], [8.2126037, 47.4068268], [8.2141709, 47.4077618], [8.2149955, 47.4082739], [8.2154032, 47.4085423], [8.2158038, 47.40881], [8.2164978, 47.4093186], [8.2169385, 47.409656], [8.2173768, 47.4100066], [8.2180022, 47.4105499], [8.2185954, 47.4111157], [8.2192297, 47.4117786], [8.2198332, 47.4124779], [8.2212912, 47.4143689]]}} ]}

{ "type": "FeatureCollection", "features": [{"type": "Feature","properties": { "traffic_obstruction_start": "2013-11-18 21:00:00", "issued": "2013-12-02 09:32:00", "isTunnel": "False", "issuer_name": "truckinfo.ch", "roadNarrow": "3.0", "isCarLoad": "False", "category": "1_31", "traffic_obstruction_end": "2013-12-10 05:00:00", "title": "[Schweiz] Veränderte Verkehrsführung Bern - Zürich", "osm_way_id": "4769349", "isPass": "False", "direction": "as_is", "description": "[Schweiz] Veränderte Verkehrsführung|Bern - Zürich|Zwischen Autobahndreieck Verzweigung Härkingen und Autobahndreieck Verzweigung Wiggertal in beiden Richtungen Veränderte Verkehrsführung, vorübergehende Begrenzung der Breite auf 3.0 Meter, Länge des betroffenen Abschnittes: 9.5 km, Höchstgeschwindigkeit: 80 km/h, Baustelle in der Nacht, Dauer: 18.11.2013 21:00 Uhr bis 10.12.2013 05:00 Uhr|jeweils von 21:00 - 05:00 Uhr|Ohne Nächte von Samstag auf Sonntag und Montag|", "emergency": "", "dbId": "5435", "traffic_obstruction_string": "18.11.2013 21:00 Uhr bis 10.12.2013 05:00 Uhr", "AsText(point)": "POINT(8.041345 47.338103)", "sysdate": "2013-12-02 09:34:49", "country": "Schweiz", "AsText(geom)": "LINESTRING(8.04139 47.33722, 8.04137 47.337284, 8.041279 47.337592, 8.041217 47.33778, 8.041101 47.338202, 8.041023 47.33849, 8.040979 47.338724, 8.040963 47.338866, 8.040959 47.339037, 8.041001 47.339491, 8.041056 47.339738, 8.04112 47.339954, 8.041158 47.340038, 8.041203 47.340139, 8.04134 47.340399, 8.041513 47.340739)", "truckInfoImagePath": "mapserver2/symbols/icone36.png", "osm_highway": "primary", "depricated": "False", "road": "A1"},"geometry": {"type": "LineString", "coordinates": [[8.04139, 47.33722], [8.04137, 47.337284], [8.041279, 47.337592], [8.041217, 47.33778], [8.041101, 47.338202], [8.041023, 47.33849], [8.040979, 47.338724], [8.040963, 47.338866], [8.040959, 47.339037], [8.041001, 47.339491], [8.041056, 47.339738], [8.04112, 47.339954], [8.041158, 47.340038], [8.041203, 47.340139], [8.04134, 47.340399], [8.041513, 47.340739]]}} ]}

[1]

Datenstruktur

"Traffic Obstruction DB":

Tabelle/Record "trobdb_line":

 geometry: Linestring NOT_NULL                -- gesperrte Richtung, d.h. Reihenfolge der Stüzpunkte relevant!)
 id_ref: integer NULL                         -- id der Quell-Datenbank (und dort UNIQUE NOT_NULL) 
 title: varchar(100) NOT_NULL
 description: text NUL_NULL
 traffic_obstruction_start: date/datetime NOT_NULL
 traffic_obstruction_end: date/datetime NOT_NULL
 traffic_obstruction_string: text NULL        -- Intervall-Zeitangaben (vgl. Bemerkungen)
 emergency: boolean NULL                      -- Rettungs-Fz können trotzdem durchfahren
 direction: (0..1) ENUM(as_is, reverse) NULL  -- Default: NULL = "both directions"
 sysdate: datetime NOT_NULL                   -- Datum der Erfassung dieser Info
 issued: datetime NULL                        -- Datum von demjenigen, von wo die Meldung kam
 issuer_name: (0..1) text NULL                -- Name derjenigen, von wo die Meldung kam
 file_ref: URL NULL                           -- relative_path_to_file, allowed formats: PDF, JPG, PNG, GIF 
 osm_way_id: biginteger NULL                  -- OSM way id vom Matching (nur bei trobdb_line) 
 osm_way_type: string NULL                    -- Wert des highway-Tags, z.B. motorway, footway (nur bei trobdb_line)
 osm_way_oneway: boolean NULL                 -- Einbahnstrasse (nur bei trobdb_line)

Tabelle/Record "trobdb_area":

 geometry: Polygon                            -- gesperrte Fläche, z.B. bei Dorfkern-Sperrungen
 ...                                          -- ditto wie "trobdb_line"

Tabelle/Record "trobdb_poi":

 geometry: Point                              -- gesperrter Punkt, z.B. Pässe/Tunnel/Autoverlade 
 ...                                          -- ditto wie "trobdb_line"

Bemerkungen: