TYPE POINT layers must have symbols defined?

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Dec 20 22:35:18 EST 2006


I think you should write a bug on this. As you point out there are a 
couple of specific issues that need to be addressed regardless of the 
other answers you get on this.

1) the less than helpful error message needs to be fixed
2) the documentation and or code probably need to more explicit about 
this case
3) this is a regression, and because it is not clearly documented, I 
would say it was not intended.

I thought a CLASS had to have a COLOR defined to be drawn. This LAYER 
looks like it should be an ANNOTATION, but the does not excuse the 
issues you ran into.

I wouldn't care if this case was dis-allowed if an appropriate error 
message was issued, because it makes sense to me to call what is 
otherwise just annotation, just that.

My 2cents,

Ed McNierney wrote:
> Folks -
> I just finished hunting down a most puzzling bug and I'd like to know
> what the "right answer" is for correcting it.  The simple problem is
> that a LAYER of TYPE POINT seems to require a symbol of some sort to be
> defined.  I encountered this dusting off some old map files, and all I
> can say is that this layer worked in 4.0 and fails in 4.10.  Note that
> the CLASS object defines a label but no symbol:
>   TILEINDEX "US/Index/hwy_exits"
>     LABEL
>       COLOR 0 0 128
>       TYPE TrueType
>       FONT ArialItalic
>       SIZE 8
>     END
>   END
>   MAXSCALE 50000
>   LABELITEM "Name"
> When the label cache is to be drawn, in mapgd.c, the function
> msDrawLabelCacheGD tests the marker size; the comment on the first line
> is telling, as there ISN'T a marker in this case:
>     if((layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles >
> 0) || layerPtr->type == MS_LAYER_POINT) { /* there *is* a marker
> */
>       /* TO DO: at the moment only checks the bottom style, perhaps
> should check all of them */
>       if(msGetMarkerSize(&map->symbolset, &(cachePtr->styles[0]),
> &marker_width, &marker_height, layerPtr->scalefactor) != MS_SUCCESS)
>         return(-1);
> There is no marker defined for this layer, and the function returns -1,
> causing the map drawing to fail but not returning any useful error
> message that gives even a hint of the problem!
> There isn't any good reason for this layer to be TYPE POINT, and
> changing it to TYPE ANNOTATION makes the problem go away.  I'm trying to
> figure out if this is a documentation/code checking issue (TYPE POINT
> layers must have symbols defined) or a msDrawLabelCacheGD bug.  That is,
> should this TYPE POINT layer definition be legal or not?  If I can get
> some guidance I will set things afoot to spare the next poor sod from
> being befuddled by this one.  Thanks!
> 	- Ed
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com / Maps a la carte, Inc.
> 73 Princeton Street, Suite 305
> North Chelmsford, MA  01863
> Phone: +1 (978) 251-4242
> Fax: +1 (978) 251-1396
> ed at topozone.com

More information about the mapserver-dev mailing list