[gdal-dev] feature styles: svg symbol

Even Rouault even.rouault at mines-paris.org
Mon Aug 4 11:21:43 PDT 2014


Le lundi 04 août 2014 20:16:03, Martin Landa a écrit :
> Hi,
> 
> 2014-08-04 20:06 GMT+02:00 Even Rouault <even.rouault at mines-paris.org>:
> >> it's not clear to me how works system-specific symbols names [1].
> >> Let's say that I would like to use svg symbols stored on local disc a
> >> define them as symbols within OGR Feature Style engine. Is it
> >> possible?
> > 
> > Exactly same question asked a few days ago :
> > http://lists.osgeo.org/pipermail/gdal-dev/2014-July/thread.html#39568
> 
> ah, sorry, I overlooked that. I can understand example for MapServer,
> but eg. when extending KML driver for supporting SVG symbols for
> points, the symbol id would be uri of SVG file, right?

yes that's reasonable, but the LIBKML driver should already do that :


OGRStyleSymbol *kml2symbol (
    IconStylePtr poKmlIconStyle,
    OGRStyleSymbol *poOgrStyleSymbol)
{

    if (!poOgrStyleSymbol)
        poOgrStyleSymbol = new OGRStyleSymbol (  );

    /***** id (kml icon) *****/

    if ( poKmlIconStyle->has_icon (  ) ) {
        IconStyleIconPtr poKmlIcon = poKmlIconStyle->get_icon (  );

        if ( poKmlIcon->has_href (  ) ) {
            std::string oIcon = "\"";
            oIcon.append ( poKmlIcon->get_href (  ).c_str (  ) );
            oIcon.append ( "\"" );
            poOgrStyleSymbol->SetId ( oIcon.c_str (  ) );

        }
    }

And the reverse code also exists.

> 
> Martin

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list