Opened 12 years ago

#4164 new defect

TextSymbolizer gets lost with generateSLD

Reported by: guillaume Owned by: sdlime
Priority: normal Milestone:
Component: MapScript Version: 6.0
Severity: normal Keywords: SLD, textSymbolizer
Cc:

Description

Not really a bug, but not a feature either... When you generate a map piece with applySLD, if there is a TextSymbolizer it is translated into a TEXT "[theField]" part of the CLASS block. When you want your SLD back from the mapfile, generateSLD only looks into LABELITEM at LAYER's level. So you lose your TextSymbolizer in the returned SLD. I did a quick and dirty fix for my usage I wouldn't dare to show here, but the main idea is : mapogcsld.c, lines 4035sqq : change :

    if (psClass && psLayer && psLayer->labelitem &&
       strlen(psLayer->labelitem) > 0)

to something which tests psClass->text too.
3 lines further, change

    snprintf(szTmp, sizeof(szTmp), "<%sLabel>%s</%sLabel>\n",  sNameSpace,psLayer->labelitem, sNameSpace);

to apply the correct item used to label.

Best regards

Change History (0)

Note: See TracTickets for help on using tickets.