[mapserver-dev] Problem in mapscript: from SLD to map ExternalGraphic SVG not supported

Luigi Pirelli luigi.pirelli at faunalia.it
Wed Jan 8 03:18:45 PST 2014


ok... thank you for clarification

I tested adding svg url and it seems to work. I'll prepare a little patch

Luigi Pirelli (luigi.pirelli at faunalia.it - luipir at gmail.com)


On 8 January 2014 12:07, <thomas.bonfort at gmail.com> wrote:

> Luigi,
>
> * loading of file:// protocols through curl was disabled with
> https://github.com/mapserver/mapserver/pull/4703 for security purposes.
> It probably makes sense to disable loading of arbitrary files from the
> filesystem to avoid leaking information about the server.
> * directly loading SVG urls or files in msAddImageSymbol would be a
> feasible enhancement, you can open a ticket for that, or even better submit
> a patch.
>
> --
> thomas
>
> On 7 janv. 2014, at 19:58, Luigi Pirelli <luigi.pirelli at faunalia.it>
> wrote:
>
> > Hi
> >
> > I've to show a problem using mapscript... I'm using mapscript creating
> map file starting form a SLD (calling applySLD) generated by QGIS
> (rt_mapserver_exporter plugin)
> >
> > a SLD file can be found here: https://gist.github.com/luipir/8304386
> >
> > it has been generated creating a simple point shape file and applying
> external SVG files in QGIS... I can provide all test files and qgis project
> and qml style
> >
> > None of external SVGs are exported in the map file... reading the
> mapscript code i can see:
> >
> > mapogcsld.c:2075 msSLDParseExternalGraphic(...)
> > manage external link only if mapserver is compiled with CURL (cmake
> default is NO)
> > if CURL is available then it manage only this formats:
> >
> >       (strcasecmp(pszFormat, "GIF") == 0 ||
> >        strcasecmp(pszFormat, "image/gif") == 0 ||
> >        strcasecmp(pszFormat, "PNG") == 0 ||
> >        strcasecmp(pszFormat, "image/png") == 0)) {
> >
> > then call msAddImageSymbol
> > and mapsymbol.c:364 - msAddImageSymbol
> >
> > manage only http
> >
> > If I try to "force" it strcasecmp(pszFormat, "image/svg+xml") == 0 in
> msSLDParseExternalGraphic
> > and strncasecmp(filename, "file", 4) == 0 in msAddImageSymbol
> >
> > the call msHTTPGetFile return this error message:
> >
> > MapServerError?: msHTTPExecuteRequests(): HTTP request error. HTTP:
> request failed with curl error code 1 (Protocol file not supported or
> disabled in libcurl) for file:///Antica-dir-scorr-fluv-2020.svg
> >
> > but CURL manage file:/// protocol... I can download it (adding complete
> path)
> >
> > so the QUESTION is
> >
> > 1) there is a reason that svg and file: protocol are not implemented?
> > 2) if it's a "bug" what whould be a good solution?
> >
> > thank you for your help
> >
> > Luigi Pirelli (luigi.pirelli at faunalia.it - luipir at gmail.com)
> >
> > p.s. i'm using 6.4 master code
> > _______________________________________________
> > mapserver-dev mailing list
> > mapserver-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20140108/3a2d6b68/attachment.html>


More information about the mapserver-dev mailing list