[mapserver-users] runtime substitution not working

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Fri Mar 12 17:06:19 EST 2010


I don't see anything obvious. You can test at the command-line with the CGI (shp2img won't work). Syntax is like so:

  mapserv -nh "QUERY_STRING=map=/srv/www/htdocs/mapdata/catch.map&spp=TAR"

The -nh switch suppresses the HTTP headers which helps if you're creating an image.

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of pcreso at pcreso.com
Sent: Thursday, March 11, 2010 10:22 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] runtime substitution not working

Hi,

I'm obviously doing something wrong, but can't see what it is... I have a Postgis table of species occurences & I want to pass a variable to the mapfile to select which speciesusing runtime substitution.

The relevant DATA statement (joining species in the catch to locations in the station) in the mapfile is: 

DATA "startp from (select c.id, s.startp, s.trip_code, 
                              s.station_no, c.species,
                              c.weight 
                       from t_station s, catch c
                       where s.station_no=c.station_no
                         and c.species ilike '%%spp%%') 
                       as myquery
                       using unique id using srid=4326"


The query works in Postgis & in the mapfile (via QGIS) when I hard code the %spp% (eg, to 'TAR')

I'm using QGIS to open the layer, with the URL:
http://wms-dev/cgi-bin/mapserv?map=/srv/www/htdocs/mapdata/catch.map&spp=TAR

QGIS appends the request type, etc & it works with the hard coded "spp"

The mapfile also has:
    METADATA
      "wms_title" "species"
      "wms_srs"   "epsg:4326"
      "wfs_title" "species"
      "wfs_version" "1.0.0"
      "wfs_typename" "species"
      "wfs_request_method" "GET"
      "wfs_service" "WFS"
      "spp_validation_pattern" '^[A-Z0-9][A-Z0-9][A-Z0-9]$'
    END

The version I'm running is MapServer version 5.4.1
(so no default supported)

The docs say I can use shp2img to test runtime substitution in a mapfile, but I can't see how to invoke the substitution with the equivalent of a spp=TAR statement to test this. 


Any suggestions? 

  Thanks

    Brent Wood

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list