Shapefile field problem

Abe Gillespie agillesp at VT.EDU
Thu Dec 2 11:19:01 EST 2004


I used ogrinfo and it shows all the fields just fine.  Specifically I'm
trying to get a roads layer to work.  I need to use the NAME field for
labeling and querying.  But MapServer doesn't seem to recognize this
field (or any other fields past NAME).  Oh, also, this is my MapServer
configuration:

MapServer version 4.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=WBMP
SUPPORTS=FREETYPE INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=SHAPEFILE

Thanks.
-Abe

On Dec 2, 2004, at 9:58 AM, Abe Gillespie wrote:

> A good amount of fields aren't showing up in MapServer for me.  I use
> the following PHP script to dump out all layers and their fields for
> debugging.  Does MapServer have problems with certain data types or
> certain values in a row?
>
> Thanks for any help.
> -Abe
>
> [snip]
> for ($i = 0; $i < $map->numlayers; $i++)
> {
>        $l = $map->getLayer($i);
>        putBrLine($l->name);
>        if ($l->type == 2)  // Shape files with data.
>        {
>                $l->open();
>                $s = $l->getShape(-1, 0);
>                $vals = $s->values;
>                while ($fld = current($vals))
>                {
>                        putBrLine("&nbsp;&nbsp;".key($vals));
>                        next($vals);
>                }
>                $s->free();
>                $l->close();
>        }
> }
>



More information about the mapserver-users mailing list