I am using C++ geodatabase API 1.4 to read File geodatabase. It works great for the all samples that comes with the API.
However, I tried a File geodatabase created in ArcGIS V10 and seems whenever I retrieve the shape type for a geometry polygon or polyline I get invalid shaptype value (huge number). If I assume the default shape type all good.
if (multiPartShapeBuffer.GetShapeType(shapeType) != S_OK)
return false; ;
shapeType is huge number and return value IS S_OK.
Here is a code snippet
// Import feature class point
bool ImportGeodatabaseImpl::ImportFeatureClassPoint(EnumRows &featureClass, const Dbms::LayerPtr layer)
// featureClass is the rows.
ShapeType shapeType = ShapeType::shapeNull;
while (featureClass.Next(row) == S_OK)
// Update the progress
// Check if the operation has been cancelled
if (row.GetGeometry(pointShapeBuffer) != S_OK)
if (pointShapeBuffer.GetShapeType(shapeType) != S_OK)
// Here shapeType is big number
bool isShapeValid = true;
// Shape type not supported
isShapeValid = false;
// The Geodatabase file sample used for the unit test does not have a valid shape type value hence we use the default to shapePoint.
shapeType = ShapeType::shapePoint;
// Do other stuff for baseed on the shape type
The sample file goedatabas is attached.
Also, on a related matter the C++ Geodatabse API 1.4 VS2013 has a dependency on VS 2008. If you open up "bin\FileGDBAPI.dll" in text editor and search for the manifest you will find the below, relying on CRT version 9 (VS 2008).
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
It could be an error code or just overflow.
I thought each feature class allowed to have one geometry type but could have different shape types of the given geometry type. Like for instance geometry type point, could have those shape types : point, pointZ, point M, pointMZ?
Then why shape type is associated with a each row while geometry type is associated with the table.
Also, as a kind reminder could we have the C++ file geodatabase API 1.4 (VS2013) without the reliance on VS 2008(CRT 9) as mentioned my above in my question
It is best practice to place one question in each question. Generally, one of two things happens when you post an "and" query:
The CRT issue should be branched into a separate question (in this same Place)
Each feature class can contain only one shape type. You cannit have pointM, pointZ and pointMZ types in the same feature class.The only exception in shapeNull which can be in any feature class.
Good to know.
so, if the first encounter shape type, in a feature class table, that is no ShapeNull, it will be the same for all rows.