Opened 13 years ago
Last modified 13 years ago
#3667 assigned defect
Serious DGN label rendering issue since MS 5.4.x
Reported by: | nilpohc | Owned by: | dmorissette |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR Support | Version: | unspecified |
Severity: | major | Keywords: | |
Cc: | warmerdam |
Description (last modified by )
Since MapServer 5.4.x (maybe before but 5.0.x was all right and i never tried 5.2.x) i’m facing a very annoying issue concerning DGN annotation layers : when trying to deal with text orientation, both STYLEITEM « AUTO » and manual styling using [OGR :Label…] attributes fails. Debug mode shows that LabelAngle is always read as zero while text string and color are correctly read.
Worse : i tried with more recent releases of GDAL and/or MS (home made or MS4W ones) but they always crash when i’m trying to use [OGR :LabelSize] (other attributes behave fine except - still - the angle). When it happens, the debug file shows that every attributes is read as empty or zero.
The last working context was GDAL 1.5.2 with MS 5.0.3, and only the DGN format seems to be impacted (MITAB stills behaves OK). The OGR style string seems correct, and changing the parameters order (so that it looks like MITAB’s) didn’t help.
The code in mapogr.cpp seems fine and except the conditional compilation settings regarding OGR Style C API which was not used in MS 5.0.x i don’t know what could cause this behaviour, except the OGR DGN driver itself (memory handling issue ?).
Attachments (1)
Change History (7)
by , 13 years ago
Attachment: | 77186v7.zip added |
---|
comment:1 by , 13 years ago
Component: | MapServer C Library → OGR Support |
---|---|
Owner: | changed from | to
Severity: | normal → major |
follow-up: 5 comment:3 by , 13 years ago
Results of tests with MapServer 5.6.6 and GDAL/OGR 1.8.0:
According to OGRINFO, there is only one record in your DNG file that contains a label, it is a POINT feature and OGRINFO returns the following for it:
OGRFeature(elements):102 Type (Integer) = 17 Level (Integer) = 7 GraphicGroup (Integer) = 0 ColorIndex (Integer) = 5 Weight (Integer) = 0 Style (Integer) = 0 EntityNum (Integer) = (null) MSLink (Integer) = (null) Text (String) = SOUS-PREFECTURE Style = LABEL(t:"SOUS-PREFECTURE",c:#ff00ff,s:4.000g,a:-23) POINT (626219.28 78198.89)
the rest of the features in the file are POLYGONs with no label info and a NULL Text attribute.
Using "ANGLE [OGR:LabelAngle]" in a LABEL definition works for me with Mapserver 5.6.6 and this feature is drawn at the right angle.
However, using STYLEITEM AUTO results in a bitmap font being used and label angle being ignored (this may be a bug to address later, caused by the fact that the DGN driver does not specify a font name in its StyleStrings)
You wrote "Debug mode shows that LabelAngle is always read as zero while text string and color are correctly read."... it is correct that LabelAngle is always zero since all features except the one above do not have a LABEL() style definition, but I do not see any Text value in my case, so maybe the difference is related to different OGR versions being used?
I also do not get any crash when using [OGR:LabelAngle], but perhaps if you could provide a complete testcase (mapfile, etc.) then I could try to use it to reproduce it.
comment:4 by , 13 years ago
follow-up: 6 comment:5 by , 13 years ago
Thanks for your quick reply Daniel.
I'm already aware of the STYLEITEM AUTO bug incorrectly using a bitmap font (but it should try to use the "default" truetype font mapping as it used to do in earlier versions). Maybe i should add a ticket for this one too. Anyway, forcing the code to use a truetype font didn't help.
Concerning the debug mode, actually it was only on the labels layer, so the zeros are not related to other types of layers. Besides, did you manage to reproduce the [OGR:LabelSize] crash ?
Since the attachment size limit is 256KB, i had no other choice than cropping the original DGN file, hence the single LABEL you found (i already sent the full one to Frank Warmerdam using direct e-mail, but maybe the 2 Mo file was too large despite the 7z compression). I did'nt take the time to run tests with this small sample.
comment:6 by , 13 years ago
Oops, i just noticed your comment about Valgrind info. OK, i'll give the SVN build a try before the end of the week (i hope so).
Thx.
Archive containing DGN file and PNG screenshot