[Geoserver-users] help with SLD

Hi people, i need help, i found reading the geoserver help that i can use labeling, following lines, for example the name of the streets, but i copied the example to my geoserver with some changes and test it with udig and dont work, i only replace the name of my label field and add some strokes to the lines, and dont work, please somebody help me to correct this, this is the code that i use.

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld&quot; xmlns:sld="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; version="1.0.0">
     <sld:UserLayer>
         <sld:LayerFeatureConstraints>
             <sld:FeatureTypeConstraint/>
         </sld:LayerFeatureConstraints>
         <sld:UserStyle>
             <sld:Name>Default Styler</sld:Name>
             <sld:Title/>
             <sld:IsDefault>1</sld:IsDefault>
             <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:Geometry>
                             <ogc:PropertyName>the_geom</ogc:PropertyName>
                         </sld:Geometry>
                         <sld:Stroke>
                             <sld:CssParameter name="stroke-width">3.0</sld:CssParameter>
                         </sld:Stroke>
                     </sld:LineSymbolizer>
       <sld:LineSymbolizer>
             <sld:Geometry>
               <ogc:PropertyName>the_geom</ogc:PropertyName>
             </sld:Geometry>
             <sld:Stroke>
               <sld:CssParameter name="stroke">#FFFFFF</sld:CssParameter>
               <sld:CssParameter name="stroke-linecap">square</sld:CssParameter>
               <sld:CssParameter name="stroke-width">1.5</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:LabelPlacement>
                             <sld:LinePlacement>
                                 <sld:PerpendicularOffset>10.0</sld:PerpendicularOffset>
                             </sld:LinePlacement>
                         </sld:LabelPlacement>
                         <sld:Fill>
                             <sld:CssParameter name="fill">#000000</sld:CssParameter>
                         </sld:Fill>
                         <sld:VendorOption name="spaceAround">2</sld:VendorOption>
                         <sld:VendorOption name="group">yes</sld:VendorOption>
                         <sld:VendorOption name="followLine">true</sld:VendorOption>
                     </sld:TextSymbolizer>
                 </sld:Rule>
             </sld:FeatureTypeStyle>
         </sld:UserStyle>
     </sld:UserLayer>
</sld:StyledLayerDescriptor>

----------------------------------------------------------------
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/

Hello,

My xml-editor tells me;
E [Xerces] cvc-complex-type.2.4.d: Invalid content was found starting with
element 'sld:VendorOption'. No child element is expected at this point.

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-tp5074614p5074665.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

El 28/08/13 03:39, cmaul escribió:

Hello,

My xml-editor tells me;
E [Xerces] cvc-complex-type.2.4.d: Invalid content was found starting with
element 'sld:VendorOption'. No child element is expected at this point.

Cheers

christian

Thanks christian but what did you sugest, thanks anyway for the answer

-----
____________________________

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-tp5074614p5074665.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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--

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/

Well, throw the <sld:VendorOptions/> out check whether it works and put them
back one by one until it crashes

-----
____________________________

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-tp5074614p5074678.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

El 28/08/13 06:58, cmaul escribió:

Well, throw the <sld:VendorOptions/> out check whether it works and put them
back one by one until it crashes

I dont understan what do you want that i do, please explain better, i remove "sld:" of the VerdorOptions, if that what you want?
of that way neither works. here are the SLD.

regards

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld&quot; xmlns:sld="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; 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: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:Label>
                         <sld:Halo>
                             <sld:Radius>
<sld:Literal>1.5</sld:Literal>
                             </sld:Radius>
                         </sld:Halo>
                         <sld:Fill>
                                 <sld:CssParameter name="fill">#000000</sld:CssParameter>
                         </sld:Fill>
                         <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:LabelPlacement>
                             <sld:LinePlacement />
                         </sld:LabelPlacement>
                     </sld:TextSymbolizer>
                 </sld:Rule>
             </sld:FeatureTypeStyle>
         </sld:UserStyle>
     </sld:UserLayer>
</sld:StyledLayerDescriptor>

-----
____________________________

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-tp5074614p5074678.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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--

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/

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&quot;
xmlns:sld="http://www.opengis.net/sld&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot; 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.

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 <Christian.Maul@anonymised.com> 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&quot;
xmlns:sld="http://www.opengis.net/sld&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot; 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
Geoserver-users@lists.sourceforge.net
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/

hey, i have been solved the problem with udig and with some tips that you gave me Christian, but only rest a problem my shapefile of dtreets have no all the names of the street and the solution that i have working only work when the scale is less than "1:71.038" and i need it working in some other scales, how do i implement that? thanks

regards

//----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld&quot; xmlns:sld="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; version="1.0.0">
     <sld:UserLayer>
         <sld:LayerFeatureConstraints>
             <sld:FeatureTypeConstraint/>
         </sld:LayerFeatureConstraints>
         <sld:UserStyle>
             <sld:Name>roads</sld:Name>
             <sld:Title/>
             <sld:FeatureTypeStyle>
                 <sld:Name>group 0</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
<sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
                 <sld:Rule>
                     <sld:Name>default rule</sld:Name>
                     <sld:LineSymbolizer>
                         <sld:Stroke>
                             <sld:CssParameter name="stroke-width">2.5</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:LabelPlacement>
                             <sld:PointPlacement>
                                 <sld:AnchorPoint>
<sld:AnchorPointX>0.0</sld:AnchorPointX>
<sld:AnchorPointY>0.5</sld:AnchorPointY>
                                 </sld:AnchorPoint>
                             </sld:PointPlacement>
                         </sld:LabelPlacement>
                         <sld:Halo>
                             <sld:Radius>1.5</sld:Radius>
                             <sld:Fill>
                                 <sld:CssParameter name="fill">#FFFFFF</sld:CssParameter>
                             </sld:Fill>
                         </sld:Halo>
                         <sld:Priority>500</sld:Priority>
                         <sld:VendorOption name="followLine">true</sld:VendorOption>
                         <sld:VendorOption name="repeat">250</sld:VendorOption>
                         <sld:VendorOption name="group">yes</sld:VendorOption>
                         <sld:VendorOption name="maxDisplacement">100</sld:VendorOption>
                     </sld:TextSymbolizer>
                 </sld:Rule>
                 <sld:Rule>
                     <sld:Name>New Rule</sld:Name>
                     <sld:LineSymbolizer>
                         <sld:Stroke>
                             <sld:CssParameter name="stroke">#FFFFFF</sld:CssParameter>
                             <sld:CssParameter name="stroke-width">2.0</sld:CssParameter>
                         </sld:Stroke>
                     </sld:LineSymbolizer>
                 </sld:Rule>
             </sld:FeatureTypeStyle>
         </sld:UserStyle>
     </sld:UserLayer>
</sld:StyledLayerDescriptor>
//-----------------------------------------------------------------------

El 30/08/13 18:02, islanis@anonymised.com escribió:

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 <Christian.Maul@anonymised.com> 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&quot;
xmlns:sld="http://www.opengis.net/sld&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot; 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
Geoserver-users@lists.sourceforge.net
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--

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/