Opened 16 years ago

Closed 15 years ago

#2733 closed defect (fixed)

OGR : non styled image is returned when STYLEITEM "AUTO" is used with data are specified

Reported by: elzouavo Owned by: aboudreault
Priority: high Milestone: 5.4 release
Component: OGR Support Version: 5.2
Severity: critical Keywords:
Cc: dmorissette, warmerdam

Description

I use MapServer 5.2 from ms4w. I have a tab file. STYLEITEM "AUTO" works fine until I specify DATA. The raster returned by MapServer is not styled when I use STYLEITEM "AUTO" and when DATA are specified. If a replace STYLEITEM "AUTO" with a CLASS/STYLE block it works fine.

Example :

  • raster is OK with STYLEITEM "AUTO" and no DATA specified
      LAYER
        NAME c_Pays
        STATUS ON
        DUMP true
        TEMPLATE "blank.html"
        TYPE Polygon
        TOLERANCE 0
        TOLERANCEUNITS pixels
        CONNECTIONTYPE OGR
        CONNECTION "Pays.TAB"
        STYLEITEM "AUTO"
        CLASS
          NAME Pays
        END
        METADATA
          WMS_TITLE "Pays"
          WMS_EXTENT "290606.951595 2390636.950133 373819.981869 2534043.950618"
          ows_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_ID_PAYS_alias "ID_PAYS"
          gml_NOM_DE_PAYS_alias "NOM_DE_PAYS"
          gml_AVANCEMENT_alias "AVANCEMENT"
        END
    #    DATA "SELECT ID_PAYS,NOM_DE_PAYS,AVANCEMENT FROM Pays"
      END
    
  • raster is KO with STYLEITEM "AUTO" and DATA specified
      LAYER
        NAME c_Pays
        STATUS ON
        DUMP true
        TEMPLATE "blank.html"
        TYPE Polygon
        TOLERANCE 0
        TOLERANCEUNITS pixels
        CONNECTIONTYPE OGR
        CONNECTION "Pays.TAB"
        STYLEITEM "AUTO"
        CLASS
          NAME Pays
        END
        METADATA
          WMS_TITLE "Pays"
          WMS_EXTENT "290606.951595 2390636.950133 373819.981869 2534043.950618"
          ows_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_ID_PAYS_alias "ID_PAYS"
          gml_NOM_DE_PAYS_alias "NOM_DE_PAYS"
          gml_AVANCEMENT_alias "AVANCEMENT"
        END
        DATA "SELECT ID_PAYS,NOM_DE_PAYS,AVANCEMENT FROM Pays"
      END
    
  • raster is OK with DATA specified and CLASS/STYLE block used
      LAYER
        NAME c_Pays
        STATUS ON
        DUMP true
        TEMPLATE "blank.html"
        TYPE Polygon
        TOLERANCE 0
        TOLERANCEUNITS pixels
        CONNECTIONTYPE OGR
        CONNECTION "Pays.TAB"
        CLASS
          NAME Pays
          STYLE
            SYMBOL ligne_continue
            SIZE 2.0
            OUTLINECOLOR 255 0 0
          END
        END
        METADATA
          WMS_TITLE "Pays"
          WMS_EXTENT "290606.951595 2390636.950133 373819.981869 2534043.950618"
          ows_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_include_items "ID_PAYS,NOM_DE_PAYS,AVANCEMENT"
          gml_ID_PAYS_alias "ID_PAYS"
          gml_NOM_DE_PAYS_alias "NOM_DE_PAYS"
          gml_AVANCEMENT_alias "AVANCEMENT"
        END
        DATA "SELECT ID_PAYS,NOM_DE_PAYS,AVANCEMENT FROM Pays"
      END
    

Change History (7)

comment:1 by dmorissette, 16 years ago

Cc: dmorissette added
Milestone: 5.4 release
Owner: changed from dmorissette to aboudreault

Alan, can you please try to reproduce and check this when you have a chance?

comment:2 by aboudreault, 16 years ago

Sure, i will investigate on this as soon as possible, probably this week.

comment:3 by aboudreault, 16 years ago

Cc: wamerdam added

The problem not seems to be related to style item auto. I noticed that the problem could be in the OGR_DS_ExecuteSQL or OGRGenSQLResultsLayer function. If the layer is get by the OGR_DS_GetLayer function, there is no problem: the style string will be get via the TABRegion class. However, using the OGR_DS_ExecuteSQL function will result to a style string get via the OGRFeature class, so no style string.

Frank, do you have an idea of what we could do for solve this ?

comment:4 by aboudreault, 16 years ago

Cc: warmerdam added; wamerdam removed

comment:5 by warmerdam, 16 years ago

Daniel,

I can imagine two approaches. One is to modify the generic sql stuff to copy style strings when doing a SELECT (much as it now copies geometry even though they aren't in the request). The other approach would be to require the user to explicitly mention the special name for the OGR style string field in their SELECT and have a way for MapServer to use style strings in regular fields (something I prototyped for a client earlier this year and that I think has broader application).

But - right now a user cannot use SELECT statements in an MapServer DATA statement and still get style strings for the features.

comment:6 by aboudreault, 15 years ago

Status: newassigned

comment:7 by aboudreault, 15 years ago

Resolution: fixed
Status: assignedclosed

It bug has been fixed in gdal/ogr and will be included in gdal 1.6.1. The first approach has been adopted. The StyleString of the features are now copied like the geometry.

See related bug: GDAL Ticket 2808

Note: See TracTickets for help on using tickets.