[Mapserver-users] Label mindistance not working for me

Steve Lime steve.lime at dnr.state.mn.us
Mon Jan 26 13:58:09 PST 2004


Drawing post labelcache should generally be avoided. The only reason it even exists as an option is for embedded scalebars and legends which are treated as annotation. With anything drawn after the main labelcache collision avoidance is not done. That's why you see the overlaps. The question then becomes why no labels draw when using the cache. Try removing all the xtras, something like this.

LAYER
	NAME "Lion Streets"
	CONNECTIONTYPE postgis
	CONNECTION "user=postgres dbname=nycpr"
	DATA "the_geom from bklion1"
	MAXSCALE 6000
	STATUS DEFAULT
	TYPE LINE
	LABELITEM 'street'
	CLASS # everything
		COLOR 255 255 255
		LABEL
			ANGLE AUTO
			COLOR 132 31 31
			SIZE 12
			TYPE TRUETYPE
			FONT arial
		END
	END
END

What does this produce? Your value for buffer was quite high and may have been the problem.

Steve

>>> "Matthew Haines" <mhaines94108 at hotmail.com> 1/26/2004 3:04:20 PM >>>
Steve,

Here's another example of labels colliding.  As you can see, neither 
MINDISTANCE nor BUFFER is having any effect.  I tried removing 
POSTLABELCACHE TRUE, but when I do that all the labels disappear.  I also 
tried adding a CLASSITEM "street" and then EXPRESSION /./, but that didn't 
have any effect, either.

Does anyone have any idea what could be causing MINDISTANCE and BUFFER to 
generate a map with so many label collisions like this?

Matthew

LAYER
	NAME "Lion Streets"
	CONNECTIONTYPE postgis
	CONNECTION "user=postgres dbname=nycpr"
	DATA "the_geom from bklion1"
	MAXSCALE 6000
	STATUS DEFAULT
	FORCE TRUE
	TYPE LINE
	LABELCACHE ON
	POSTLABELCACHE TRUE
	LABELITEM 'street'
	CLASS # everything
		COLOR 255 255 255
		LABEL
			ANGLE AUTO
			BUFFER 100
			FORCE FALSE
			COLOR 132 31 31
			SIZE 12
			TYPE TRUETYPE
			FONT arial
			MINDISTANCE 50
		END
	END
END



>From: "Steve Lime" <steve.lime at dnr.state.mn.us>
>To: <mhaines94108 at hotmail.com>,<MAPserver-users at lists.gis.umn.edu>
>Subject: Re: [Mapserver-users] Label mindistance not working for me
>Date: Mon, 26 Jan 2004 12:20:25 -0600
>
>The criteria is text comparison of labels within the same layer and same
>class. Presumably you could have a interstate 35 and a state highway 35
>that should be allowed to be close.
>
>Why are you setting LABELCACHE ON and POSTLABELCACHE TRUE?
>
>Steve
>
> >>> "Matthew Haines" <mhaines94108 at hotmail.com> 1/25/2004 8:15:31 PM
> >>>
>I'm having trouble with label mindistance.  I have set it, but my
>labels
>still collide.  What exactly is the equality comparison used?  Is it a
>text
>comparison of the label names?  My data file has a different line
>segment
>for each block on the street.  If the map is zoomed to show eight
>blocks, I
>get eight labels.  A few extra labels is okay, but not when they are
>all on
>top of each other.
>
>Adding or removing BUFFER, MINDISTANCE, and MINFEATURESIZE all don't
>seem to
>change the output map, which has identical labels stacked to the point
>of
>illegibility.
>
>Matthew
>
>LAYER
>	NAME "bk_streets"
>	CONNECTIONTYPE OGR
>	CONNECTION "data/streets/lion03C/bklion.tab"
>	MAXSCALE 6000
>	STATUS DEFAULT
>	FORCE TRUE
>	TYPE LINE
>	LABELITEM 'Street'
>	LABELCACHE ON
>	POSTLABELCACHE TRUE
>	CLASS
>		COLOR 255 255 255
>		LABEL
>			ANGLE AUTO
>			COLOR 31 231 31
>			BUFFER 100
>			FORCE FALSE
>			MINFEATURESIZE AUTO
>			SIZE 12
>			TYPE TRUETYPE
>			FONT arial
>			MINDISTANCE 50
>		END
>	END
>END
>
>_________________________________________________________________
>Rethink your business approach for the new year with the helpful tips
>here.
>http://special.msn.com/bcentral/prep04.armx 
>
>_______________________________________________
>Mapserver-users mailing list
>Mapserver-users at lists.gis.umn.edu 
>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 

_________________________________________________________________
Check out the new MSN 9 Dial-up * fast & reliable Internet access with prime 
features! http://join.msn.com/?pgmarket=en-us&page=dialup/home&ST=1





More information about the MapServer-users mailing list