[mapserver-dev] RFC49: mapfile simplifications and symbologyenhancements

Bob Basques Bob.Basques at ci.stpaul.mn.us
Thu Dec 4 17:24:24 EST 2008


All,

I've worked in this area a couple of times this past year.  While I agree that the MapFiles can get smaller with these changes, I kinda like the (old) verbose approach to the MapFile definitions, leaves things easier to find (in my mind).

But . . . I wonder, with the recent fractional capabilities that are available, should this type of styling be re-thought.

An idea that comes to mind:

*  Can a method be devised in the MapFile to define upper/lower limits, and let MapServer figure out the in betweens on it's own,  This would also start some of the work required for Color ramping since the same sort of algorithm is needed.

Something along these lines in the Mapfile for example:

class # One class for displaying a "Multi-line" Object.
   minscaledenom 100000
   style
       MINwidth 3
       color grey  #the outline color
   end
   
##OPTIONAL, if not present, the line is scaled based on the above ratio, or some such . . .
   style
       MAXwidth 7.5
       color grey  #the outline color
   end


   style
      MINwidth 1
      color white
   end

##OPTIONAL, if not present, the line is scaled based on the above ratio, or some such . . .
   style
      MAXwidth 3
      color white
   end
   maxscaledenom 200000
end

Mapserver handles all display criteria based on view scale (or it could be user [MapFile] defined step values I suppose).

All sorts of disappearing outline configurations would be possible.

Could even remove the second pair of STYLE blocks altogether if desired.  It could be reboiled into some method for adding the Scaling into the Style Block as well.  Anyway, this REALLY simplifies everything.  :c)

This was just a quick stab at it here during the discussion thread, I'm already revamping it some in my head, where there would be some facility for maintaining a constant ForeGround (top level) line width, and then just specify the outline width once for a scale range, or vise versa, which would apply more to scaling the lines based on view size, could even mix in the notion of changing the color ramp at the same time, fading out classes gradually as you zoom away.

Obviously more discussion here.  Another Item I'm very interested in, is the ability to build some sort of automated front end onto the MapFile building.  Would this be approriate to keep in this thread as well, since I believe the best chance for success with something like this, may require doing things in pieces.  But that's just me.

Anyway, this is what I do.  Stir the pot so to speak.  :c)


bobb




>>> "thomas bonfort" <thomas.bonfort at gmail.com> 12/04/08 3:50 PM >>>
> I don't have any more comments on the proposed changes. I don't see strong
> benefits for all of them, but if others do them I'm fine with what is
> proposed.

As I said, some of the modifications don't add much functionality, but
reduce mapfile size and maintainance. I agree that the benefits aren't
widespread, but for road layers rendering there is imho a great
advantage.

I'll take the example of a single class of road types, eg. primary
roads, where you want them to be rendered as a uniform-colored line
for far off zooms, and an outlined color for closer ones (with the
name of the roads that show up when you get a bit closer)

* with the current mapfile keywords, your layer would look something like:

class    #for far off views, just a uniform line
  minscaledenom 200000
  style
    color grey
    width 1
  end
end

class #for closer views when an outline appears
 minscaledenom 100000
 maxscaledenom 200000
 style
  width 3
  color grey  #the outline color
 end
 style
   width 1
   color white
 end
end

class #closer view, a bit wider
 minscaledenom 50000
 maxscaledenom 100000
 style
  width 4
  color grey
 end
 style
  width 2
  color white
 end
end

class #closer view, now labels appear
 minscaledenom 25000
 maxscaledenom 50000
 style
  width 5
  color grey
 end
 style
  width 3
  color white
 end
 label
   [snip label definition]
 end
end

[snip repeating this pattern for each scale you want to serve your map
in, each time widening the line widths and repeating the label
definition]

repeat this process for each road class (motorways, trunk roads,
secondary roads, etc...)



* with the proposed changes, the equivalent symbology can be obtained with

sizeunits meters
class
  style
    maxscaledenom 200000
    width 15 #in ground meters
    maxwidth 15 #in pixels, largest width for close up views
    minwidth 1 #in pixels
    color white
    outlinecolor grey
    outlinewidth 1
 end
 style #for roads from far off zoom
   minscaledenom 100000
   color grey
   minwidth 1
   maxwidth 1
 end
 label
   maxscaledenom 50000
   [snip label definition]
 end
end



from a mapfile maintainance point of view, I know which one I prefer :)
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list