I am using GEOServer and I have:
1. My own .sld style with external graphics (svg), which works totally fine
while it getting image from the local directory: "file:/d:/images"
2. I have table in database with .svg images. I can get this image by
following request to my server in the Internet browser: http://127.0.0.1:3333/getImage.rsc?name=123. And it works perfect.
Then I am trying to get this image from SLD file. Here is a sld fragment:
And as a result I have nothing instead of image. Not any mistakes.. just
nothing. Style is still working, but In legend i have empty space instead
of pic. I am checking my server with images, it looks like GeoServer is not
sending any request to my server. So problem is not in response, but in the
request.
So my question is *Can i provide this href
(http://127.0.0.1:3333/getImage.rsc?name=123) as a href to svg image?* Is it
any mistake in it? Or any other ideas why it happens?
Thank you.
Although the actual tag is “Externalgraphic”, you typically refer in your SLD to the SVG image using the paths on the local file system as you describe in use case 1. Not sure whether the setup in use case 2 using a small script to retrieve an image from a small database table is something catered for in the current code. Andrea?
My own .sld style with external graphics (svg), which works totally fine
while it getting image from the local directory: “file:/d:/images”
I have table in database with .svg images. I can get this image by
following request to my server in the Internet browser: http://127.0.0.1:3333/getImage.rsc?name=123. And it works perfect.
Then I am trying to get this image from SLD file. Here is a sld fragment:
And as a result I have nothing instead of image. Not any mistakes… just
nothing. Style is still working, but In legend i have empty space instead
of pic. I am checking my server with images, it looks like GeoServer is not
sending any request to my server. So problem is not in response, but in the
request.
So my question is Can i provide this href
(http://127.0.0.1:3333/getImage.rsc?name=123) as a href to svg image? Is it
any mistake in it? Or any other ideas why it happens?
Thank you.
On Tue, Jun 18, 2013 at 4:21 PM, Edward Mac Gillavry <
emacgillavry@anonymised.com> wrote:
Hi Amiala,
Although the actual tag is "Externalgraphic", you typically refer in your
SLD to the SVG image using the paths on the local file system as you
describe in use case 1. Not sure whether the setup in use case 2 using a
small script to retrieve an image from a small database table is something
catered for in the current code. Andrea?
It may well be that the Apache Batik code doing the parsing cannot handle
the remote resource, we normally just give it a string representing
the path to the file, so it might be that it just works on local files.
I see the code could also be modified to give it a stream instead, maybe
that would work even with remote sources... it's something that needs
to be tested.
Can anybody open a ticket on jira.codehaus.org? If anybody is interested in
trying a fix out, the class to be modified is SVGGraphicFactory
back in GeoTools gt-svg module
On Wed, Jun 19, 2013 at 10:16 AM, Amiala <belka91@anonymised.com> wrote:
Edward, Andrea,
Thank you a lot for your answers, now everything is clear for me.
I am new here... So if we finally decide to modified SVGGraphicFactory as
you said, should i post it later somewhere?
The ideal way is to fork geotools in your github repo, make the change, and
create a pull request out of it.
A less ideal, but still workable solution is to attach a patch file to
jira.codehaus.org,
in a GeoTools related improvement request