Opened 20 years ago

Closed 19 years ago

Last modified 19 years ago

#815 closed enhancement (fixed)

Add a new HATCH symbol type.

Reported by: sdlime Owned by: sdlime
Priority: high Milestone:
Component: MapServer C Library Version: 4.3
Severity: minor Keywords:
Cc: jmckenna@…

Description

Needed to provide arbitrary rotation for cross-hatching. Some folks in Germany 
need this to meet some cartographic requirements set forth by their 
government. 

The base code is already there, and really ammounts to nothing more than an 
extra symboltype in the symbol file reading code and an extra case statement 
in the polygon file code for GD. The implementation itself will be a single 
function that builds a custom fill image based on STYLE values. The image will 
be the same size as the feature to be filled so there is no problem at tile 
seams. Performance in test code doesn't seem bad at all...

Steve

Change History (11)

comment:1 by dmorissette, 20 years ago

Cc: jlacroix@… added
Steve, I see that this is partly implemented in 4.3. Could you please add a
sample hatch symbol definition to this bug?

comment:2 by sdlime, 20 years ago

Status: newassigned
Yup, it's mostly there. The symbol definition is really basic:

SYMBOL
  NAME 'hatch'
  TYPE HATCH
END

I need to add support for patterns so you can have dashed hatching so you could 
see a STYLE ... END block too. (BTW I'd like to switch from STYLE to PATTERN in 
a SYMBOL, still maintaining backwards compatibility)

Note that I also added ANGLEITEM and SIZEITEM to the STYLE object and these are 
working. So you can pull symbol angles and sizes from attributes if you want. 
Arnulf is testing from PostGIS and all seems well.

Steve

comment:3 by sdlime, 19 years ago

Resolution: fixed
Status: assignedclosed
This is all there, just need to document. Will add a seperate bug for that.

Steve

comment:4 by jmckenna@…, 19 years ago

question: am i correct that the only way to modify the angle of the 'hatched'
lines is through the new ANGLEITEM parameter?  (I discovered that you can also
modify the hatch distance through the STYLE's SIZE parameter, as well as the new
SIZEITEM)

comment:5 by jmckenna@…, 19 years ago

Cc: jmckenna@… added

comment:6 by sdlime, 19 years ago

You can use the style angle parameter to set a static angle and can also change 
the thickness of the hatched lines using the WIDTH parameter. Probably should 
document that one to eh?

  - a size refers to the "size" of a symbol, most often given as the height 
given in pixels

  - the width refers to the "thickness" of line work drawn without a brush (no 
more pre-defining a 'circle')

So, for example to draw a 3 pixel width line you just do:

  STYLE
    COLOR 255 0 0
    WIDTH 3
  END

There are MINWIDTH/MAXWIDTH parameters too. This was added about the same time 
as the hatching as I upgraded the GD specific code. GD has a function to set 
line width that we use.

Steve

comment:7 by jmckenna@…, 19 years ago

thanks.  i had no idea that the style object had an angle parameter.  must be in
another bug.

comment:8 by jmckenna@…, 19 years ago

for your 'size' definition, i would add 'For symbols of TYPE HATCH, this is the
distance between lines'.  you agree?

Also, I am trying to see MINWIDTH and MAXWIDTH to work in an example, can you
provide an example, or how to show these working?  i can't see to get those to work.


comment:9 by sdlime, 19 years ago

Actually the angle has been around since styles were added, it's just that no
symbols actually leveraged it until now. Bet you didn't know you can do pie
charts too...

Steve

comment:10 by jmckenna@…, 19 years ago

Steve 1 question:

Were STYLE...END blocks enabled for type hatch?  (i'm trying to produce dashed
hatched lines and cannot)


comment:11 by jmckenna@…, 19 years ago

for everyone's record, through bug#1357 i added the following to the
mapfile-reference doc:

ANGLEITEM
ANGLE
SIZEITEM
SIZE (modified)
WIDTH
MINWIDTH
MAXWIDTH
Note: See TracTickets for help on using tickets.