[Gdal-dev] Some questions about OGR styles

Frédéric Trastour support at geoimage.fr
Tue Mar 11 11:30:00 EST 2003


I use GDAL and OGR in my application. It's a really great library.
Now I am using the feature style part and I have some questions and

* What is the 'ogr-pen-8' pre-prefined ogr style ? I don't understand the
sentence "alternate-line (sets every other pixel)".

* When I load a mapinfo file (tab or mif) the background color is always
defined for each polygon even if this color was defined as 'None' in mapinfo
 (for semi transparent filling).
I think that the function "ITABFeatureBrush::GetBrushStyleString()" should
be modified as follow :

const char *ITABFeatureBrush::GetBrushStyleString()
    const char *pszStyle = NULL;
    int    nOGRStyle  = 0;
    char szPattern[20];
    szPattern[0] = '\0';
    if (m_sBrushDef.nFillPattern == 1)              nOGRStyle = 1;
    else if (m_sBrushDef.nFillPattern == 3)      nOGRStyle = 2;
    else if (m_sBrushDef.nFillPattern == 4)      nOGRStyle = 3;
    else if (m_sBrushDef.nFillPattern == 5)      nOGRStyle = 5;
    else if (m_sBrushDef.nFillPattern == 6)      nOGRStyle = 4;
    else if (m_sBrushDef.nFillPattern == 7)      nOGRStyle = 6;
    else if (m_sBrushDef.nFillPattern == 8)      nOGRStyle = 7;

    if ( m_sBrushDef.bTransparentFill ) // don't specify the background color
     return pszStyle;

* The function OGRStyleTool::GetRGBFromString defaults the alpha value to
zero and there is no way when using this function to know if the returned value is the
default value or the value specified in the color string. The default value should
normally be set to 0xFF as specified in the doc.

Any comments appreciated,


Frédéric Trastour - SpaceEyes

More information about the Gdal-dev mailing list