[mapserver-users] point layer symbols

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Jul 6 11:47:51 EDT 2009


Hi Worth: When you define a vector symbol you're essentially defining a default
size as well (I believe) relative to 0,0. The SIZE you set is then used to scale the
symbol based on that default size. If things are anchored to 0,0 then it generally
works ok. I always try to work on the unit square (0,0,1,1) when defining symbols
although that's not required. Being relative to 0,0 is important.

Anyway, a symbol is always centered on the point. Where the actual point is depends
on how you laid out the symbol. To see this try adding another styleObj after your
main symbol like so:

CLASS
    NAME "Major Airport"
    EXPRESSION "MAJOR AIRPORT"
    STYLE
      COLOR 139 0 139
      SYMBOL 'airplane'
      SIZE 9
    END
    STYLE # a red pixel
      COLOR 255 0 0
    END
    ...
END

You should see a red pixel over your airplane. That may help explain why you see the
clicking issues you do. The placement is based on the bounds of the symbol (0,0,maxx, maxy)
so if a symbol is defined well away from 0,0 then odd things can happen. We hope to 
fix this in upcoming releases.

If you're having trouble with multiple results why not use mode=query instead of nquery?

Steve

>>> On 7/5/2009 at 4:56 PM, in message
<3684FED92D7A43618E4C56EDCE0ADB93 at Worthlaptop>, "Worth Lutz"
<wal3 at mindspring.com> wrote:
> Can anyone help describe how point symbols defined as type vector are placed
> upon the point on the map.
> 
> My symbol and layer are listed below.  I get a good looking symbols.
> 
>  
> 
> My problem occurs when clicking on this symbol (and others like a triangle)
> to query it.
> 
>  
> 
> If I click at the bottom of the airplane, I often get no results.
> 
>  
> 
> If I click above the top of the airplane, I can get results.
> 
>  
> 
> Raising the tolerance causes multiple results when the symbols are close
> together but not touching.
> 
>  
> 
> How is the box surrounding the symbol (the bounds of the symbol) placed upon
> the point on the map?  And how does size 9 in the class definition relate to
> the size of this box?  Can anyone shed some light on this for me? 
> 
>  
> 
> Thanks,
> 
> Worth
> 
>  
> 
>   SYMBOL
> 
>     NAME 'airplane'
> 
>     TYPE vector
> 
>     POINTS
> 
>     7 0
> 
>     6 1
> 
>     6 3
> 
>     0 4
> 
>     0 6
> 
>     6 5
> 
>     6 8
> 
>     3 8
> 
>     3 9
> 
>     11 9
> 
>     11 8
> 
>     8 8
> 
>     8 5
> 
>     14 6
> 
>     14 4
> 
>     8 3
> 
>     8 1
> 
>     7 0
> 
>     END
> 
>     FILLED TRUE
> 
>   END
> 
>  
> 
> LAYER
> 
>   NAME "airports"
> 
>   STATUS OFF
> 
>   TYPE POINT
> 
>   DATA "air"
> 
>   PROJECTION
> 
>     "init=epsg:32119" # NAD 83 North Carolina (meters US)
> 
>   END
> 
>   MAXSCALEDENOM 3750001
> 
>   TOLERANCE 7
> 
>   CLASSITEM "CLASS"
> 
>   LABELITEM "ARPT_NAME"
> 
>   CLASS
> 
>     NAME "Major Airport"
> 
>     EXPRESSION "MAJOR AIRPORT"
> 
>     COLOR 139 0 139
> 
>     TEMPLATE 'void'
> 
>     SYMBOL 'airplane'
> 
>     SIZE 9
> 
>     LABEL
> 
>       TYPE TRUETYPE
> 
>       MINFEATURESIZE 50
> 
>       MINDISTANCE 150
> 
>       POSITION UC
> 
>       FONT vera
> 
>       SIZE 7
> 
>       #SIZE SMALL
> 
>       COLOR 139 0 139
> 
>     END
> 
>   END
> 
> # ** MORE SIMILAR CLASSES HERE ***
> 
> END
> 
>  



More information about the mapserver-users mailing list