[Geoserver-users] SLD error with <Halo> tag (GeoServer 2.10)

I'm having troubles with a SLD file used within GeoServer 2.10. When checking
the syntax, it returns the following error message: /line 2542:
cvc-complex-type.2.4.a : Unvalid content from element 'Halo'. One of the
values '{"http://www.opengis.net/sld&quot;:Graphic,
"http://www.opengis.net/sld&quot;:Priority,
"http://www.opengis.net/sld&quot;:VendorOption\}' is expected./

Here is my code:

         <Rule>
          <Name>Canalisation hors-service</Name>
          <Title>Canalisation hors-service</Title>
          <ogc:Filter>
            <ogc:Not>
              <ogc:PropertyIsNull>
                <ogc:PropertyName>annee_hs</ogc:PropertyName>
              </ogc:PropertyIsNull>
            </ogc:Not>
          </ogc:Filter>
          <MinScaleDenominator>1</MinScaleDenominator>
          <MaxScaleDenominator>10010</MaxScaleDenominator>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#dcdcdc</CssParameter>
              <CssParameter name="stroke-width">6</CssParameter>
              <CssParameter name="stroke-opacity">0.75</CssParameter>
        <CssParameter name="stroke-linecap">round</CssParameter>
            </Stroke>
          </LineSymbolizer>
          <TextSymbolizer>
            <Label>Hors-service</Label>
            <LabelPlacement>
              <LinePlacement />
            </LabelPlacement>
            <Fill>
              <CssParameter name="fill">#606060</CssParameter>
        <CssParameter name="font-family">Calibri</CssParameter>
              <CssParameter name="font-size">12</CssParameter>
              <CssParameter name="font-style">normal</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
            </Fill>
         <Halo>
     <Fill>
      <CssParameter name="fill">#dcdcdc</CssParameter>
     </Fill>
              </Halo>
            <VendorOption name="followLine">true</VendorOption>
          </TextSymbolizer>
        </Rule>

When I delete the <Halo></Halo> lines, the error does not show up again.
This issue does not unable layer display when I test it with QGIS for
example...

Any advice on what might be wrong?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-error-with-Halo-tag-GeoServer-2-10-tp5304454.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

LineSymbolizers don’t have halos, only TextSymbolizers do. What are you trying to do?

Ian

···

On 23 January 2017 at 13:00, wiltomap <wiltoma@anonymised.com> wrote:

I’m having troubles with a SLD file used within GeoServer 2.10. When checking
the syntax, it returns the following error message: /line 2542:
cvc-complex-type.2.4.a : Unvalid content from element ‘Halo’. One of the
values ‘{“http://www.opengis.net/sld”:Graphic,
http://www.opengis.net/sld”:Priority,
http://www.opengis.net/sld”:VendorOption}’ is expected./

Here is my code:

Canalisation hors-service Canalisation hors-service annee_hs 1 10010 #dcdcdc 6 0.75 round Hors-service #606060 Calibri 12 normal bold #dcdcdc true

When I delete the lines, the error does not show up again.
This issue does not unable layer display when I test it with QGIS for
example…

Any advice on what might be wrong?


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-error-with-Halo-tag-GeoServer-2-10-tp5304454.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Geoserver-users mailing list
Geoserver-users@anonymised.com.382…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton

A simple matter of order in the elements, the schema says:

<xsd:element name=“TextSymbolizer” substitutionGroup=“sld:Symbolizer”>

xsd:annotation

xsd:documentation
A “TextSymbolizer” is used to render text labels according to various graphical parameters.
</xsd:documentation>

</xsd:annotation>

xsd:complexType

xsd:complexContent

<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:element ref=“sld:Graphic” minOccurs=“0”/>

<xsd:element ref=“sld:Priority” minOccurs=“0”/>

<xsd:element ref=“sld:VendorOption” minOccurs=“0” maxOccurs=“unbounded”/>

</xsd:sequence>

</xsd:extension>

</xsd:complexContent>

</xsd:complexType>

</xsd:element>

And you have put the halo after the fill, instead of before. Indeed, it will render anyways, it’s just
formally incorrect

Full schema here:
http://demo.geo-solutions.it/geoserver/schemas/sld/StyledLayerDescriptor.xsd

Cheers
Andrea

···

On Mon, Jan 23, 2017 at 2:00 PM, wiltomap <wiltoma@anonymised.com> wrote:

I’m having troubles with a SLD file used within GeoServer 2.10. When checking
the syntax, it returns the following error message: /line 2542:
cvc-complex-type.2.4.a : Unvalid content from element ‘Halo’. One of the
values ‘{“http://www.opengis.net/sld”:Graphic,
http://www.opengis.net/sld”:Priority,
http://www.opengis.net/sld”:VendorOption}’ is expected./

Here is my code:

Canalisation hors-service Canalisation hors-service annee_hs 1 10010 #dcdcdc 6 0.75 round Hors-service #606060 Calibri 12 normal bold #dcdcdc true

When I delete the lines, the error does not show up again.
This issue does not unable layer display when I test it with QGIS for
example…

Any advice on what might be wrong?


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-error-with-Halo-tag-GeoServer-2-10-tp5304454.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Geoserver-users mailing list
Geoserver-users@anonymised.com.382…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Sorry miss read that, the fill section is what is wrong:

#606060 Calibri 12 normal bold

should be

#606060

Calibri 12 normal bold

Ian

···

On 23 January 2017 at 13:15, Ian Turton <ijturton@anonymised.com4…> wrote:

LineSymbolizers don’t have halos, only TextSymbolizers do. What are you trying to do?

Ian

On 23 January 2017 at 13:00, wiltomap <wiltoma@anonymised.com> wrote:

I’m having troubles with a SLD file used within GeoServer 2.10. When checking
the syntax, it returns the following error message: /line 2542:
cvc-complex-type.2.4.a : Unvalid content from element ‘Halo’. One of the
values ‘{“http://www.opengis.net/sld”:Graphic,
http://www.opengis.net/sld”:Priority,
http://www.opengis.net/sld”:VendorOption}’ is expected./

Here is my code:

Canalisation hors-service Canalisation hors-service annee_hs 1 10010 #dcdcdc 6 0.75 round Hors-service #606060 Calibri 12 normal bold #dcdcdc true

When I delete the lines, the error does not show up again.
This issue does not unable layer display when I test it with QGIS for
example…

Any advice on what might be wrong?


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-error-with-Halo-tag-GeoServer-2-10-tp5304454.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Geoserver-users mailing list
Geoserver-users@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton

Ian Turton

Many thanks to both of you! I didn't know about this order importance.

I now still have one remaining error on a CssParameter and the SLD cookbook
doesn't help me very much as the <halo> tag structure seems to be followed
properly:

/line 2542: cvc-complex-type.2.4.a : Unvalid content from element
'CssParameter'. One fo the values '{"http://www.opengis.net/sld&quot;:Radius,
"http://www.opengis.net/sld&quot;:Fill\}' is expected./

See below an extract of my code including line numbers.

<http://osgeo-org.1560.x6.nabble.com/file/n5304463/sld_error.png&gt;

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-error-with-Halo-tag-GeoServer-2-10-tp5304454p5304463.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Again from the SLD schema linked above:

<xsd:element name=“Halo”>

xsd:annotation

xsd:documentation
A “Halo” fills an extended area outside the glyphs of a rendered text label to make the label easier to read over a background.
</xsd:documentation>

</xsd:annotation>

xsd:complexType

xsd:sequence

<xsd:element ref=“sld:Radius” minOccurs=“0”/>

<xsd:element ref=“sld:Fill” minOccurs=“0”/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

···

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.