Question about Labels
Daniel Morissette
dmorissette at MAPGEARS.COM
Thu Sep 13 06:04:06 PDT 2007
Jelmer Baas wrote:
>
> Thanks for your quick response. I tried to use OGR:LabelText, and it
> seems to work -- sometimes. For *some* layers I get this following,
> quite interesting, error:
>
> msDrawMap(): Image handling error. Failed to draw layer named 'topo'.
> msOGRGetValues(): OGR error. Invalid field index!?!
>
Jelmer,
I checked in the code, and it seems that you'd get that error if
MapServer tries to read one of the OGR:Label* attributes on a feature
that does not have a label definition, or in the case of TAB files, on a
MapInfo object that is not a TEXT object.
I am realizing just now that this makes it impossible to use OGR:Label*
on a .TAB file that has mixed object types. I think it would be possible
to make MapServer handle this more gracefully, i.e. returning some
default values (text="", angle=0 and size=0) in cases where the object
is not of the right type.
I created a ticket for this an a future enhancement
(http://trac.osgeo.org/mapserver/ticket/2311). In the meantime you'll
have to make sure the files you use for annotation contain only objects
of type TEXT.
Daniel
--
Daniel Morissette
http://www.mapgears.com/
More information about the MapServer-users
mailing list