[Geoserver-users] Displaying SVG external graphic issue

I’m using Geoserver 2.6.2. I need to use a SVG file as an external graphic to style a points layer. When I open the WMS layer in QGIS, the points are not displayed. This is not happening if I use a PNG file.

Here is an extract of my SLD code:

](http://myserver/img/mySymbol.svg%22/%3E) image/svg+xml 40

I’m wondering why the image format has to be svg+xml.

Is an additional XML file needed?

Thomas,

Can you access the file http://myserver/img/mySymbol.svg simply from a web browser? If it is indeed on your server, you can put it next to the SLDs in the same directory and make a relative path to the SVG file.

The tag is the mime-type. SVG is an XML sibling, so no need for an additional XML file.

Kind regards,

Edward


Date: Mon, 11 Jan 2016 13:00:07 +0100
From: wiltoma@anonymised.com.84…
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Displaying SVG external graphic issue

I’m using Geoserver 2.6.2. I need to use a SVG file as an external graphic to style a points layer. When I open the WMS layer in QGIS, the points are not displayed. This is not happening if I use a PNG file.

Here is an extract of my SLD code:

](http://myserver/img/mySymbol.svg%22/%3e) image/svg+xml 40

I’m wondering why the image format has to be svg+xml.

Is an additional XML file needed?

------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

Edward,

Thanks for help!

Yes, I can indeed display the SVG symbol in my browser with the URL.

The question remains: *why do PNG files display correctly and SVG files
don't* (both being placed in the same directory)? I would prefer solving
this issue rather than having two different directories for PNG files and
SVG files...

I tested storing the SVG file in the same directory as SLDs and using a
relative path to call the file. This works but the symbol displayed is not
good. It seems to be distorted...

SVG file :

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

SVG file as displayed in QGIS :

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

Thanks again in advance for help!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244885.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

We had a problem two years ago with SVG symbols not displaying. We solved it by don't setting the workspace for the style.

/Per

-----Ursprungligt meddelande-----
Från: wiltomap [mailto:wiltoma@anonymised.com]
Skickat: den 13 januari 2016 09:01
Till: geoserver-users@lists.sourceforge.net
Ämne: Re: [Geoserver-users] Displaying SVG external graphic issue

Edward,

Thanks for help!

Yes, I can indeed display the SVG symbol in my browser with the URL.

The question remains: *why do PNG files display correctly and SVG files
don't* (both being placed in the same directory)? I would prefer solving this issue rather than having two different directories for PNG files and SVG files...

I tested storing the SVG file in the same directory as SLDs and using a relative path to call the file. This works but the symbol displayed is not good. It seems to be distorted...

SVG file :

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

SVG file as displayed in QGIS :

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

Thanks again in advance for help!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244885.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Per,
interesting, did you report it? It would be useful to have a reproducible
issue in the ticket tracker

Cheers
Andrea

···

On Wed, Jan 13, 2016 at 9:39 AM, Per Söderström <per.soderstrom@anonymised.com> wrote:

Hi,

We had a problem two years ago with SVG symbols not displaying. We solved it by don’t setting the workspace for the style.

/Per

-----Ursprungligt meddelande-----
Från: wiltomap [mailto:wiltoma@anonymised.com84…]
Skickat: den 13 januari 2016 09:01
Till: geoserver-users@lists.sourceforge.net
Ämne: Re: [Geoserver-users] Displaying SVG external graphic issue

Edward,

Thanks for help!

Yes, I can indeed display the SVG symbol in my browser with the URL.

The question remains: why do PNG files display correctly and SVG files
don’t
(both being placed in the same directory)? I would prefer solving this issue rather than having two different directories for PNG files and SVG files…

I tested storing the SVG file in the same directory as SLDs and using a relative path to call the file. This works but the symbol displayed is not good. It seems to be distorted…

SVG file :

<http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file.png>

SVG file as displayed in QGIS :

<http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file_qgis.png>

Thanks again in advance for help!


View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244885.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


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


Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.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 Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.


Just for completeness can you open that svg from the machine GeoServer is running on as the user that is running GeoServer?

I’ve had issues in the past with proxies and tomcat not having permission to see the internet.

Ian

···

On 13 January 2016 at 08:01, wiltomap <wiltoma@anonymised.com> wrote:

Edward,

Thanks for help!

Yes, I can indeed display the SVG symbol in my browser with the URL.

The question remains: why do PNG files display correctly and SVG files
don’t
(both being placed in the same directory)? I would prefer solving
this issue rather than having two different directories for PNG files and
SVG files…

I tested storing the SVG file in the same directory as SLDs and using a
relative path to call the file. This works but the symbol displayed is not
good. It seems to be distorted…

SVG file :

<http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file.png>

SVG file as displayed in QGIS :

<http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file_qgis.png>

Thanks again in advance for help!


View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244885.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


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

Ian Turton

Hie !

I modified the SLD by retrieving workspace name (no workspace affected): the
display bug is still present...

And yes, I can open the SVG file from the machine GeoServer is running on.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244972.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Same “distortion” happens to me sometimes too. If I try to export my SVG from InkScape using Optimized SVG, sometimes the shapes don’t come out right and have to save the file as InkScape SVG or Plain SVG instead. Never fully investigated what went on there. Also, I find that setting the actual size of the image in the tag using the width and height attributes is necessary for GeoServer to properly render the SVG.

Edward

Date: Wed, 13 Jan 2016 00:01:19 -0800
From: wiltoma@anonymised.com
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Displaying SVG external graphic issue

Edward,

Thanks for help!

Yes, I can indeed display the SVG symbol in my browser with the URL.

The question remains: why do PNG files display correctly and SVG files
don’t
(both being placed in the same directory)? I would prefer solving
this issue rather than having two different directories for PNG files and
SVG files…

I tested storing the SVG file in the same directory as SLDs and using a
relative path to call the file. This works but the symbol displayed is not
good. It seems to be distorted…

SVG file :

http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file.png

SVG file as displayed in QGIS :

http://osgeo-org.1560.x6.nabble.com/file/n5244885/svg_file_qgis.png

Thanks again in advance for help!


View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244885.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


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

On Wed, Jan 13, 2016 at 1:39 PM, Edward Mac Gillavry <
emacgillavry@anonymised.com> wrote:

Same "distortion" happens to me sometimes too. If I try to export my SVG
from InkScape using Optimized SVG, sometimes the shapes don't come out
right and have to save the file as InkScape SVG or Plain SVG instead. Never
fully investigated what went on there. Also, I find that setting the actual
size of the image in the <svg> tag using the width and height attributes is
necessary for GeoServer to properly render the SVG.

GeoServer parses and handles SVG using Batik... I was writing that no new
releases showed up in a long
while, but it seems that in 2015 Batik 1.8 got released (we are using 1.7),
if someone is interested in
checking compatibility with the old version and proper functionality we
could upgrade it in some
next release of GeoServer (for it to be part of GeoServer 2.9.x someone
would have to test it right now,
we'll enter feature freeze in a month)

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 Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.

-------------------------------------------------------

Great! I've just tried to save my SVG file into « SVG: simple » format (not «
SVG: Inkscape » which is the default SVG format). See screenshot below
(sorry for GUI being in french).

Display is now perfect!

Thanks again.

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

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244982.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Glad to hear it works!

Cheers,

Edward

Date: Wed, 13 Jan 2016 05:01:00 -0800
From: wiltoma@anonymised.com
To: geoserver-users@anonymised.comge.net
Subject: Re: [Geoserver-users] Displaying SVG external graphic issue

Great! I’ve just tried to save my SVG file into « SVG: simple » format (not «
SVG: Inkscape » which is the default SVG format). See screenshot below
(sorry for GUI being in french).

Display is now perfect!

Thanks again.

http://osgeo-org.1560.x6.nabble.com/file/n5244982/svg_save.png


View this message in context: http://osgeo-org.1560.x6.nabble.com/Displaying-SVG-external-graphic-issue-tp5244529p5244982.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


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