[fdo-trac] #405: fatal error while importing specific shapefile
FDO
trac_fdo at osgeo.org
Tue Oct 7 02:46:48 EDT 2008
#405: fatal error while importing specific shapefile
----------------------------+-----------------------------------------------
Reporter: cuic | Owner: cuic
Type: defect | Status: new
Priority: major | Milestone:
Component: SHP Provider | Version: 3.3.1
Severity: 2 | Keywords:
External_id: |
----------------------------+-----------------------------------------------
The type of all the shapes in the imported shapefile are PolygonZShape.
For some shapes, m_dMMin and m_dMMax are 0. In the SHP specification,
there is a note about the M bounding box: if M values are not used then
Mmin and Mmax are 0.0.
But according to the following codes in
{{{
ShapeFileBase::GetFileHeaderDetails (), ShapeFileBase .cpp
}}}
, m_bMDataPresent which is a flag indicating whether a shape has “M”
value is set to true in such situation. Then fatal error may occure when
it tries to read the "M" value.
{{{
if ((m_dMMin > fNO_DATA) && (m_dMMax > fNO_DATA))
{
m_bMDataPresent = true;
if (m_nFileLength * WORD_SIZE_IN_BYTES > SHPHeaderSize) // only check
if there are shapes
CheckBoundingBox(m_dMMin, m_dMMax, eMinMMaxM);
}
else
m_bMDataPresent = false;
}}}
To fix the defect, change the if condition to:
{{{
if ((m_dMMin > fNO_DATA) && (m_dMMax > fNO_DATA) && (m_dMMin != 0.0) &&
(m_dMMax != 0.0))
}}}
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/405>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list