SELECT
    ev.id as qmap_event_id,
    ev.version,
    ev.status,

    ev.road_dir as direction,
--     ev.direction,

    to_char(ev.start_time,'YYYY-MM-DD"T"HH24:MI:SS"Z"') as start_date,

    -- ev.update_time missing
    -- to_char(ev.update_time,'YYYY-MM-DD"T"HH24:MI:SS"Z"') as update_date,

    to_char(ev.end_time,'YYYY-MM-DD"T"HH24:MI:SS"Z"') as end_date,

    -- ev.publication_time missing
    -- to_char(ev.publication_time,'YYYY-MM-DD"T"HH24:MI:SS"Z"') as publication_date,

    ev.road_lcd,

    -- renamed?
--     ev.lcd_from,
--     ev.lcd_to,
    ev.start_lcd,
    ev.end_lcd,

    -- renamed?
--     ev.meters_from,
--     ev.meters_to,
    ev.start_meters,
    ev.end_meters,

    -- missing?
--     ev.meters_from_other,
--     ev.meters_to_other,

    -- missing ?
    -- ev.type_code,

    -- missing ?
    -- ev.external_id as supplier_event_id,

    -- missing ?
    -- t.ico as ico_name,

    ev.descr_it,
    ev.descr_en,
    ev.descr_de,
--     ev.further_info as description,
    ST_X(ev.start_geometry) as point_x,
    ST_Y(ev.start_geometry) as point_y
--     (CASE WHEN GeometryType(ev.start_geometry)='LINESTRING' THEN ST_X(ST_StartPoint(ev.wkb_geometry)) ELSE ST_X(ev.wkb_geometry) END) as point_x,
--     (CASE WHEN GeometryType(ev.start_geometry)='LINESTRING' THEN ST_Y(ST_StartPoint(ev.wkb_geometry)) ELSE ST_Y(ev.wkb_geometry) END) as point_y
FROM
     active.events AS ev
--      INNER JOIN history.event_type_codes t ON
--          ev.type_code = t.type_code
--      INNER JOIN history.event_suppliers supp ON
--          ev.supplier_id=supp.id
-- WHERE
--     $event_id_list_condition
--     AND ev.road_lcd = $road_lcd
--     AND supp.shortname IN ($suppliers_list)
