[mapserver-users] Dynamic wfs_onlineresource

Matthias Müller matthias_mueller at tu-dresden.de
Thu Oct 17 02:11:48 PDT 2019


Hi,

we are running WFS services with similar mapfiles on different servers.

Setting the "wfs_onlineresource" is straight forward, but requires a
hard coded host name:

First server:
  WEB
    METADATA
      "wfs_title"          "myserver"
      "wfs_onlineresource" "https://server1.org/mapserver?"
      "wfs_srs"            "EPSG:4326"
      "wfs_enable_request" "*"  # necessary
    END
  END


Second server:
  WEB
    METADATA
      "wfs_title"          "myserver"
      "wfs_onlineresource" "https://server2.org/mapserver?"
      "wfs_srs"            "EPSG:4326"
      "wfs_enable_request" "*"  # necessary
    END
  END


I there way to let mapserver figure out the hostname from the request
and create the appropiate links in the WFS capabilities accordingly?

Something like:

  WEB
    METADATA
      "wfs_title"          "myserver"
      "wfs_online
resource" "{request protocol and hostname}/mapserver?"
      "wfs_srs"  
          "EPSG:4326"
      "wfs_enable_request" "*"  # necessary
    END
  END


-Matthias



More information about the mapserver-users mailing list