[mapserver-users] RE: Hwy Shields

Johan Forsman Johan.Forsman at LA.GOV
Wed Jun 1 15:15:05 EDT 2011


> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] On Behalf Of Fawcett, David (MPCA)
> Sent: Wednesday, June 01, 2011 10:50 AM
> To: mapserver-users at lists.osgeo.org
> Subject: [mapserver-users] Hwy Shields
> 
> Does anyone have a highway shield example map file and symbol set that
> they are willing to share?
> 
> Thanks,
> 
> David.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

I did this as one of the first "advanced" mapfile projects when I started with MapServer, so it probably is both inelegant and incorrect, but I used a line layer for the roads and an annotation layer for the labels. I don't recall precisely the reason I did an annotation layer, but it may have had to do with my preferred positioning of the labels.

Here's an partial extract from the symbol set and mapfile:

# Highway shields
SYMBOL
	NAME 'interstate'
	TYPE pixmap
	IMAGE "interstate.png"
END	

LAYER   # Freeways at small scale
	DATA 'webmaps_LDOTD_2007_hwys'
	name freeways_small 
	type line
	OPACITY 100
	status on
	labelitem "HWY_NUM"
	LABELCACHE on
	classitem "SHIELD"
	MINSCALEDENOM	250001
	class 
		EXPRESSION "I"
		NAME "Interstate highways"
		style
			color 0 92 230 
			width 3  
			antialias true
		end
		style
			color 254 254 254
			width 1 
			antialias true
		end
	end #class
end #layer freeways_small

LAYER   # shields and labels for freeways at small scale
	DATA 'webmaps_LDOTD_2007_hwys'
	name freeways_small_labels
	type annotation
	OPACITY 100
	status on
	labelitem "HWY_NUM"
	LABELCACHE on
	classitem "SHIELD"
	MINSCALEDENOM	250001
	class 
		EXPRESSION "I"
		style
			SYMBOL 'interstate'
		end
		label
			type truetype
			antialias true
			font arial
			size 8
			position cc
			ANGLE 0
			color 254 254 254
			partials false
			MINDISTANCE 200
			MINFEATURESIZE auto
		end #label
	end #class
end #layer freeways_small_labels

Hope that helps get you started.

Take care,

Johan Forsman
Geologist
Safe Drinking Water Program
Louisiana Department of Health and Hospitals
Telephone: 225.342.7309
Telefax: 225.342.7303





More information about the mapserver-users mailing list