[gdal-dev] Label from OGR Style in a VRT output over a tiff in a geospatial PDF

Christy Nieman cnieman at dmsolutions.ca
Mon Jul 9 11:03:50 PDT 2012


Hello,

I'm trying to overlay vectors in a PDF with a geoTIFF as the backdrop 
with GDAL compiled from trunk last Friday.  I had no problem adding a 
point layer and a polygon layer to a VRT and giving them 
colours/symbols/outlines.  But I tried adding labels to the point layer 
by specifying the field containing the label text, and all that gets 
displayed for text is {NAME}.  VRT definition:

<OGRVRTDataSource>

<OGRVRTLayer name="countries">
<SrcDataSource>/mnt/data/naturalearth/ne_10m_admin_0_countries.shp</SrcDataSource> 

<GeometryType>wkbMultiPolygon</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<SrcSQL>SELECT *,'BRUSH(fc:#367C23);PEN(c:#B7B7B7,w:1px)' AS OGR_STYLE 
FROM ne_10m_admin_0_countries</SrcSQL>
</OGRVRTLayer>

<OGRVRTLayer name="cities">
<SrcDataSource>/mnt/data/naturalearth/110m-populated-places-simple/ne_110m_populated_places_simple.shp</SrcDataSource> 

<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<SrcSQL>SELECT 
*,'SYMBOL(c:#0000FF,id:ogr-sym-9;s:9px);LABEL(s:40pt,t:{NAME})' AS 
OGR_STYLE FROM ne_110m_populated_places_simple</SrcSQL>
</OGRVRTLayer>

</OGRVRTDataSource>

 From what I understand, LABEL(s:40pt,t:{NAME}) should use the NAME 
attribute field for the labels, but it is using "{NAME}" as the text.

Could someone point me in the right direction?

Thanks,
Christy



More information about the gdal-dev mailing list