+ bool IsLinear = aLCM->CheckLinear();
+ HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, SortedListOfAttr);
+ if ( aDlg.exec() == HYDROGUI_ExportLandCoverMapDlg::Accepted )
+ {
+ //In our case : aSeq.Size() == 1
+ //Export of multiple landcover maps into the one shp-file is disallowed.
+ QString aCItem = aDlg.getCurrentItem();
+ Handle(HYDROData_StricklerTable) aStricklerTableObj;
+ {
+ HYDROData_Iterator anIt( aDoc, KIND_STRICKLER_TABLE );
+ for( ; anIt.More(); anIt.Next() )
+ {
+ aStricklerTableObj = Handle(HYDROData_StricklerTable)::DownCast( anIt.Current() );
+ if ( !aStricklerTableObj.IsNull() && aStricklerTableObj->GetAttrName() == aCItem)
+ break;
+ }
+ }
+
+ //export shape-data
+ anExporter.Export(aFileName, aLCM, aNonExpList, false, !IsLinear, aDlg.getDeflValue());
+ QString aDBFFileName = aFileName.replace( ".shp", ".dbf", Qt::CaseInsensitive);
+ //Even if attribute-checkbox is unchecked, the .dbf-file should be removed.
+ //otherwise it may be used with wrong .shp-file. This is an incorrect behaivor.
+ remove (aDBFFileName.toStdString().c_str());
+ bool bToSaveAttrInfo = aDlg.getAttrCheckBoxState() && !aDlg.getCurrentItem().isEmpty();
+ if (bToSaveAttrInfo)
+ {
+ //export attribute info
+ QStringList anAttrValues;
+ QStringList aStricklerTypes;
+ if (aNonExpList.empty())
+ {
+ HYDROData_LandCoverMap::Explorer aLCMIt( aLCM );
+ for( ; aLCMIt.More(); aLCMIt.Next() )
+ {
+ QString aST = aLCMIt.StricklerType();
+ anAttrValues << aStricklerTableObj->GetAttrValue(aST);
+ aStricklerTypes << aST;
+ }
+ }
+ aLCM->ExportDBF(aDBFFileName, aCItem, anAttrValues, aStricklerTypes);
+ }
+ }
+ else
+ {
+ abort();
+ return;
+ }
+