[mapserver-users] Issue with run-time substitution?
Stephen Davies
sdavies at sdc.com.au
Sun Sep 11 22:26:06 PDT 2011
All of my map files are dynamically generated at run-time from templates so
mapserver run-time substitution is not really needed. I just wanted to see how
it worked.
I suspect that the apparent issue was caused by a bug in my template
manipulation code as moving the logic into and out of my code made the issue
go away.
I did try varying the validation regex. It seems that pretty much anything
works: in regex or URL:-))
You suggest that my validation expression "isn't strong enough".
Given that, in this case, any NNN_NNN value is possible and valid, what else
could I use?
Cheers and thanks,
Stephen
On Wednesday 31 August 2011 23:17:28 Steve Lime wrote:
> Hmm... Looks like it's setup correctly although you validation pattern
> isn't strong enough. As a test what happens if you try a pattern like '.'?
> If that works then it's a regex error. One thing that comes to mind is
> that maybe there's query string parsing issue and the var to substitute
> isn't being recognized. Spaces or other chars ahead of &var could mess
> things up. Something to check.
>
> Steve
>
> Sent from my iPad
>
> On Aug 30, 2011, at 6:43 AM, Stephen Davies <sdavies at sdc.com.au> wrote:
> > I am running mapserver 6.0.1 with map files migrated from 5.6.3.
> >
> > One of my map files has stopped working properly and I suspect that it
> > may be a bug in the 6.0.1 run-time substitution code.
> >
> > The relevant map file layer sections look like this:
> > LAYER
> >
> > CONNECTIONTYPE postgis
> > NAME "battery"
> > DATA "geom from wmd using unique id using SRID=4283"
> > CONNECTION "user=scldad dbname=benparts"
> > STATUS ON
> > TYPE POINT
> > VALIDATION
> >
> > vucv '[0-9]*_[0-9]*'
> >
> > END
> > FILTER (stype='B' and uc='%vucv%')
> > PROJECTION
> >
> > "init=epsg:4283"
> >
> > END
> > MAXSCALE 5000000
> > LABELITEM "label"
> > CLASSITEM "state"
> > CLASS
> >
> > EXPRESSION "G"
> > STYLE
> >
> > COLOR 0 255 0
> > SYMBOL 'dot'
> > SIZE 7
> > OFFSET 17 0
> >
> > END
> > LABEL
> >
> > POSITION CR
> > TYPE TRUETYPE
> > FONT arial
> > SIZE 8
> > COLOR 0 255 0
> > OFFSET 20 0
> > FORCE TRUE
> > STYLE
> >
> > GEOMTRANSFORM 'labelpoly'
> > COLOR 255 255 255
> >
> > END
> >
> > END
> >
> > END
> >
> > .
> > .
> > END
> >
> > There are twelve layers with essentially the same definition apart from
> > the STYPE values.
> >
> > The invoking URL has &vucv=137_11 but the postgresql log reveals that no
> > substitution has occurred. The final pgsql command still has '%vucv%'.
> >
> > I suspect that having more than one FILTER with the same substitution
> > breaks things as all other substitutions work fine.
> >
> > (I also tried putting the substitution in the DATA entry but with no
> > better result.)
> >
> > Cheers,
> > Stephen
--
=============================================================================
Stephen Davies Consulting P/L Voice: 08-8177 1595
Adelaide, South Australia. Fax : 08-8177 0133
Records & Collections Management. Mobile:040 304 0583
More information about the MapServer-users
mailing list