Opened 15 years ago

Closed 15 years ago

#2948 closed defect (fixed)

RFC 55 implementation: Improve control of output resolution

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 5.6 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords: output, resolution
Cc: dmorissette, tbonfort, assefa, cnieman

Description

Ticket to track changes with regards to RFC 55, output resolution:

http://mapserver.org/development/rfc/ms-rfc-55.html

Attachments (1)

MAXWIDTH_example.zip (2.1 KB ) - added by cnieman 15 years ago.
sample

Download all attachments as: .zip

Change History (11)

comment:1 by aboudreault, 15 years ago

Cc: tbonfort added

comment:2 by aboudreault, 15 years ago

A good part of this task have been done. Here's some notes i've took during the implementation:

  • mapdraw.c
    • msDrawLabel()
      1. Added scaling for these label values: backgroundshadowsizex, backgroundshadowsizey, offsetx, offsety (label)
    • msDrawLabelCache()
      1. Added scaling for these label values: backgroundshadowsizex, backgroundshadowsizey, offsetx, offsety, buffer, mindistance (label)
    • msDrawShape()
      1. Scale this value: minfeaturesize (label)
    • msDrawVectorLayer()
      1. Scale this value: outlinewidth (line)
  • mapgd.c
    IMP: Most of outlines cannot be scaled with the current version of GD.
    • msDrawTextGD()
      1. Scale these values : shadowsizex, shadowsizey (label)
    • msDrawTextLineGD()
      1. Scale these values : shadowsizex, shadowsizey (label)
    • msDrawLineSymbolGD() :
      1. Added pattern scaling. (line)
      2. pixmap symbols don't support scaling (line)
    • msDrawShadeSymbolGD() :
      1. Added gap scaling for truetype symbols (line) TO RECHECK
      2. No gap support for ellipse, vector symbols
      3. No pattern support pattern for hatch symbols

  • mapagg.cpp
    • msDrawTextAGG()
      1. Scale these values : outlinewidth, shadowsizex, shadowsizey (label)
    • msDrawTextLineAGG()
      1. Scale these values : outlinewidth, shadowsizex, shadowsizey (label)
    • msDrawLineSymbolAGG()
      1. Added pattern scaling (line)
      2. filled vector symbols are not scaled (line)
      3. vector symbols don't support pattern (line)
      4. pixmap symbols don't support scaling (line)
    • msDrawShadeSymbolAGG()
      1. Added pattern scaling
      2. pixmap symbols don't support scaling
    • msDrawMarkerSymbolAGG()
      1. Added offset scaling (Marker)
  • maplabel.c
    • msTestLabelCacheCollisions()
      1. Added mindistance parameter
    • msImageTruetypePolyline()
      1. label.size scaling removed: this size is already scale in msDrawTextGD().
  • mapimagemap.c
    • msDrawLineSymboldIM()
      1. Added pattern scaling
    • msDrawMarkerSymbolIM()
      1. Added offset scaling
  • mappdf.c
    IMP: not fully supported no backgroundcolor / backgroundshadow ...
    • drawDashedPolylinePDF() : added pattern scaling
    • msDrawMarkerSymbolPDF() : doesn't not take offset in account
  • mapsvg.c
    IMP: not fully supported no backgroundcolor backgroundshadow
    • msDrawLineSymbolSVG() : added pattern scaling, NO gap
    • msDrawShadeSymbolSVG() : added pattern scaling
  • mapswf.c
    IMP: not fully supported no backgroundcolor / backgroundshadow...
    • draw_textSWF: no outlinewidth support
    • msDrawLineSWF(): not implemented... no lines with symbols support, no gap, pattern etc..

comment:3 by aboudreault, 15 years ago

Cc: assefa added

Committed in SVN trunk in r8843.

Assefa, may you run your series of tests with the trunk pls? Thanks

comment:4 by cnieman, 15 years ago

I'm not sure if Assefa has taken a look at the code you committed yet, but we just realized that the maximum width of symbols is set to 32 unless otherwise specified. So MAXSCALE for each style needs to be scaled (or changed in some other way).

comment:5 by cnieman, 15 years ago

oops, sorry that should be MAXWIDTH

comment:6 by aboudreault, 15 years ago

Cc: cnieman added

So, that those 4 values should be scaled too: style->maxwidth, style->minwidth, style->minsize, style->maxsize. cnieman, perhaps you have a small test case to attach in the ticket ? It would allow me to quickly test my changes.

Assefa, I think you have a few applications that use different output resolution ? Am I right? Maybe it would be a good idea to test them with a MS 5.6 beta before the official release ?

comment:7 by dmorissette, 15 years ago

Milestone: 6.0 release5.6 release

Since this has been committed in the code a while ago, and was part of the first few 5.6 betas, would it not be better close this ticket and open new ones if there are issues?

comment:8 by assefa, 15 years ago

Alan,

we still use 5.4 for production. That's why I did not do a full test on this feature yet. Hopefully Christy has a test case showing the need to scale MAX/MIN-WIDTH/SIZE.

Daniel,

Opening new tickets is ok with me. If the fixes are easy I would suggest keeping them here for easy reference.

by cnieman, 15 years ago

Attachment: MAXWIDTH_example.zip added

sample

comment:9 by cnieman, 15 years ago

I've attached an example with three line styles. When we scaled these styles for print [(width/resolution)*dpi] which was, for example, in the first class of the attached sample, [(16/96)*300 = 50] and [(10/96)*300 = 31.25] we found that the ratio between the two line widths was not consistent with what was displayed with no scaling; the line that should have had a width of 50 was only getting drawn with a width of 32 because of the default MAXWIDTH value. When MAXWIDTH was set using the same scaling calculation, the lines were drawn with the correct ratio between the widths.

comment:10 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

This implementation is done. Let's track issues in new tickets.

Style MAXWIDTH issue: http://trac.osgeo.org/mapserver/ticket/3153

Note: See TracTickets for help on using tickets.