[gdal-dev] Style Tool in C API

Nik Sands nixanz at nixanz.com
Thu Jul 31 21:37:40 PDT 2014


grrr... I've found the answer to my own question.  Please ignore my query below.  For some reason my searching through the doco before I sent the email didn't find what I wanted, but after sending the email, I found it:

typedef enum ogr_style_tool_param_pen_id
{  
    OGRSTPenColor       = 0,                   
    OGRSTPenWidth       = 1,                   
    OGRSTPenPattern     = 2,
    OGRSTPenId          = 3,
    OGRSTPenPerOffset   = 4,
    OGRSTPenCap         = 5,
    OGRSTPenJoin        = 6,
    OGRSTPenPriority    = 7,
    OGRSTPenLast        = 8
              
} OGRSTPenParam;

(and other similar enums).

Cheers,
Nik.


On 1 Aug 2014, at 2:20 pm, Nik Sands <nixanz at nixanz.com> wrote:

> Hi guys,
> 
> I found that there seems to be no explicit C API for the non-generic style tool classes such as 'OGRStylePen'.  Now I've just found the documentation at https://trac.osgeo.org/gdal/wiki/rfc18_ogr_styles_c_api which states that this is deliberate and that they are unecessary, stating:
> 
> 	• NO wrappers will be needed for the following C++ classes which are handled internally by the OGR_ST_* wrappers above:
>    class OGRStylePen : public OGRStyleTool
>    class OGRStyleBrush : public OGRStyleTool
>    class OGRStyleSymbol : public OGRStyleTool
>    class OGRStyleLabel : public OGRStyleTool
> 
> So I'm wondering what is the correct way, in the C API, to do the equivalent of the 'Color' method on the C++ class 'OGRStylePen'?  Eg, is there some way of matching up a parameter number in a 'OGRStyleToolH' with a parameter type (such as color)?  Eg, are the different parameter types all guaranteed to be at a specific parameter number?  Otherwise how do I know which parameter (by number) is which without fully parsing the style string myself?  If this guess is correct, is there a documented index telling me which paramters have which parameter index numbers.
> 
> Or if I'm completely off the mark, can somebody please set me straight with the correct usage to get a color from a OGRStyleToolH in the C API?
> 
> Cheers,
> Nik.
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list