[mapserver-users] Polygon outline not drawn in PDF output if polygon is not filled

Anzel, Phil - Fort Collins, CO Phil.Anzel at ftc.usda.gov
Fri Jun 11 12:07:19 EDT 2010


Hi,

It appears that a polygon's outline does not appear in a PDF image unless the polygon is also filled.

Consider this MAP file:

  MAP
    OUTPUTFORMAT
      NAME    pdf
      DRIVER  pdf
    END
#    OUTPUTFORMAT
#      NAME png
#      DRIVER "GD/PNG"
#    END
    EXTENT         643507 5660466 646127 5661655
    SIZE           800 400
    IMAGECOLOR     255 255 255
    PROJECTION     "init=epsg:32633"  END
    LAYER
      NAME    test_polygon
      STATUS  ON
      TYPE    POLYGON
      FEATURE
         WKT 'POLYGON ((645000 5660900, 645500 5660900, 
                        645500 5661000, 645000 5661000,
                        645000 5660900))'
      END
      CLASS
        STYLE
          #COLOR        0   255 0
          OUTLINECOLOR 255   0 0
        END
      END
    END
  END

Case 1: Unfilled polygon, PDF output: As written above, the PDF output is empty. This is the problem case.

Case 2: Filled polygon, PDF output: If the "#COLOR" line is uncommented, the green-filled polygon, complete with red outline, is drawn. 

Case 3: Unfilled polygon, PNG output: If I switch to PNG output (by uncommenting the OUTPUTFORMAT for PNG and commenting-out the PDF one) and revert to "#COLOR" (thereby disabling polygon fill), the unfilled red outline is drawn in the PNG output.

Case 4: Filled polygon, PNG output: With PNG output and fill COLOR enabled, the filled green polygon with red outline is drawn to the PNG output.

Is this a defect? Could you suggest a work-around for unfilled polygon PDF output?

A secondary observation: Using a filled polygon for PDF, use of a "WIDTH" parameter appears to have no effect upon the width of the outline.

I'm using MapServer version 5.6.3 (MS4W distribution) under Windows XP Pro 2002 SP3. The problem was demonstrated with use of the "drawmap.exe" command-line utility.

Thanks in advance,

- Phil Anzel



More information about the mapserver-users mailing list