TROBDB Webservices: Unterschied zwischen den Versionen

Aus Geometa Lab OST
Zur Navigation springen Zur Suche springen
Zeile 51: Zeile 51:




The webeditor you can find here: http://trobdb.hsr.ch/editmap
You can find the webeditor here: http://trobdb.hsr.ch/editmap


Here you have the possibility to add data, with the two drawing tools in the upper left corner of the map.
Here you have the possibility to add data with the two drawing tools in the upper-left corner of the map.
 
 
Otherwise you can upload GeoJSON files on this Link: http://trobdb.hsr.ch/upload


== Datenstruktur ==
== Datenstruktur ==

Version vom 10. Juni 2014, 12:14 Uhr

Zurück zu TROBDB.

Webservices

General information about the API

Overview:

  • There exists a webservice for getting traffic obstructions from TROBDB.
  • There exist two webservice for uploading traffic obstructions to TROBDB (HTTP/GeoJSON and the Webeditor).

Technical details:

Common parameters

  • format - Values: 'geojson' (optional)
  • key - Values: email adress. Used for simple authentication. Please log in with a valid OpenID once on the main page.
  • Status: GeoJSON standard. Nothing else to choose atm.

Getting traffic obstructions from TROBDB (gettrafficobstruction)

  • Description: Returns a traffic obstruction (trobs) as an array of way_id's.
  • URL: /gettrafficobstruction
  • 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:

Uploading traffic obstructions to TROBDB (HTTP/GeoJSON and WFS/GML)

For uploading or editing data, you need a verified email adress. You can register your email address in our application, by logging in on the main page: http://trobdb.hsr.ch

For verification, you have to drop us a message, contact information may be found here: http://giswiki.hsr.ch/TROBDB#Kontakt


You can find the webeditor here: http://trobdb.hsr.ch/editmap

Here you have the possibility to add data with the two drawing tools in the upper-left corner of the map.


Otherwise you can upload GeoJSON files on this Link: http://trobdb.hsr.ch/upload

Datenstruktur

Hinweise:

  • 'trob' ist die Abkürzung von "Traffic Obstruction", d.h. Verkehrsbehinderung.
  • Es gibt drei Tabellen mit fast identischer Datenstruktur, trobdb_line, trobdb_area, trobdb_point, die sich v.a. im Geometrie-Typ des Attributs 'geom' unterscheiden.
  • Die mit "Exch." (=exchange) gekennzeichneten Attribute, d.h. der erste nachfolgende Teil, umfassen die vom Lieferanten auszutauschenden (maximal 14) Attribute.
  • Die ENUM-Aufzählwerte werden als Zeichenketten codiert, wie angegeben.
  • Die Werte im Attrbiut 'trob_interval' sind Intervall-Zeitangaben gemäss 'opening hours'-Format wobei dies als Nicht-Öffnungszeiten" interpretiert wird: Definition OSM, Demo (inkl. Source Code)
  • In der Wert Tabelle/Record 'trobdb_area' ist 'direction' immer 'both' (es gibt keine Richtung bei Flächen).
  • Es gibt zwei Identifikatoren: 'userid' und 'id'. Beide garantieren nur im Rahmen eines Datenbankzustandes eindeutig zu sein. Sie garantieren nicht, einzigartig bzw. über die Zeit (z.B. nach zwei Lieferungen) stabil zu sein.
  • Es werden nur TROBDB-Objekte (aus den drei Tabellen) ausgeliefert, die nicht aktuell sind. Zurzeit werden obsolete Objekt eine Woche in der TROBDB intern behalten.
  • Es gibt zurzeit keine automatische Erkennung von mehrfachen Einträgen; dies wird zurzeit organisatorisch gelöst.
  • Attributwert "obstructed" bedeuted "Durchfahrt erschwert" und kann u.a. bedeuten: Fahrbahnverschwenkung oder Verkehrsregelung mit Lichtsignalanlage.

Tabelle/Record "trobdb_line":

 geom:               LINESTRING   NOT_NULL -- (Exch.) Gesperrte bzw. verkehrsbehinderte Richtung (Reihenfolge der Stützpunkte relevant).
 userid:             TEXT         NULL     -- (Exch.) Identifikator der Lieferanten/Quell-Datenbank (falls vorhanden).
 title:              TEXT*100     NOT_NULL -- (Exch.) Titel.
 description:        TEXT         NUL_NULL -- (Exch.) Beschreibung.
 trob_start:         DATETIME     NOT_NULL -- (Exch.) Beginn (Zeitpunkt) der Verkehrsbehinderung (kann in der Zukunft aber auch in der Vergangenheit liegen).
 trob_end:           DATETIME     NOT_NULL -- (Exch.) Ende (Zeitpunkt) der Verkehrsbehinderung (muss in der Zukunft liegen und älter sein als trob_start).
 trob_interval:      TEXT         NULL     -- (Exch.) Intervall-Zeitangabe der Verkehrsbehinderung ('opening hours'-Format z.B. "Mo-Fr 7:30-12:00, 13:00-18:30; Sa 7:30-16:00", vgl. Bem.).
 direction:          ENUM         NOT_NULL -- (Exch.) ENUM(as_is,reverse,both); Richtung der Sperrung/Verkehrsbehinderung (Erfassungs-Default: both)
 diversion_advice:   TEXT         NULL     -- (Exch.) Umfahrungsempfehlung, insbes. falls sie signalisiert ist. (NEU) 
 country:            TEXT*2       NOT_NULL -- (Exch.) Länderkürzel gemäss ISO 3166-1 ALPHA-2; (Erfassungs-Default: 'CH').
 reason:             ENUM         NOT_NULL -- (Exch.) ENUM(construction, event, other); (Erfassungs-Default: other). (NEU) 
 object_name:        TEXT         NULL     -- (Exch.) Strassenname (falls gegeben); (z.B. 'A1' oder 'Etzelstrasse').
 object_type:        ENUM         NOT_NULL -- (Exch.) ENUM(street, tunnel, car_transport, pass, other); (Erfassungs-Default: street). (NEU) 
 trob_type:          ENUM         NOT_NULL -- (Exch.) ENUM(closed, closed_except_emergency, closed_for_heavy_load, obstructed, other); (Erfassungs-Default: closed). (NEU)
 id:                 INTEGER      NOT_NULL -- Identifiaktor als Sequence der TROBDB (autoincrement).
 sysdate:            DATETIME     NOT_NULL -- Datum des Eintrags dieses Records.
 issuer_name:        TEXT         NULL     -- Name desjenigen, von dem die Meldung kam (=> OpenID Email?).  
 osm_way_id:         BIGINTEGER   NULL     -- OSM way id vom Matching (nur bei trobdb_line) 
 osm_highway:        TEXT         NULL     -- Wert des highway-Tags, z.B. motorway, footway (nur bei trobdb_line)
 issued:             DATETIME     NULL     -- (Exch.) Datum z.B. der Bewilligung von demjenigen, von dem die Meldung kam. (ENTFERNEN)
 emergency:          BOOLEAN      NULL     -- (Exch.) Rettungs-Fz können trotzdem durchfahren. (ENTFERNEN)
 is_tunnel:          BOOLEAN      NOT_NULL -- from truckinfo text (ENTFERNEN)
 is_car_transport:   BOOLEAN      NOT_NULL -- Evaluated from truckinfo text. (ENTFERNEN)
 is_pass:            BOOLEAN      NOT_NULL -- Evaluated from truckinfo text. (ENTFERNEN)
 deprecated          BOOLEAN      NOT_NULL -- Wird TRUE wenn traffic_obstruction_end erreicht. (Default=FALSE). (ENTFERNEN)
 truckinfoimagepath: TEXT         NULL     -- imagepath von truckinfo-Quelle. (ENTFERNEN)

Tabelle/Record "trobdb_area":

 geom:               MULTIPOLYGON NOT_NULL -- gesperrte Fläche, z.B. bei Dorfkern-Sperrungen.
 ...                                       -- ditto wie "trobdb_line" jedoch ohne osm_highway and osm_way_id
 osm_way_id_list     BIGINTEGER   NOT_NULL -- all osm_ways matching to st_intersects with the polygon data

Tabelle/Record "trobdb_point":

 geom:               POINT        NOT_NULL -- gesperrter Punkt, z.B. Pässe/Tunnel/Autoverlade 
 ...                                       -- ditto wie "trobdb_line" jedoch ohne osm_highway and osm_way_id

Notizen:

  • LINESTRING Richtung matchen zu OpenStreetMap Ways. Lösung zur Richtung des LINESTRINGS.