Decode values in CGI query mode

Ken Lord kenlord at GMAIL.COM
Mon Dec 13 12:40:54 EST 2004


Hi Daniele,

You may be able to setup variable pairs in the mapfile, I believe that
is a new feature in versions 4 and younger.

Another way you might want to do it, especially if there are a lot of
codes, would be to setup a simple database with a table containing the
codes and descriptions.

I have done this in my query results pages, the result templates
create links for each result that contains the code, following the
link activates an ASP page that reads and uses the code, and reads the
database. This can add a lot of information to your website that
otherwise might be hard to get at, and you can then format the data to
better suit your needs.

This is great for querying drill hole data on a mining exploration
map. query a drill hole, follow a link and end up with a table of
drill hole assays or geologic intersections generated on the fly.

On other websites I have used this technique to link queried data to a
flash database application (built by another person at my job, long
before we played with MapServer) .. to make interactive charts of data
tied to a point on the map.

I'm sure there's plenty of other open source ways to do the same thing.

Cheers,
Ken Lord
Vancouver



On Mon, 13 Dec 2004 10:44:30 +0100, Daniele Margotti
<margottid at comune.lugo.ra.it> wrote:
>
> Hi list,
> I use CGI MapServer for browsing and querying shapefile-based maps.
>
> This is the version:
> <!-- MapServer version 4.2.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> OUTPUT=PDF SUPPORTS=FREETYPE INPUT=EPPL7 INPUT=OGR INPUT=GDAL
> INPUT=SHAPEFILE -->
>
> In a shapefile I have a numeric field which is a codified value (i.e.:
> values 0, 1, 2, ... each corresponding to a very long description of the
> attribute).
> I don't want / can't modify the shapefile and/or the .DBF file, and I'd like
> to set this long description ONLY ONE TIME in the mapfile, so that when I
> query the map I don't see the anonymous numeric values but MapServer decodes
> and substitutes them with my more exausting long description.
>
> Is it possible to set these substitutions in the mapfile?
>
> Thank you,
>     Daniele
>



More information about the mapserver-users mailing list