[mapserver-users] Leading zeros removed from variabelwhenpassed to map file

Steve Lime Steve.Lime at state.mn.us
Tue Dec 8 08:56:26 PST 2009


MapServer handles the runtime input as strings always. It's only after the substitution is 
done that context might dictate interpreting things as a number, date or whatever.

Steve

>>> On 12/8/2009 at 10:13 AM, in message
<1260288815849-4133442.post at n2.nabble.com>, GGould
<graeme.gould at grandunionhousing.co.uk> wrote:

> Yes correct.  I added the quotes where I populate the variable - so its in
> the asp.  I think I tried your method but couldnt get it to work - will have
> to have another attempt.
> 
> Graeme
> 
> 
> Steve Lime-2 wrote:
>> 
>> Thanks for posting your solution, might help another user. As I understand
>> it you're
>> quoting the variable on the way into MapServer, right? A simpler solution
>> might be
>> to just adjust your filter by placing quotes around replacement string,
>> like so:
>> 
>>   FILTER "placeref = '%ref_no%'"
>> 
>> That way PostGIS will interpret it as a string.
>> 
>> Steve
>> 
>>>>> GGould <graeme.gould at grandunionhousing.co.uk> 12/08/09 5:15 AM >>>
>> 
>> Hi
>> 
>> Solved the problem by adding quote marks at the beginning and end of each
>> ref_no so that the variable is seem by the map file as a string rather
>> than
>> an integer.
>> 
>> Graeme
>> 
>> 
>> GGould wrote:
>>> 
>>> Hi
>>> 
>>> Im just starting out with MapServer and have a bit of a stumbling block. 
>>> The following script should identify a property based on the "ref_no"
>>> string variable passed to the map file.
>>> 
>>> DATA "geometry from snh_properties"
>>> FILTER "placeref = %ref_no%"
>>> 
>>> This works for all ref_no's beginning with a whole number, however if the
>>> re_no begins with a zero then it does not work.  Has anyone come across
>>> this before and is there a solution that hopefully wont tax my brain too
>>> much.
>>> 
>>> Cheers
>>> 
>>> Graeme
>>> 
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> 
> http://n2.nabble.com/Leading-zeros-removed-from-variabel-when-passed-to-map-file-tp4125 
> 557p4131812.html
>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org 
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
>> 
>> _______________________________________________
>> 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