Re: [mapserver-users] runtime substitution not working

2010-03-13 Thread Ben Madin
G'day Brent,

It might not matter, but you have double %% in the DATA statement you have 
passed, 

and for whatever reason - I recevied advice from this list or OpenLayers list - 
I have all my variable names capitalised in the query:

WHERE transferdate >= '%STARTDATE%' AND 
transferdate <= '%ENDDATE%'
AND line_geom IS NOT NULL
AND sourceshire NOT LIKE 
destinationshire
AND sourceshire LIKE 
'%SOURCESHIRE%'

So I hope these might help if Steve's solution didn't

cheers

Ben



On 13/03/2010, at 24:00 , mapserver-users-requ...@lists.osgeo.org wrote:

> 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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: msLoadMap() Unable to access file

2010-03-13 Thread georgeDim

1)
C:\ms4w\httpd.d\httpd_geomatics.conf

#This is the Apache config (httpd_geomatics.conf) file for the MapServer
workshop.

Alias /geomatics "/ms4w/apps/geomatics/htdocs"


AllowOverride None
Options Indexes MultiViews Includes FollowSymLinks
Order allow,deny
Allow from all


2)
C:\ms4w\apps\geomatics\htdocs\hello.map

MAP
NAME "Hello_World"
SIZE 400 300
IMAGECOLOR 249 245 186
IMAGETYPE png
EXTENT -1.00 -1.00 1.00 1.00
WEB
TEMPLATE 'hello.html'
IMAGEPATH '/ms4w/tmp/ms_tmp/'
IMAGEURL '/ms_tmp/'
END
LAYER
NAME hello
STATUS default
TYPE point
FEATURE
POINTS 0.0 0.0 END
TEXT "Hello World"
END # end feature
CLASS
STYLE
COLOR 255 0 0
END
LABEL
TYPE bitmap
END
END
END
END

3)C:\ms4w\apps\geomatics\htdocs\hello.html


   
   Hello World
   
   
   
   
   

 
  
   
  
  
  
  

  
   


   
  
   
 
 
  
 





good luck
-- 
View this message in context: 
http://n2.nabble.com/msLoadMap-Unable-to-access-file-tp1971168p4727322.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users