Opened 15 years ago
Closed 15 years ago
#814 closed defect (fixed)
attribute reference in mapfiles are exported with index instead of fieldnames
Reported by: | jef | Owned by: | jef |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | MapServer export | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
when a qgis project is converted to a mapfile the references to layer attributes are exported as field index instead of field name, eg. LABELITEM 0 instead of the name of the first field. Same applies to CLASSITEMs.
AFAICS this cannot be easily fixed, because the project file doesn't contain information about the attribute names. Maybe that should be changed anyway as the attributes or their order in the table might change, although the references fields still exists.
Change History (6)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
This doesn't apply to CLASSITEMs as they are written explictly be name.
I'll add a attribute containing the name of the field to the label tag in vector layers and add support for that in the mapexport.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
fixed in r7448, but the project needs to be resaved before it'll work.
comment:4 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This doesn't work. The default label text is being written to the XML rather than the name of the label field. I think the changes may need to be made in QgsLabel::writeXML in order to get the correct field name.
comment:5 by , 15 years ago
how does the default label text get exported?
AFAICS QgsLabel::labelField(Text) either returns the correct fieldname or an empty string. The empty string case is now covered in r7453, although the mapserver export doesn't set empty LABELITEMs anyway.
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This requires a change in the QgsProject code to either:
Item 1 is probably the simplest at present and wouldn't impact existing project read/write routines.
The mapserver exporter currently has no way to open data sets and retrieve the field information, given we are dealing with file-based and PostGIS data stores.