Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3631 closed defect (fixed)

Transformation from XML to MapFile only handles one PROCESSING element

Reported by: Iregart Owned by: aboudreault
Priority: normal Milestone:
Component: MapFile XML Schema Version: 5.6
Severity: normal Keywords: XML, XSL, XSLT, MapFile, Transformation, Processing
Cc:

Description

Hello Mapserver team,

I encountered a bug, transforming a mapfile XML to the mapfile format. It seems, that only one PROCESSING element is written into the resulting mapfile, even if there are more defined in the XML.

Here is what I did:

  • I used only the contents of the folder xmlmapfile, contained in the 5.6.5 source release.
  • I used the mapfile.xsd to create a source binding (JAVA) in a Eclipse plug-in.
  • The binding classes I used to create the contents of the mapfile XML in memory.
  • Then I transformed the mapfile XML into the original mapfile format, using the mapfile.xsl.
  • The written mapfile only contains one PROCESSING directive, even if I add two elements into the XML.

This is, how I fill the processing element of a layer:

    double min = 0.0;
    double max = grid.getMax();
    double buckets = Math.floor( max / 0.05 );

    List<String> processing = layer.getProcessing();
    processing.add( String.format( Locale.PRC, "SCALE=%.2f %.2f", min, max) );
    processing.add( String.format( Locale.PRC, "SCALE_BUCKETS=%d", (int) buckets ) );

This is the result of the transformation:

MAP

NAME "Raster"
STATUS ON
EXTENT 3682646.0 5358058.0 4080506.0 5816758.0
IMAGECOLOR 255 255 255
PROJECTION
  "init=EPSG:31467"
END
SIZE 58 67
UNITS meters
WEB
  METADATA
    "wms_title" "Raster"
    "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=mapserver.map&"
    "wms_srs" "EPSG:31467"
  END
END

LAYER
  NAME "raster_1"
  TYPE RASTER
  STATUS ON
  CLASS
    EXPRESSION ([pixel] <= 0.50)
    STYLE
      COLOR 123 0 0
      
    END
    
  END
  CLASS
    EXPRESSION ([pixel] > 0.50)
    STYLE
      COLOR 255 0 0
      
    END
    
  END
  DATA "raster_1.tif"
  
  METADATA
    "wms_title" "Raster #1"
    "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=mapserver.map&"
    "wms_srs" "EPSG:31467"
    "wms_extent" "3682646.000000 5358058.000000 4080506.000000 5816758.000000"
  END
  PROCESSING "SCALE=0.00 9.75"

  PROJECTION
    "init=EPSG:31467"
  END
END
END

If you need more information, please ask.

Best regards,
Holger Albert

Change History (6)

comment:1 by aboudreault, 13 years ago

Status: newassigned

comment:2 by aboudreault, 13 years ago

Resolution: fixed
Status: assignedclosed

Fixed and committed in r10803. You can simply replace the trunk/xmlmapfile/mapfile.xsl and use it.

comment:3 by Iregart, 13 years ago

Hi aboudreault,

I checked out the new mapfile.xsl and it worked like a charm.

Thank you very much.

Best regards, Holger Albert

comment:4 by Iregart, 13 years ago

Hello Mapserver team,

it seems that the PROCESSING issue reappeared in the 5.6.6 source release. I continued using the file trunk/xmlmapfile/mapfile.xsl. Is the file on trunk a newer one? Perhaps for an upcoming release 5.7.0? Should this bug be reopened?

Greetings, Holger

comment:5 by aboudreault, 13 years ago

I just tested an XML file with 2 processing directives and both have been written in the mapfile.(Using the mapfile.xsl of trunk)

comment:6 by Iregart, 13 years ago

Thanks aboudreault,

I tested both, the trunk and the one of the 5.6.6 Release. The one of the trunk worked as well, but the one of the 5.6.6 Release did not. The 5.6.6 Release comes from a branch, right? So it may be a bug there, which is fixed in the trunk. Which may be not much of a problem :). Sorry that I have bothered you.

Best regards, Iregart

Note: See TracTickets for help on using tickets.