Ticket #307 (new defect)

Opened 5 years ago

Last modified 8 months ago

Mapinfo driver always specify the background color of polygons.

Reported by: dev@geoimage.fr Assigned to: warmerdam
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: mloskot

Description (Last modified by mloskot)

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

02/21/04 00:43:46 changed by warmerdam

correct before 1.2.0 release. 

12/22/07 04:03:21 changed by mloskot

  • cc set to mloskot.
  • description changed.