[mapserver-users] RE: using pattern or nullformat in templates - Mapserver 5.4

Mark Volz MarkVolz at co.lyon.mn.us
Wed Feb 8 14:26:56 PST 2012


Steve,

Thank you for your reply.

Using [item name="PHYZIP" pattern="^[1-9]"] caused an internal service error.


Mark Volz
GIS Specialist
Lyon County, MN
507-532-8218

From: Lime, Steve D (DNR) [mailto:Steve.Lime at state.mn.us]
Sent: Wednesday, February 08, 2012 3:09 PM
To: Mark Volz; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] RE: using pattern or nullformat in templates - Mapserver 5.4

Patterns are always a regex so the //'s aren't needed. Try:

  [item name="PHYZIP" pattern="^[1-9]"]

Steve

From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Mark Volz
Sent: Wednesday, February 08, 2012 2:30 PM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] RE: using pattern or nullformat in templates - Mapserver 5.4

Hello,

I may have answered my own question. The following line works, however it has a mismatched number of brackets so it could be better written.

[item name="PHYZIP" nullformat="No Site Address" pattern=/^[1-9]

How would I rewrite this line of the template so that it is clean?

Thank You

Mark Volz
GIS Specialist


_____________________________________________
From: Mark Volz
Sent: Wednesday, February 08, 2012 2:17 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: using pattern or nullformat in templates - Mapserver 5.4


Hello,

I am trying to display an address as part of my identify parcel template.  The template works fine for parcels that have a valid address.  However, for parcels that do not have an address a "0" is displayed (the zip field is a integer).  How can I change the results so that either nothing, or a message such as "no site address" is displayed?


When I try to use pattern:

*         [item name="PHYZIP" pattern=/^[1-9]/]   - displays the address if there is one, or "1/]" is there is not an address.
*         [item name="PHYZIP" pattern="/^[1-9]/"]  - crashes

Nullformat appears to only work with strings that are null, not integers that are 0.  Is there a way to set a nullvalue, for example:
*         [item name="PHYZIP" nullformat="No Physical Address" nullvalue="0"]

Thanks




Mark Volz
GIS Specialist


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120208/ad0be5e1/attachment.htm>


More information about the MapServer-users mailing list