[mapserver-users] Problems labelling using Halo option

Yewondwossen Assefa yassefa at dmsolutions.ca
Thu Sep 30 05:21:25 PDT 2010


  Hi,

Check the file  
C:/ms4w/Apache/htdocs/ogcservices/tmp/4ca47709_100_1._sld.map and the 
layer where the sld is applied, the label object should have the 
outlinecolor set if it worked properly. Is that the case? I am not sure 
I understand the font issue, but you can also see what font was set fir 
that label object.

regards,


On 30/09/2010 7:43 AM, David Alda Fernandez de Lezea wrote:
> Assefa,
>
> Yes, it's valid. It works, but not with desired behaviour. It draws the polygons with the labels but without the Halo effect.
>
> I forgot to put xml headers in the previous email.
>
> <?xml version="1.0" encoding="UTF-8"?>
> 	<StyledLayerDescriptor version="1.0.0"  xsi:schemaLocation="http://www.opengis.net/sld
> 		StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld"
> 		xmlns:ogc="http://www.opengis.net/ogc"
> 		xmlns:xlink="http://www.w3.org/1999/xlink"
> 		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> I also forgot to mention that if I put<CssParameter name="font-family">Verdana</CssParameter>  for example, and Verdana does not exist in my fontset, it does the labelling properly (including Halo), but it's like if mapserver gets some default values, because the size has changed and even though I change it in th e SLD, the size keeps the same.
>
>
>
> WMS Log
>
> [Thu Sep 30 13:39:53 2010].513000 CGI Request 1 on process 256
> [Thu Sep 30 13:39:53 2010].685000 msApplySLD(): Map file after SLD was applied C:/ms4w/Apache/htdocs/ogcservices/tmp/4ca47709_100_1._sld.map[Thu Sep 30 13:39:53 2010].826000 msDrawRasterLayerLow(orto0): entering.
> [Thu Sep 30 13:40:02 2010].216000 msDrawMap(): Layer 4 (orto0), 8.390s
> [Thu Sep 30 13:40:03 2010].606000 msDrawMap(): Layer 0 (vinedos_sigpac), 1.390s
> [Thu Sep 30 13:40:04 2010].122000 msDrawMap(): Layer 3 (vinedos_disolve_bn), 0.516s
> [Thu Sep 30 13:40:04 2010].513000 msDrawMap(): Layer 2 (vinedos_disolve), 0.391s
> [Thu Sep 30 13:40:05 2010].919000 msDrawMap(): Layer 1 (vinedos), 1.406s
> [Thu Sep 30 13:40:07 2010].106000 msDrawMap(): Layer 7 (vinedos_parcelas), 1.187s
> [Thu Sep 30 13:40:07 2010].106000 msDrawLabelCache(): labelcache_map_edge_buffer = -10
> [Thu Sep 30 13:40:07 2010].106000 msDrawMap(): Drawing Label Cache, 0.000s
> [Thu Sep 30 13:40:07 2010].106000 msDrawMap() total time: 13.343s
> [Thu Sep 30 13:40:08 2010].606000 msSaveImage() total time: 1.500s
> [Thu Sep 30 13:40:08 2010].606000 mapserv request processing time (msLoadMap not incl.): 15.093s
> [Thu Sep 30 13:40:08 2010].637000 msFreeMap(): freeing map at 015C6820.
>
> Thanks.
>
> ________________________________
>
> De: Yewondwossen Assefa [mailto:yassefa at dmsolutions.ca]
> Enviado el: jueves, 30 de septiembre de 2010 13:24
> Para: David Alda Fernandez de Lezea
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] Problems labelling using Halo option
>
>
> Hi there,
>
>   Is the sld xml you are using valid?  Grabbing it from this e-mail, It seems to not validate (several<PropertyName>   tags). It might just a copy paste but make sure of that.
> You can aslo set your map in debug mode ( DEBUG 5 for example) and check your logs to see if the xml was parsed properly and if that is the case you should also be able a tmp file of your map file after SLD was applied
>
> regards,
>
>
> On 30/09/2010 3:34 AM, David Alda Fernandez de Lezea wrote:
>
> 	Hi list,
> 	
> 	I'm developing a program that generates some images from a WMS with a dynamic generated SLD. The problem is that I'm telling MapServer to generate some labels with Halo, to make them easy to read, using the following code:
> 	
> 	<NamedLayer>
> 	<Name>vinedos</Name>
> 	<UserStyle><Name></Name><Title></Title><Abstract></Abstract>
> 	<FeatureTypeStyle>
> 	<Rule>
> 	<Filter>
> 	<And>
> 	<PropertyIsEqualTo><PropertyName>provincia</PropertyName><Literal>1</Literal></PropertyIsEqualTo>
> 	<PropertyIsEqualTo><PropertyName>municipio</PropertyName><Literal>43</Literal></PropertyIsEqualTo>
> 	<PropertyIsEqualTo><PropertyName>poligono</PropertyName><Literal>4</Literal></PropertyIsEqualTo>
> 	<PropertyIsEqualTo><PropertyName>parcela</PropertyName><Literal>880</Literal></PropertyIsEqualTo>
> 	<PropertyIsEqualTo><PropertyName>recinto</PropertyName><Literal>1</Literal></PropertyIsEqualTo>
> 	</And>
> 	</Filter>
> 	<PolygonSymbolizer>
> 	<Stroke>
> 	<CssParameter name="stroke">#000000</CssParameter>
> 	<CssParameter name="stroke-width">2</CssParameter>
> 	<CssParameter name="stroke-dasharray">5 5 5 5</CssParameter>
> 	</Stroke>
> 	</PolygonSymbolizer>
> 	<TextSymbolizer>
> 	<Label>
> 	<PropertyName>poligono</PropertyName>-<PropertyName>parcela</PropertyName>-<PropertyName>recinto</PropertyName>
> 	</Label>
> 	<Font>
> 	<CssParameter name="font-family">times</CssParameter>
> 	<CssParameter name="font-size">18</CssParameter>
> 	<CssParameter name="font-weight">bold</CssParameter>
> 	</Font>
> 	<LabelPlacement>
> 	<PointPlacement>
> 	<AnchorPoint><AnchorPointX>0.5</AnchorPointX><AnchorPointY>0.5</AnchorPointY>
> 	</AnchorPoint>
> 	</PointPlacement>
> 	</LabelPlacement>
> 	<Halo>
> 	<Radius>
> 	<Literal>2</Literal>
> 	</Radius>
> 	<Fill>
> 	<CssParameter name="fill">#FFFFFF</CssParameter>
> 	<CssParameter name="fill-opacity">0.85</CssParameter>
> 	</Fill>
> 	</Halo>
> 	<Fill>
> 	<CssParameter name="fill">#000000</CssParameter>
> 	<CssParameter name="fill-opacity">0.65</CssParameter>
> 	</Fill>
> 	</TextSymbolizer>
> 	</Rule>
> 	</FeatureTypeStyle>
> 	</UserStyle>
> 	</NamedLayer>
> 	
> 	But when I receive the image the Halo is not applied (see attached file). My mapfile is as follows:
> 	
> 	NAME "WMSSERVER"
> 			
> 			STATUS ON
> 			EXTENT 460000 4710000 610000 4820000 # Euskadi		
> 			SHAPEPATH "extra/shapes/"
> 			FONTSET "extra/fonts/fonts.txt"
> 			SYMBOLSET "extra/symbols/symbols.sym"
> 			
> 			
> 			IMAGETYPE "image/png; mode=24bit"
> 	
> 			OUTPUTFORMAT
> 			   NAME png
> 			   DRIVER "AGG/PNG"
> 			   MIMETYPE "image/png"
> 			   IMAGEMODE RGBA
> 			   EXTENSION "png"
> 			   FORMATOPTION "TRANSPARENT=ON"
> 			   FORMATOPTION "INTERLACE=OFF"
> 			END
> 			OUTPUTFORMAT
> 			  NAME jpeg
> 			  DRIVER "GD/JPEG"
> 			  MIMETYPE "image/jpeg"
> 			  IMAGEMODE RGB
> 			  EXTENSION "jpg"
> 			END
> 			IMAGECOLOR 255 255 255
> 			UNITS METERS
> 			
> 			DEBUG ON
> 			CONFIG "MS_ERRORFILE" "C:/ms4w/Apache/htdocs/ogcservices/logs/wms_impresiones_lotes_log.log"
> 			DEBUG 5
> 	
> 	
> 		WEB
> 			IMAGEPATH "C:/ms4w/Apache/htdocs/ogcservices/tmp/"
> 			IMAGEURL "tmp/"
> 			METADATA
> 				"wms_name"            	"IKT WMS Server"
> 				"wms_title"           	"Servidor WMS IKT - Impresiones Lotes"
> 				"wms_onlineresource"  	"http://192.168.1.161/cgi-bin/mapserv.exe?map=../htdocs/ogcservices/impresiones_lotes_wms.map&"<http://192.168.1.161/cgi-bin/mapserv.exe?map=../htdocs/ogcservices/impresiones_lotes_wms.map&>
> 				"wms_srs"       		"EPSG:23030 EPSG:4326"
> 				"wms_transparent"       "true"
> 				"wms_abstract"		"Servicio de mapas WMS de IKT Nekazal Teknologia. Powered by Apache and UMN MapServer. Servicio WMS para las impresiones por lotes."
> 				"wms_keywordlist"		"IKT,Euskadi,Mapas Euskadi"
> 				"wms_feature_info_mime_type"   "application/vnd.ogc.gml"
> 				"labelcache_map_edge_buffer" "-10"
> 			END
> 		END
> 		
> 		PROJECTION
> 			"init=epsg:23030"
> 		END
> 	
> 		LAYER
> 			STATUS ON
> 			CONNECTIONTYPE postgis
> 			CONNECTION "user=postgres password=1111 dbname=VITICOLA_IMPRESIONES host=192.168.1.161 port=5432"
> 			NAME "vinedos"
> 	
> 			PROJECTION
> 				"init=epsg:23030"
> 			END
> 			DUMP TRUE
> 			TYPE POLYGON
> 			METADATA
> 				"wms_title"			  "vinedos"
> 				"wms_srs"             "EPSG:23030"
> 				"wms_name"            "vinedos"
> 				"wms_server_version"  "1.1.1"
> 				"wms_format"          "image/gif"
> 				"wms_transparent"     "true"
> 				"wms_extent"		  "470000 4700000 610000 4820000"
> 				"gml_include_items"	  "all"
> 			END	
> 			#Sentencia SQL para obtener los datos
> 			DATA "the_geom FROM vinedos using unique gid using SRID=23030"
> 	
> 			CLASS
> 				NAME "Vinedos"
> 				STYLE
> 					SYMBOL 'dashed1'
> 					OUTLINECOLOR 0 0 0
> 				END
> 				TEMPLATE "ttt_query.html"
> 			END
> 			
> 			PROCESSING "LABEL_NO_CLIP=ON"
> 		END
> 	
> 	END
> 	
> 	And my font file:
> 	
> 	sans                    Vera.ttf
> 	esri-130                esri_130.ttf
> 	times				times.ttf
> 	times-bold			timesbd.ttf
> 	arial				arial.ttf
> 	
> 	No error messages are received.
> 	
> 	Any ideas??
> 	
> 	Thanks.
> 	
> 	Un saludo,
> 	
> 	··················································································
> 	
> 	David Alda Fernández de Lezea
> 	Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
> 	
> 	IKT
> 	Granja Modelo s/n · 01192 · Arkaute (Araba)
> 	
> 	··················································································
> 	Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
> 	··················································································
> 	email: dalda at ikt.es                                web: www.ikt.es
> 	··················································································
> 	
> 	
> 	_______________________________________________
> 	mapserver-users mailing list
> 	mapserver-users at lists.osgeo.org
> 	http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 	
>
>
>


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: yassefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------





More information about the MapServer-users mailing list