Opened 21 years ago

Closed 9 years ago

#307 closed defect (fixed)

Mapinfo driver always specify the background color of polygons.

Reported by: dev@… Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Mateusz Łoskot

Description (last modified by Mateusz Łoskot)

Using Mapinfo driver,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;
}

Change History (3)

comment:1 by warmerdam, 20 years ago

correct before 1.2.0 release. 

comment:2 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Description: modified (diff)

comment:3 by Jukka Rahkonen, 9 years ago

Resolution: fixed
Status: newclosed

This seems to be implemented perhaps in year 2006 in file /trunk/gdal/ogr/ogrsf_frmts/mitab/mitab_feature.cpp from rows 8598 ->

Note: See TracTickets for help on using tickets.