[Gdal-dev] Questions and comments about ogr styles

Frédéric Trastour support at geoimage.fr
Wed Jan 29 08:24:06 EST 2003


Hello,

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
comments.

* 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
      pszStyle=CPLSPrintf("BRUSH(fc:#%6.6x,id:\"mapinfo-brush-%d.ogr-brush-%d\")",
      m_sBrushDef.rgbFGColor,
      m_sBrushDef.nFillPattern,nOGRStyle);
    else
      pszStyle=CPLSPrintf("BRUSH(fc:#%6.6x,bc:#%6.6x,id:\"mapinfo-brush-%d.ogr-brush-%d\")",
      m_sBrushDef.rgbFGColor,
      m_sBrushDef.rgbBGColor,
      m_sBrushDef.nFillPattern,nOGRStyle);
     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.

_________________________________________________________________
Frédéric Trastour - SpaceEyes


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030129/47d86872/attachment.html


More information about the Gdal-dev mailing list