Opened 17 years ago
Closed 16 years ago
#2311 closed defect (fixed)
OGR:Label* attributes should return default values for objects with no label
Reported by: | dmorissette | Owned by: | aboudreault |
---|---|---|---|
Priority: | normal | Milestone: | 5.4 release |
Component: | OGR Support | Version: | 5.0 |
Severity: | normal | Keywords: | |
Cc: | dmorissette |
Description
Jelmer Baas wrote to mapserver-users:
> > 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!?! >
And I replied...
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, returning some default values (text="", angle=0 and size=0) in cases where the object is not of the right type.
I filed this an a future enhancement. In the meantime you'll have to make sure the files you use for annotation contain only objects of type TEXT.
Attachments (1)
Change History (6)
comment:1 by , 16 years ago
Milestone: | 5.2 release → 5.4 release |
---|
comment:2 by , 16 years ago
Cc: | added |
---|---|
Owner: | changed from | to
by , 16 years ago
Attachment: | bug2311.patch added |
---|
Here's the patch that will make the msOGRGetValues() function return default values if the object type is not TEXT.