[gdal-dev] Hide OGR_STYLE from PDF attributes

Even Rouault even.rouault at mines-paris.org
Mon Nov 12 13:40:36 PST 2012


Le lundi 12 novembre 2012 11:51:10, Jukka Rahkonen a écrit :
> Hi,
> 
> If I write some vector data from OGR_DATASOURCE into geospatial PDF and I
> would like to style symbols with OGR_STYLE, then ORG_STYLE string will
> also be written ínto the model tree of the resulting PDF file as an
> attribute. I consider that it would be better not to transfer OGR_STYLE at
> all as an attribute. If somebody really wants to send style definitions
> into PDF as attributes it could still be done by selecting styles another
> time with SQL with some other attribute name.
> 
> My select in the .vrt file is as follows
> <SrcSQL>SELECT *,ref as ID, 'SYMBOL(id:ogr-sym-3,c:#FF0000,s:10px)' as
> OGR_STYLE from points where highway='bus_stop'</SrcSQL>
> 

I'm not sure how to do that without adding a hack into the PDF driver (and 
potentially other drivers).

But I can offer an easy workaround. You can edit your VRT to explictely mention 
the fields you want to export. For example :

<OGRVRTDataSource>
    <OGRVRTLayer name="point">
        <SrcDataSource relativeToVRT="0" shared="1">point.vrt</SrcDataSource>
        <SrcSQL>SELECT *, 'SYMBOL(id:ogr-sym-3,c:#FF0000,s:10px)' as OGR_STYLE 
FROM point</SrcSQL>
        <Field name="id"/>
    </OGRVRTLayer>
</OGRVRTDataSource>


More information about the gdal-dev mailing list