[Geoserver-users] Re ndering SVGs (used in SLD as ExternalGraphics)

Hi there!

First off: I'm running GeoServer 1.6.2 on Windows 2000 SP4.

I used some shape files representing a plan and created some SLDs to
visualize it according to a legal regulation. some parts of the legal
regulation were just the fill- and outline colors but mainly special symbols
and lines are used. one can get these as SVG, like this one for example:
http://sicky.i-networx.de/temp/geoserv/RsBaugrenze.svg
this represents a blue/black line.
(i know that an SLD could do that as well, but there are many others which
can't be represtented in SLD with CSS parameters)

As I said I made SLDs for the layers/shapes, here's an example which uses
the above mentionend SVG:
http://sicky.i-networx.de/temp/geoserv/Baugrenze_Li_style.sld

The Problem lays in the rendering:
http://sicky.i-networx.de/temp/geoserv/geoserv_svg_probs.png

Is there any method or anything to avoid these gaps and other flaws?

If you need more info on my configuration to help me, i'll provide it!

Thanks in advance,
Christian.
--
View this message in context: http://www.nabble.com/Rendering-SVGs-(used-in-SLD-as-ExternalGraphics)-tp16608367p16608367.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Christian,

I was just wondering what kind of geometry there are in your shapes. Somehow seems like there could be a "bunch" of linestrings, in which case the rendering of for example dashed lines won't work properly.

mika

Sicky kirjoitti:

Hi there!

First off: I'm running GeoServer 1.6.2 on Windows 2000 SP4.

I used some shape files representing a plan and created some SLDs to
visualize it according to a legal regulation. some parts of the legal
regulation were just the fill- and outline colors but mainly special symbols
and lines are used. one can get these as SVG, like this one for example:
http://sicky.i-networx.de/temp/geoserv/RsBaugrenze.svg
this represents a blue/black line.
(i know that an SLD could do that as well, but there are many others which
can't be represtented in SLD with CSS parameters)

As I said I made SLDs for the layers/shapes, here's an example which uses
the above mentionend SVG:
http://sicky.i-networx.de/temp/geoserv/Baugrenze_Li_style.sld

The Problem lays in the rendering:
http://sicky.i-networx.de/temp/geoserv/geoserv_svg_probs.png

Is there any method or anything to avoid these gaps and other flaws?

If you need more info on my configuration to help me, i'll provide it!

Thanks in advance,
Christian.
  

Sicky ha scritto:

Hi there!

First off: I'm running GeoServer 1.6.2 on Windows 2000 SP4.

I used some shape files representing a plan and created some SLDs to
visualize it according to a legal regulation. some parts of the legal
regulation were just the fill- and outline colors but mainly special symbols
and lines are used. one can get these as SVG, like this one for example:
http://sicky.i-networx.de/temp/geoserv/RsBaugrenze.svg
this represents a blue/black line.
(i know that an SLD could do that as well, but there are many others which
can't be represtented in SLD with CSS parameters)

I would suggest to stick with native SLD ways when possible thought,
they would be more efficient for sure.

As I said I made SLDs for the layers/shapes, here's an example which uses
the above mentionend SVG:
http://sicky.i-networx.de/temp/geoserv/Baugrenze_Li_style.sld

The Problem lays in the rendering:
http://sicky.i-networx.de/temp/geoserv/geoserv_svg_probs.png

Is there any method or anything to avoid these gaps and other flaws?

I think the problem is that the svg drawing area is not completely covered by the drawing primitives causing the gaps. But there is nothing
I can do about the "corner" case where the two lines are crossing,
the svg is turned into a bitmap that's being painted along the line,
there is nothing the user can do to prevent that.
Maybe some smart programming, but right now I only see lots of problems
trying to do that, and no good solution.

I see you have a MapServer preview in the browser. Is MapServer
able to do any better?

Cheers
Andrea

Hi Mika!

The blue/black line ("Baugrenze") is a polygon and the other line with the dots ("Grenze des räumlichen Geltungsbereichs") is a line. When I use CSS parameters to style them within the SLD it looks just fine, no gaps or something. Sorry that I don't already mentionend that, but that can't be the problem!
But thanks anyways :slight_smile:

Christian.

Lehtonen, Mika schrieb:

Hi Christian,

I was just wondering what kind of geometry there are in your shapes. Somehow seems like there could be a "bunch" of linestrings, in which case the rendering of for example dashed lines won't work properly.

mika

Sicky kirjoitti:

Hi there!

First off: I'm running GeoServer 1.6.2 on Windows 2000 SP4.

I used some shape files representing a plan and created some SLDs to
visualize it according to a legal regulation. some parts of the legal
regulation were just the fill- and outline colors but mainly special symbols
and lines are used. one can get these as SVG, like this one for example:
http://sicky.i-networx.de/temp/geoserv/RsBaugrenze.svg
this represents a blue/black line.
(i know that an SLD could do that as well, but there are many others which
can't be represtented in SLD with CSS parameters)

As I said I made SLDs for the layers/shapes, here's an example which uses
the above mentionend SVG:
http://sicky.i-networx.de/temp/geoserv/Baugrenze_Li_style.sld

The Problem lays in the rendering:
http://sicky.i-networx.de/temp/geoserv/geoserv_svg_probs.png
Is there any method or anything to avoid these gaps and other flaws?

If you need more info on my configuration to help me, i'll provide it!

Thanks in advance,
Christian.
  

Hi Andrea!

The Problem is that I really have to stick to native SLD because I don't think I can represent lines with should look like these examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_b4dd2f7546.png.png
(this the png version of the svg symbol to visualize the line running vertically ["Grenze des räumlichen Geltungsbereichs"])

other examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_082ce01ebc.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_3b32c03873.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_aefdd3a341.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_e1ce26bcdc.png.png

I don't really understand your suggestion on how to fix the gap-problem. Could you explain this in detail?

When I saw that the rendering with GeoServer doesn't look really good, I tried MapServer. I spent 2 whole days on it just to find out that it doesn't support SVGs as ExternalGraphics :frowning:

Thanks for your quick answer :slight_smile:

Christian.

Andrea Aime schrieb:

Sicky ha scritto:

Hi there!

First off: I'm running GeoServer 1.6.2 on Windows 2000 SP4.

I used some shape files representing a plan and created some SLDs to
visualize it according to a legal regulation. some parts of the legal
regulation were just the fill- and outline colors but mainly special symbols
and lines are used. one can get these as SVG, like this one for example:
http://sicky.i-networx.de/temp/geoserv/RsBaugrenze.svg
this represents a blue/black line.
(i know that an SLD could do that as well, but there are many others which
can't be represtented in SLD with CSS parameters)

I would suggest to stick with native SLD ways when possible thought,
they would be more efficient for sure.

As I said I made SLDs for the layers/shapes, here's an example which uses
the above mentionend SVG:
http://sicky.i-networx.de/temp/geoserv/Baugrenze_Li_style.sld

The Problem lays in the rendering:
http://sicky.i-networx.de/temp/geoserv/geoserv_svg_probs.png
Is there any method or anything to avoid these gaps and other flaws?

I think the problem is that the svg drawing area is not completely covered by the drawing primitives causing the gaps. But there is nothing
I can do about the "corner" case where the two lines are crossing,
the svg is turned into a bitmap that's being painted along the line,
there is nothing the user can do to prevent that.
Maybe some smart programming, but right now I only see lots of problems
trying to do that, and no good solution.

I see you have a MapServer preview in the browser. Is MapServer
able to do any better?

Cheers
Andrea

Christian Rüh ha scritto:

Hi Andrea!

The Problem is that I really have to stick to native SLD because I don't think I can represent lines with should look like these examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_b4dd2f7546.png.png
(this the png version of the svg symbol to visualize the line running vertically ["Grenze des räumlichen Geltungsbereichs"])

other examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_082ce01ebc.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_3b32c03873.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_aefdd3a341.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_e1ce26bcdc.png.png

I don't really understand your suggestion on how to fix the gap-problem. Could you explain this in detail?

I tried it out today (sorry for the delay) and yes, it's definitely a bug. I've opened a ticket against the bug tracker:
http://jira.codehaus.org/browse/GEOS-1877

I don't know when I'll have time to investigate further, but I hope
to solve this by the next release of geoserver (next month) since
I'm working on a similar topic (extending the stroking abilities
to use fonts, mapserver shapes and the like).

Cheers
Andrea

That's great! I'm really looking forward to it! :slight_smile:

Thanks,
Christian.

aaime wrote:

Christian Rüh ha scritto:

Hi Andrea!

The Problem is that I really have to stick to native SLD because I don't
think I can represent lines with should look like these examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_b4dd2f7546.png.png
(this the png version of the svg symbol to visualize the line running
vertically ["Grenze des räumlichen Geltungsbereichs"])

other examples:
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_082ce01ebc.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_3b32c03873.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_aefdd3a341.png.png
http://www.iai.fzk.de/www-extern/uploads/RTEmagicC_e1ce26bcdc.png.png

I don't really understand your suggestion on how to fix the gap-problem.
Could you explain this in detail?

I tried it out today (sorry for the delay) and yes, it's definitely a
bug. I've opened a ticket against the bug tracker:
http://jira.codehaus.org/browse/GEOS-1877

I don't know when I'll have time to investigate further, but I hope
to solve this by the next release of geoserver (next month) since
I'm working on a similar topic (extending the stroking abilities
to use fonts, mapserver shapes and the like).

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Rendering-SVGs-(used-in-SLD-as-ExternalGraphics)-tp16608367p16743535.html
Sent from the GeoServer - User mailing list archive at Nabble.com.