Ok Christian, is right, the SLd that you send work, i mean, it dont present error, but is not doing that i want, i need that the streets's labels beens showed following the curves of the streets, but this solution are showing only the lines not the label, or i got something wrong with my layer, i'll send it to you that you verify it, or i got something wrong with my geoserver, i dont know, i am only an amateur in this question please help me, tell me what software do you use to get all thats error, thanks, here i send you the shapefile of the streets of my project, thanks a lot.
cmaul <[email protected]> escribió: > Hi, > > that is the SLD that works in geoserver 2.3.3. At the bottom. > But first please read what was wrong with it, as this may to help you to > help yourself next time. > > The editor complained first about the <VendorOption> tag. Unfortunately XML > error messages in editors or geoserver are not very precise. So it pays to > look as well at the tag before as this may be the reason: > Here it is the case: > <sld:Halo> > <sld:Radius> > <ogc:Literal>1.5</ogc:Literal> > </sld:Radius> > <sld:Fill> > <sld:CssParameter > name="fill">#000000</sld:CssParameter> > </sld:Fill> > </sld:Halo> > The fill parameter is part of the Halo. On its own geoserver does not know > what to do with it, so the closing </Halo> tag needs to be after </sld:Fill> > not after the radius. So taking out the vendorOption would have resulted in > complaining about the <sld:TextSymbolizer> and that should have prompted you > to say: Hold on there must be something wrong before that.... > > Next problem: It is not <sld:Literal>, it is <ogc:Literal>. Literal is a tag > from a different namespace. > > Next problem, where it is again complaining about the FOLLOWING tag i.e. > <sld:Font> not about the offending tag. > > <sld:Label> > <ogc:PropertyName>nombre</ogc:PropertyName> > </sld:Label> > > The label ends after the String you are using as label. Font is a subtag of > <sld:TextSymbolizer>. Essentially they come in the order how, what , which > font, where, halo, Fill. All these tags are on the same level. So closing > the </sld:Label> after the font does not work, although the XML is well > formed. > > You have then three tags which do not have any content. And geoserver > complains about them as well. Rightfully I would say. Why do you have > placement tags when you do not say where. > > <sld:LabelPlacement> > <sld:LinePlacement /> > </sld:LabelPlacement> > > On second thoughts the complaint may actually be because of the required > order of the tags. > Line 506 - 514 from the 1.0.0 schema: > <xsd:extension base="sld:SymbolizerType"> > <xsd:sequence> > <xsd:element ref="sld:Geometry" > minOccurs="0"/> > <xsd:element ref="sld:Label" > minOccurs="0"/> > <xsd:element ref="sld:Font" > minOccurs="0"/> > <xsd:element > ref="sld:LabelPlacement" minOccurs="0"/> > <xsd:element ref="sld:Halo" > minOccurs="0"/> > <xsd:element ref="sld:Fill" > minOccurs="0"/> > </xsd:sequence> > So the schema says: this must be your order. And that is why the > vendorOptions need to come last. Please note; There is a difference between > the Fill of the entire Labeling and the fill of the halo, I didn't know what > you want and assumed the halo below. > > > Now the sld that works (at least on my geoserver): > > <?xml version="1.0" encoding="UTF-8"?> > <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" > xmlns:sld="http://www.opengis.net/sld" > xmlns:ogc="http://www.opengis.net/ogc" > xmlns:gml="http://www.opengis.net/gml" version="1.0.0"> > <sld:UserLayer> > <sld:LayerFeatureConstraints> > <sld:FeatureTypeConstraint/> > </sld:LayerFeatureConstraints> > <sld:UserStyle> > <sld:Name>Default Styler</sld:Name> > <sld:Title/> > <sld:FeatureTypeStyle> > <sld:Name>simple</sld:Name> > <sld:FeatureTypeName>Feature</sld:FeatureTypeName> > <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier> > <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier> > <sld:Rule> > <sld:LineSymbolizer> > <sld:Stroke> > <sld:CssParameter > name="stroke">#D95F02</sld:CssParameter> > </sld:Stroke> > </sld:LineSymbolizer> > <sld:TextSymbolizer> > <sld:Label> > <ogc:PropertyName>nombre</ogc:PropertyName> > </sld:Label> > <sld:Font> > <sld:CssParameter > name="font-family">Arial</sld:CssParameter> > <sld:CssParameter > name="font-size">12.0</sld:CssParameter> > <sld:CssParameter > name="font-style">normal</sld:CssParameter> > <sld:CssParameter > name="font-weight">normal</sld:CssParameter> > </sld:Font> > > > <sld:Halo> > <sld:Radius> > <ogc:Literal>1.5</ogc:Literal> > </sld:Radius> > > <sld:Fill> > <sld:CssParameter > name="fill">#000000</sld:CssParameter> > </sld:Fill> > </sld:Halo> > <sld:Priority>500</sld:Priority> > <VendorOption name="followLine">true</VendorOption> > <VendorOption name="repeat">250</VendorOption> > <VendorOption name="group">yes</VendorOption> > <VendorOption > name="maxDisplacement">100</VendorOption> > > </sld:TextSymbolizer> > </sld:Rule> > </sld:FeatureTypeStyle> > </sld:UserStyle> > </sld:UserLayer> > </sld:StyledLayerDescriptor> > > > Well enough explained? > > Cheers > > Christian > > > > ----- > ____________________________ > > Dr Christian Maul > Project Manager > > Information Services Branch > Department of Sustainability and Environment > Level13, Marland House, 570 Bourke Street > Melbourne 3000 > > PO Box 500, East Melbourne Vic 3002 > > > Telephone: +61-3-8636 2325 > Telefax: +61-3-8636 2813 > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/help-with-SLD-tp5074614p5075120.html > Sent from the GeoServer - User mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Geoserver-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/ ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
