Opened 22 years ago

Closed 20 years ago

Last modified 20 years ago

#184 closed defect (fixed)

[OGR] Problem with labels coming from OGR/ArcInfo Coverage layer

Reported by: dmorissette Owned by: dmorissette
Priority: highest Milestone: 4.4 release
Component: OGR Support Version: 4.0
Severity: normal Keywords:
Cc: jmckenna@…

Description

We seem to have a problem with labels coming from an OGR/ArcInfo Coverage layer. 
 This test was made by converting the popplace.shp file from the GMap demo from 
shapefile to arc/info binary coverage format.  I'll attach a sample map that 
shows the problem: the labels are in very odd locations.

Jeff McKenna wrote:
> 
> I converted the popplace.shp shapefile used in the gmap mapfile into a 
coverage,
> added CONNECTION and CONNECTIONTYPE in the layer, that is it.  Yes we should
> investigate this.
> 
>   LAYER
>     NAME "popplace"
>     STATUS ON
>     #DATA "popplace"
>     CONNECTIONTYPE OGR
>     CONNECTION "/home/msapps/gmap-ogr-cov/data/popplace, TAB"
>     TYPE POINT
>     CLASSITEM "CAPITAL"
>     LABELITEM "NAME"
>     TOLERANCE 5
>     METADATA
>       "DESCRIPTION"    "Cities"
>       "RESULT_FIELDS"    "NAME"
>     END
>     CLASS
>       NAME "Cities"
>       EXPRESSION "1"
>       SYMBOL 2
>       COLOR 0 0 0
>       SIZE 8
>       TEMPLATE "ttt_query.html"
>       LABEL
>         FONT "fritqat-italic"
>         TYPE truetype
>         POSITION AUTO
>         SIZE 8
>         COLOR 255 0 0
>         OUTLINECOLOR 255 255 255
>         PARTIALS FALSE
>       END
>     END
>     CLASS
>       NAME "Cities"
>       EXPRESSION /2|3/
>       SYMBOL 7
>       COLOR 0 0 0
>       SIZE 6
>       TEMPLATE "ttt_query.html"
>       LABEL
>         FONT "fritqat"
>         TYPE truetype
>         POSITION AUTO
>         SIZE 8
>         COLOR 0 0 0
>         OUTLINECOLOR 255 255 255
>         PARTIALS FALSE
>       END
>     END

Attachments (1)

ogr-label-map.gif (28.2 KB ) - added by dmorissette 22 years ago.
Map image showing the problem

Download all attachments as: .zip

Change History (9)

by dmorissette, 22 years ago

Attachment: ogr-label-map.gif added

Map image showing the problem

comment:1 by dmorissette, 22 years ago

Jeff McKenna wrote:
> 
> my layer CONNECTION is actually:
> 
>     CONNECTION "E:\msapps\gmap_36\gmap\data\popplace, LAB"
> 
> same results using layer_index:
> 
>     CONNECTION "E:\msapps\gmap_36\gmap\data\popplace, 0"

comment:2 by jmckenna@…, 22 years ago

Cc: warmerdam@… added
Note that I put this on Xcalibur at 
http://www2.dmsolutions.ca/msapps/gmap-ogr-cov/htdocs/gmap75.phtml.

Also, the CONNECTION should be:
CONNECTION "/home/msapps/gmap-ogr-cov/data/popplace, LAB"

And I also tested it using the layer_index:
CONNECTION "/home/msapps/gmap-ogr-cov/data/popplace, 0"

comment:3 by dmorissette, 21 years ago

Cc: lacroix@… added
Owner: changed from lacroix@… to morissette@…
Priority: highhighest
Reassigned to myself.  

This labelling issue still happens with v3.6, and it crashes v4.0

comment:4 by dmorissette, 20 years ago

Milestone: 4.4 release

comment:5 by dmorissette, 20 years ago

Status: newassigned
Problem still present in MapServer 4.4. Looking into this now, I would suspect a
problem with trailing spaces in attribute values coming from Arc/Info coverages
through OGR.

comment:6 by dmorissette, 20 years ago

I quickly hacked OGRAVCLayer::TranslateTableFields() (ogravclayer.cpp) to remove
trailing spaces on string attributes and the labels all show up properly, so
this is definitely the problem.

Now I need to dig into the AVCE00 lib to decide if the removing of trailing
spaces should be done by AVCE00 or by the OGR driver.

comment:7 by dmorissette, 20 years ago

Resolution: fixed
Status: assignedclosed
It seems that AVCE00GenTableRec() in avc_e00gen.c expects the string attributes
to be padded with spaces so instead to risk breaking the AVCE00 lib, I just
decided to remove the trailing spaces in OGRAVCLayer::TranslateTableFields().

Committed a fix to the GDAL CVS, should be in the next release (1.2.4 or 1.3.0)

comment:8 by fwarmerdam, 20 years ago

Thanks Daniel.  I hope to issue a 1.2.4 release within a week or so. 
Note: See TracTickets for help on using tickets.