[gdal-dev] OGRStyleLabel/OGRStyleTool units

Andre Vautour andre.vautour at caris.com
Tue Aug 13 04:38:38 PDT 2013


I am trying to interpret font sizes coming from OGR feature style strings.

I would expect a font size in ground units to be scale-dependent 
inasmuch as a label would get smaller when you zoom out and bigger when 
you zoom in. I would expect a font size in pts, mm, inches, pixels, etc. 
to be scale-independent and to be drawn with that size at the current 
display scale.

The problem I have encountered is that the style tools do not seem to 
offer a way to get at the input units (OGRStyleValue::eUnit) of a given 
parameter. The classes only seem to offer a way to convert the values 
from their unexposed input units to some given output units.

Is there a way to get at that information? If not, would it make sense 
to add a GetInputUnit(Param) method on the OGRStyleTool classes?
OGRSTUnitId GetInputUnit(OGRSTLabelParam eParam, GBool &bValueIsNull);

I have also considered trying to use SetInternalInputUnitFromParam to 
work around the problem at my level, but I cannot seem to get at the 
original parameter string as GetParmStr gives back a unit-converted string.

Thanks,
Andre

Any views or opinions expressed in this email are solely those of the 
author and do not necessarily represent those of the company. No binding 
contract will result from this email until such time as a written 
document is signed on behalf of the company.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130813/d3ef93ea/attachment.html>


More information about the gdal-dev mailing list