mitab/mitab_tabfile.cpp
int TABFile::SetMIFCoordSys(const char *pszMIFCoordSys)
{
    if (m_eAccessMode != TABWrite)
    {
        CPLError(CE_Failure, CPLE_NotSupported,
                 "SetMIFCoordSys() can be used only with Write access.");
        return -1;
    }

    /*-----------------------------------------------------------------
     * Check that dataset has been created but no feature set yet.
     *----------------------------------------------------------------*/
    if (m_poMAPFile && m_nLastFeatureId < 1)
    {
        OGRSpatialReference *poSpatialRef;

        poSpatialRef = MITABCoordSys2SpatialRef( pszMIFCoordSys );

        if (poSpatialRef)
        {
            double dXMin, dYMin, dXMax, dYMax;
            if (SetSpatialRef(poSpatialRef) == 0)
            {
                if (MITABExtractCoordSysBounds(pszMIFCoordSys,
                                               dXMin, dYMin, 
                                               dXMax, dYMax) == TRUE)
                {
                    // If the coordsys string contains bounds, then use them
                    if (SetBounds(dXMin, dYMin, dXMax, dYMax) != 0)
                    {
                        // Failed Setting Bounds... an error should have
                        // been already reported.
                        return -1;
                    }
                }
            }
            else
            {
                // Failed setting poSpatialRef... and error should have 
                // been reported.
                return -1;
            }

            // Release our handle on poSpatialRef
            if( poSpatialRef->Dereference() == 0 )
                delete poSpatialRef;
        }
    }
    else
    {
        CPLError(CE_Failure, CPLE_AssertionFailed,
                 "SetMIFCoordSys() can be called only after dataset has been "
                 "created and before any feature is set.");
        return -1;
    }

    return 0;
}
/**********************************************************************
 *                   TABFile::SetMIFCoordSys()
 *
 * Set projection for a new file using a MIF coordsys string.
 *
 * This function must be called after creating a new dataset and before any
 * feature can be written to it.
 *
 * Returns 0 on success, -1 on error.
 **********************************************************************/
:SetMIFCoordSys()
Set projection for a new file using a MIF coordsys string.

This function must be called after creating a new dataset and before any
feature can be written to it.

Returns 0 on success, -1 on error.
: SetMIFCoordSys () Set projection for a new file using a MIF coordsys string . This function must be called after creating a new dataset and before any feature can be written to it . Returns 0 on success - 1 on error .
int TABFile::SetMIFCoordSys(const char *pszMIFCoordSys)
{
    if (m_eAccessMode != TABWrite)
    {
        CPLError(CE_Failure, CPLE_NotSupported,
                 "SetMIFCoordSys() can be used only with Write access.");
        return -1;
    }
    if (m_poMAPFile && m_nLastFeatureId < 1)
    {
        OGRSpatialReference *poSpatialRef;
        poSpatialRef = MITABCoordSys2SpatialRef( pszMIFCoordSys );
        if (poSpatialRef)
        {
            double dXMin, dYMin, dXMax, dYMax;
            if (SetSpatialRef(poSpatialRef) == 0)
            {
                if (MITABExtractCoordSysBounds(pszMIFCoordSys,
                                               dXMin, dYMin, 
                                               dXMax, dYMax) == TRUE)
                {
                    if (SetBounds(dXMin, dYMin, dXMax, dYMax) != 0)
                    {
                        return -1;
                    }
                }
            }
            else
            {
                return -1;
            }
            if( poSpatialRef->Dereference() == 0 )
                delete poSpatialRef;
        }
    }
    else
    {
        CPLError(CE_Failure, CPLE_AssertionFailed,
                 "SetMIFCoordSys() can be called only after dataset has been "
                 "created and before any feature is set.");
        return -1;
    }
    return 0;
}
int TABFile :: SetMIFCoordSys ( const char * pszMIFCoordSys ) { if ( m_eAccessMode != TABWrite ) { CPLError ( CE_Failure , CPLE_NotSupported , " " ) ; return -1 ; } if ( m_poMAPFile && m_nLastFeatureId < 1 ) { OGRSpatialReference * poSpatialRef ; poSpatialRef = MITABCoordSys2SpatialRef ( pszMIFCoordSys ) ; if ( poSpatialRef ) { double dXMin , dYMin , dXMax , dYMax ; if ( SetSpatialRef ( poSpatialRef ) == 0 ) { if ( MITABExtractCoordSysBounds ( pszMIFCoordSys , dXMin , dYMin , dXMax , dYMax ) == TRUE ) { if ( SetBounds ( dXMin , dYMin , dXMax , dYMax ) != 0 ) { return -1 ; } } } else { return -1 ; } if ( poSpatialRef -> Dereference ( ) == 0 ) delete poSpatialRef ; } } else { CPLError ( CE_Failure , CPLE_AssertionFailed , " " " " ) ; return -1 ; } return 0 ; }
TABFile::SetMIFCoordSys()
 Set projection for a new file using a MIF coordsys string.
TABFile :: SetMIFCoordSys () Set projection for a new file using a MIF coordsys string .
/*-----------------------------------------------------------------
     * Check that dataset has been created but no feature set yet.
     *----------------------------------------------------------------*/ // If the coordsys string contains bounds, then use them // Failed Setting Bounds... an error should have // been already reported. // Failed setting poSpatialRef... and error should have  // been reported. // Release our handle on poSpatialRef