Skip to content

Support multiline DATA options in MapServer mapfiles #64

Open

Description

@sebastic

Currently the mapfile parser in TinyOWS doesn't support multiline options in the MapServer mapfile.

The multiline syntax supported by MapServer is very convenient for keeping long subqueries readable instead of forcing it onto a single line, which is currently required for TinyOWS.

An example mapfile multiline option with a long subquery not supported by TinyOWS:

    DATA           "geovlak from (SELECT w.gid, ST_Transform(w.geovlak, 4326) AS geovlak,
                                         w.woonplaatsnaam,
                                         gw.gemeentecode,
                                         gp.gemeentenaam,
                                         gp.provinciecode,
                                         gp.provincienaam,
                                         ow.osm_type,
                                         ow.osm_id
                                    FROM woonplaats          AS w,
                                         osm_woonplaats      AS ow,
                                         gemeente_woonplaats AS gw
                               LEFT JOIN gemeente_provincie  AS gp ON gw.gemeentecode = gp.gemeentecode
                                   WHERE w.woonplaatsstatus = 'Woonplaats aangewezen'
                                     AND w.aanduidingrecordinactief = 'false'
                                     AND w.begindatumtijdvakgeldigheid <= NOW()
                                     AND (w.einddatumtijdvakgeldigheid IS NULL OR
                                          w.einddatumtijdvakgeldigheid > NOW())
                                     AND w.identificatie = gw.woonplaatscode
                                     AND gw.status = 'definitief'
                                     AND gw.begindatumtijdvakgeldigheid <= NOW()
                                     AND (gw.einddatumtijdvakgeldigheid IS NULL OR
                                          gw.einddatumtijdvakgeldigheid > NOW())
                                     AND w.identificatie = ow.identificatie
                                 ) as subquery using unique gid using srid=4326"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy