int ILI1Reader::ReadModel( ImdReader *poImdReader, const char *pszModelFilename, OGRILI1DataSource *poDS) { poImdReader->ReadModel(pszModelFilename); for (FeatureDefnInfos::const_iterator it = poImdReader->featureDefnInfos.begin(); it != poImdReader->featureDefnInfos.end(); ++it) { #if DEBUG_VERBOSE CPLDebug( "OGR_ILI", "Adding OGRILI1Layer with table '%s'", it->GetTableDefnRef()->GetName() ); #endif OGRILI1Layer* layer = new OGRILI1Layer( it->GetTableDefnRef(), it->poGeomFieldInfos, poDS); AddLayer(layer); // Create additional layers for surface and area geometries. for (GeomFieldInfos::const_iterator it2 = it->poGeomFieldInfos.begin(); it2 != it->poGeomFieldInfos.end(); ++it2) { if (it2->second.GetGeomTableDefnRef()) { OGRFeatureDefn* poGeomTableDefn = it2->second.GetGeomTableDefnRef(); OGRGeomFieldDefn* poOGRGeomFieldDefn = poGeomTableDefn->GetGeomFieldDefn(0); GeomFieldInfos oGeomFieldInfos; // We add iliGeomType to recognize Ili1 geom tables oGeomFieldInfos[poOGRGeomFieldDefn->GetNameRef()].iliGeomType = it2->second.iliGeomType; #if DEBUG_VERBOSE CPLDebug( "OGR_ILI", "Adding OGRILI1Layer with geometry table '%s'", poGeomTableDefn->GetName() ); #endif OGRILI1Layer* geomlayer = new OGRILI1Layer(poGeomTableDefn, oGeomFieldInfos, poDS); AddLayer(geomlayer); } } } codeBlank = poImdReader->codeBlank; CPLDebug( "OGR_ILI", "Ili1Format blankCode '%c'", poImdReader->codeBlank ); codeUndefined = poImdReader->codeUndefined; CPLDebug( "OGR_ILI", "Ili1Format undefinedCode '%c'", poImdReader->codeUndefined ); codeContinue = poImdReader->codeContinue; CPLDebug( "OGR_ILI", "Ili1Format continueCode '%c'", poImdReader->codeContinue ); return 0; }
int ILI2Reader::ReadModel(ImdReader *poImdReader, const char *modelFilename) { poImdReader->ReadModel(modelFilename); for (FeatureDefnInfos::const_iterator it = poImdReader->featureDefnInfos.begin(); it != poImdReader->featureDefnInfos.end(); ++it) { OGRLayer* layer = new OGRILI2Layer(it->GetTableDefnRef(), it->poGeomFieldInfos, NULL); m_listLayer.push_back(layer); } return 0; }