[Geoserver-users] SLD in Geoserver

Hi,

I need some help, maybe someone can guide me.

I’m working on Geoserver 2.14.1 on Tomcat 8.5, QGIS 3.4.3-Madeira.

I have a really complex style in ArcGIS (awful) that I was able to import to qgis with “slyr” a plugin that takes the *.STYLE and makes it an xml style for QGIS.

When I match my polygons in qgis I save that to an sld file.

The file needs some work to be able to work on Geoserver, I know, but I have not been able to solve this snippet:

ttf 95 #354da8 15 15 8

I understand I need to provide the ttf file, but I can’t figure out where do I need to put it or if this syntax is correct, since I had to make so many changes.

Can you guide me to where I might find a solution? Maybe there is something in the cookbook I missed…

Attached you will find two files for reference, the original qgis and the one I have now that should work if it wasn’t for the ttf mark (I think).

Thanks in advance,

Cheers

Malena

In GeoServer we use a slightly different format to handle ttf marks - see https://docs.geoserver.org/stable/en/user/styling/sld/extensions/pointsymbols.html#bulk-ttf-marks

So something like:

 <PointSymbolizer>
     <Graphic>
       <Mark>
         <WellKnownName>ttf://ESRI Default Marker#0x005F</WellKnownName>
         <Fill>
           <CssParameter name="fill">#354da8</CssParameter>
         </Fill>
         <Stroke/>
       </Mark>
     <Size>16</Size>
   </Graphic>
 </PointSymbolizer>
···

Ian Turton

Thanks Ian! I took your advice and used slyr!

I saw that, but I also found this [1] and didn’t know witch one to apply, but also thought that the qgis syntax couldn’t be sooo wrong, could it?

[1] http://blog.geoserver.org/page/5/

image.png

One more question: where should I put the ttf for Geoserver to be able to read it?

Thanks

Malena

El mar., 8 ene. 2019 a las 14:31, Ian Turton (<ijturton@anonymised.com>) escribió:

In GeoServer we use a slightly different format to handle ttf marks - see https://docs.geoserver.org/stable/en/user/styling/sld/extensions/pointsymbols.html#bulk-ttf-marks

So something like:

 <PointSymbolizer>
     <Graphic>
       <Mark>
         <WellKnownName>ttf://ESRI Default Marker#0x005F</WellKnownName>
         <Fill>
           <CssParameter name="fill">#354da8</CssParameter>
         </Fill>
         <Stroke/>
       </Mark>
     <Size>16</Size>
   </Graphic>
 </PointSymbolizer>

On Tue, 8 Jan 2019 at 17:15, Malena Libman <malena.libman@anonymised.com> wrote:

Hi,

I need some help, maybe someone can guide me.

I’m working on Geoserver 2.14.1 on Tomcat 8.5, QGIS 3.4.3-Madeira.

I have a really complex style in ArcGIS (awful) that I was able to import to qgis with “slyr” a plugin that takes the *.STYLE and makes it an xml style for QGIS.

When I match my polygons in qgis I save that to an sld file.

The file needs some work to be able to work on Geoserver, I know, but I have not been able to solve this snippet:

ttf 95 #354da8 15 15 8

I understand I need to provide the ttf file, but I can’t figure out where do I need to put it or if this syntax is correct, since I had to make so many changes.

Can you guide me to where I might find a solution? Maybe there is something in the cookbook I missed…

Attached you will find two files for reference, the original qgis and the one I have now that should work if it wasn’t for the ttf mark (I think).

Thanks in advance,

Cheers

Malena


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton

That should work too - assuming that you are using SE 1.1 rather than SLD 1.0 - we’d need to see the top of the file to see which you have. The ttf file just needs to be somewhere that Java can see it, so just installing it as usual should be fine. You can check which fonts are available can be done from the GeoServer Status page (click on the Full list of available fonts link).

Ian

···

Ian Turton

Hi Ian,
the syntax is correct, it just happens to be SLD 1.1 and uses the new external mark syntax (the char code is in there).
I believe it’s mostly an issue of font install

Cheres
Andrea

···

Regards, Andrea Aime == 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 ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

That helped me, Thanks! I was able to see some characters, but not all. I’m using SE as it’s the output that qgis generates (I have to save it twice for it to be a clean SLD that works on geoserver)

Here is my example:

se:Rule
se:NameFALLAS DE RUMBO SINESTRAL</se:Name>
se:Description
se:TitleFALLAS DE RUMBO SINESTRAL</se:Title>
</se:Description>
<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:PropertyIsEqualTo
ogc:PropertyNametipo</ogc:PropertyName>
ogc:Literal520600</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
se:LineSymbolizer
se:Stroke
se:GraphicStroke
se:Graphic
se:Mark
<se:OnlineResource xlink:href=“ttf://Arial” xlink:type=“simple”/>
se:Formatttf</se:Format>
se:MarkIndex66</se:MarkIndex>
se:Fill
<se:SvgParameter name=“fill”>#000000</se:SvgParameter>
</se:Fill>
</se:Mark>
se:Size10</se:Size>
se:Displacement
se:DisplacementX0</se:DisplacementX>
se:DisplacementY-1</se:DisplacementY>
</se:Displacement>
</se:Graphic>
</se:GraphicStroke>
<se:SvgParameter name=“stroke-dasharray”>8 8</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
se:LineSymbolizer
se:Stroke
<se:SvgParameter name=“stroke”>#232323</se:SvgParameter>
<se:SvgParameter name=“stroke-width”>1</se:SvgParameter>
<se:SvgParameter name=“stroke-linejoin”>bevel</se:SvgParameter>
<se:SvgParameter name=“stroke-linecap”>square</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>

I tried with Arial, just to be sure. I see the #66 character “B”.

image.png

But characters like #65495 character “╥”, I just see a square

image.png

Is there anything else I have to do to be able to see all the characters? Is there a limit to the ttf characters supported? In QGIS I can see them fine so the font is installed in my system.

Attached is the complete SLD

Thanks in advance.

Cheers,

Malena

El mar., 8 ene. 2019 a las 14:47, Ian Turton (<ijturton@anonymised.com>) escribió:

That should work too - assuming that you are using SE 1.1 rather than SLD 1.0 - we’d need to see the top of the file to see which you have. The ttf file just needs to be somewhere that Java can see it, so just installing it as usual should be fine. You can check which fonts are available can be done from the GeoServer Status page (click on the Full list of available fonts link).

Ian

On Tue, 8 Jan 2019 at 17:39, Malena Libman <malena.libman@anonymised.com> wrote:

Thanks Ian! I took your advice and used slyr!

I saw that, but I also found this [1] and didn’t know witch one to apply, but also thought that the qgis syntax couldn’t be sooo wrong, could it?

[1] http://blog.geoserver.org/page/5/

One more question: where should I put the ttf for Geoserver to be able to read it?

Thanks

Malena

El mar., 8 ene. 2019 a las 14:31, Ian Turton (<ijturton@…84…>) escribió:

In GeoServer we use a slightly different format to handle ttf marks - see https://docs.geoserver.org/stable/en/user/styling/sld/extensions/pointsymbols.html#bulk-ttf-marks

So something like:

 <PointSymbolizer>
     <Graphic>
       <Mark>
         <WellKnownName>ttf://ESRI Default Marker#0x005F</WellKnownName>
         <Fill>
           <CssParameter name="fill">#354da8</CssParameter>
         </Fill>
         <Stroke/>
       </Mark>
     <Size>16</Size>
   </Graphic>
 </PointSymbolizer>

On Tue, 8 Jan 2019 at 17:15, Malena Libman <malena.libman@anonymised.com> wrote:

Hi,

I need some help, maybe someone can guide me.

I’m working on Geoserver 2.14.1 on Tomcat 8.5, QGIS 3.4.3-Madeira.

I have a really complex style in ArcGIS (awful) that I was able to import to qgis with “slyr” a plugin that takes the *.STYLE and makes it an xml style for QGIS.

When I match my polygons in qgis I save that to an sld file.

The file needs some work to be able to work on Geoserver, I know, but I have not been able to solve this snippet:

ttf 95 #354da8 15 15 8

I understand I need to provide the ttf file, but I can’t figure out where do I need to put it or if this syntax is correct, since I had to make so many changes.

Can you guide me to where I might find a solution? Maybe there is something in the cookbook I missed…

Attached you will find two files for reference, the original qgis and the one I have now that should work if it wasn’t for the ttf mark (I think).

Thanks in advance,

Cheers

Malena


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton

Ian Turton

5k_fallas_q.sld (12.6 KB)