385 stringstream strstrFileName;
480 strFilePathName.append(
"_");
481 stringstream ststrTmp;
492 strFilePathName.append(ststrTmp.str());
493 strstrFileName << ststrTmp.str();
504 if (pGDALDriver == NULL)
511 GDALDataset* pGDALDataSet = pGDALDriver->Create(strFilePathName.c_str(), 0, 0, 0, GDT_Unknown,
m_papszGDALVectorOptions);
512 if (pGDALDataSet == NULL)
515 << CPLGetLastErrorMsg() << endl;
520 OGRSpatialReference OGRSpatialRef;
529 OGRSpatialRef.importFromEPSG(25830);
532 OGRwkbGeometryType eGType = wkbUnknown;
533 string strType =
"unknown";
543 OGRLayer* pOGRLayer = pGDALDataSet->CreateLayer(strstrFileName.str().c_str(), &OGRSpatialRef, eGType,
m_papszGDALVectorOptions);
545 if (pOGRLayer == NULL)
547 cerr <<
ERR <<
"cannot create '" << strType <<
"' layer in " << strFilePathName << endl
548 << CPLGetLastErrorMsg() << endl;
553 CPLPushErrorHandler(CPLQuietErrorHandler);
559 eGType = wkbLineString;
563 string strFieldValue1 =
"Coast";
564 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
565 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
567 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
568 << CPLGetLastErrorMsg() << endl;
575 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
578 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
581 pOGRFeature->SetField(strFieldValue1.c_str(), i);
584 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
586 OGRls.addPoint(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX(),
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
588 pOGRFeature->SetGeometry(&OGRls);
591 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
593 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl
594 << CPLGetLastErrorMsg() << endl;
600 OGRFeature::DestroyFeature(pOGRFeature);
608 eGType = wkbLineString;
612 string strFieldValue1 =
"NMR";
613 string strFieldValue2 =
"tiempo";
614 string strFieldValue3 =
"surge_mm";
616 string strFieldValue4 =
"runup_mm";
647 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
648 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
649 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTInteger64);
650 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
652 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
653 << CPLGetLastErrorMsg() << endl;
656 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
658 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
659 << CPLGetLastErrorMsg() << endl;
662 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
664 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl
665 << CPLGetLastErrorMsg() << endl;
670 OGRLineString OGR2ls;
705 OGRFeature* pOGR3Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
706 OGRFieldDefn OGRField6(strFieldValue1.c_str(), OFTReal);
707 OGRFieldDefn OGRField7(strFieldValue2.c_str(), OFTReal);
708 OGRFieldDefn OGRField4(strFieldValue3.c_str(), OFTInteger64);
709 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
711 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
712 << CPLGetLastErrorMsg() << endl;
715 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
717 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
718 << CPLGetLastErrorMsg() << endl;
721 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
723 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl
724 << CPLGetLastErrorMsg() << endl;
729 OGRLineString OGR3ls;
736 pOGR3Feature->SetField(strFieldValue3.c_str(), surge_level);
746 pOGR3Feature->SetGeometry(&OGR3ls);
750 if (pOGRLayer->CreateFeature(pOGR3Feature) != OGRERR_NONE)
752 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl
753 << CPLGetLastErrorMsg() << endl;
759 OGRFeature::DestroyFeature(pOGR3Feature);
765 OGRFeature* pOGR4Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
766 OGRFieldDefn OGRField8(strFieldValue1.c_str(), OFTReal);
767 OGRFieldDefn OGRField9(strFieldValue2.c_str(), OFTReal);
768 OGRFieldDefn OGRField5(strFieldValue4.c_str(), OFTInteger64);
769 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
771 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
774 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
776 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
779 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
781 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
785 OGRLineString OGR4ls;
791 pOGR4Feature->SetField(strFieldValue4.c_str(), runup_level);
802 pOGR4Feature->SetGeometry(&OGR4ls);
806 if (pOGRLayer->CreateFeature(pOGR4Feature) != OGRERR_NONE)
808 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
814 OGRFeature::DestroyFeature(pOGR4Feature);
825 eGType = wkbLineString;
829 string strFieldValue1 =
"Normal";
830 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
831 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
833 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
834 << CPLGetLastErrorMsg() << endl;
839 string strFieldValue2 =
"StartCoast";
840 string strFieldValue3 =
"EndCoast";
841 string strFieldValue4 =
"HitLand";
842 string strFieldValue5 =
"HitCoast";
843 string strFieldValue6 =
"HitNormal";
844 string strFieldValue7 =
"CShore";
846 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTInteger);
847 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTInteger);
848 OGRFieldDefn OGRField4(strFieldValue4.c_str(), OFTInteger);
849 OGRFieldDefn OGRField5(strFieldValue5.c_str(), OFTInteger);
850 OGRFieldDefn OGRField6(strFieldValue6.c_str(), OFTInteger);
851 OGRFieldDefn OGRField7(strFieldValue7.c_str(), OFTInteger);
853 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
855 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
858 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
860 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
863 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
865 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
868 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
870 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
873 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
875 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
878 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
880 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 7 '" << strFieldValue7 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
887 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
889 for (
int j = 0; j <
m_VCoast[i].nGetNumProfiles(); j++)
896 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
899 pOGRFeature->SetField(strFieldValue1.c_str(), j);
900 pOGRFeature->SetField(strFieldValue2.c_str(), 0);
901 pOGRFeature->SetField(strFieldValue3.c_str(), 0);
902 pOGRFeature->SetField(strFieldValue4.c_str(), 0);
903 pOGRFeature->SetField(strFieldValue5.c_str(), 0);
904 pOGRFeature->SetField(strFieldValue6.c_str(), 0);
905 pOGRFeature->SetField(strFieldValue7.c_str(), 0);
907 pOGRFeature->SetField(strFieldValue2.c_str(), 1);
909 pOGRFeature->SetField(strFieldValue3.c_str(), 1);
911 pOGRFeature->SetField(strFieldValue4.c_str(), 1);
913 pOGRFeature->SetField(strFieldValue5.c_str(), 1);
915 pOGRFeature->SetField(strFieldValue6.c_str(), 1);
917 pOGRFeature->SetField(strFieldValue7.c_str(), 1);
923 pOGRFeature->SetGeometry(&OGRls);
927 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
929 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" and profile " << j <<
" in " << strFilePathName << endl
930 << CPLGetLastErrorMsg() << endl;
935 OGRFeature::DestroyFeature(pOGRFeature);
957 string strFieldValue1;
959 strFieldValue1 =
"Curve";
961 strFieldValue1 =
"SC_Energy";
963 strFieldValue1 =
"MeanEnergy";
965 strFieldValue1 =
"Height";
967 strFieldValue1 =
"Node";
969 strFieldValue1 =
"Notch";
971 strFieldValue1 =
"Wavesetup";
973 strFieldValue1 =
"Stormsurge";
975 strFieldValue1 =
"Runup";
977 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
978 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
980 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
981 << CPLGetLastErrorMsg() << endl;
987 OGRMultiLineString OGRmls;
990 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
992 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
995 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
998 OGRPt.setX(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX());
999 OGRPt.setY(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
1000 pOGRFeature->SetGeometry(&OGRPt);
1004 double dCurvature =
m_VCoast[i].dGetDetailedCurvature(j);
1009 pOGRFeature->SetField(strFieldValue1.c_str(), dCurvature);
1014 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1015 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1017 pOGRFeature->SetField(strFieldValue1.c_str(),
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy());
1022 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1023 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1026 double dEnergy =
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy();
1030 pOGRFeature->SetField(strFieldValue1.c_str(), dEnergy);
1036 double dHeight =
m_VCoast[i].dGetBreakingWaveHeight(j);
1037 pOGRFeature->SetField(strFieldValue1.c_str(), dHeight);
1042 double dWaveSetupSurge =
m_VCoast[i].dGetWaveSetupSurge(j);
1043 pOGRFeature->SetField(strFieldValue1.c_str(), dWaveSetupSurge);
1054 double dRunUp =
m_VCoast[i].dGetRunUp(j);
1055 pOGRFeature->SetField(strFieldValue1.c_str(), dRunUp);
1059 int nNode =
m_VCoast[i].nGetPolygonNode(j);
1064 pOGRFeature->SetField(strFieldValue1.c_str(), nNode);
1069 if (pCoastLandform == NULL)
1070 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1074 double dNotchDepth = 0.0;
1085 pOGRFeature->SetField(strFieldValue1.c_str(), dNotchDepth);
1090 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1092 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" point " << j <<
" in " << strFilePathName << endl
1093 << CPLGetLastErrorMsg() << endl;
1098 OGRFeature::DestroyFeature(pOGRFeature);
1112 strFieldValue1 =
"Angle",
1113 strFieldValue2 =
"Height";
1116 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1117 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1119 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1120 << CPLGetLastErrorMsg() << endl;
1125 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1126 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1128 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1129 << CPLGetLastErrorMsg() << endl;
1134 OGRLineString OGRls;
1135 OGRMultiLineString OGRmls;
1146 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1151 pOGRFeature->SetGeometry(&OGRPt);
1154 dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetWaveAngle(),
1161 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1162 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1165 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1167 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1168 << CPLGetLastErrorMsg() << endl;
1173 OGRFeature::DestroyFeature(pOGRFeature);
1188 strFieldValue1 =
"Angle",
1189 strFieldValue2 =
"Height";
1192 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1193 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1195 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1196 << CPLGetLastErrorMsg() << endl;
1201 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1202 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1204 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1205 << CPLGetLastErrorMsg() << endl;
1210 OGRLineString OGRls;
1211 OGRMultiLineString OGRmls;
1219 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1224 pOGRFeature->SetGeometry(&OGRPt);
1234 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1235 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1238 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1240 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1241 << CPLGetLastErrorMsg() << endl;
1246 OGRFeature::DestroyFeature(pOGRFeature);
1255 eGType = wkbPolygon;
1256 strType =
"polygon";
1260 strFieldValue1 =
"Polygon",
1261 strFieldValue2 =
"CoastNode",
1262 strFieldValue3 =
"TotSedChng",
1263 strFieldValue4 =
"FinSedChng",
1264 strFieldValue5 =
"SndSedChng",
1265 strFieldValue6 =
"CrsSedChng";
1267 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1268 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1270 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1271 << CPLGetLastErrorMsg() << endl;
1275 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTInteger);
1276 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1278 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1279 << CPLGetLastErrorMsg() << endl;
1283 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTReal);
1284 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1286 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl
1287 << CPLGetLastErrorMsg() << endl;
1291 OGRFieldDefn OGRField4(strFieldValue4.c_str(), OFTReal);
1292 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1294 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl
1295 << CPLGetLastErrorMsg() << endl;
1299 OGRFieldDefn OGRField5(strFieldValue5.c_str(), OFTReal);
1300 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1302 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl
1303 << CPLGetLastErrorMsg() << endl;
1307 OGRFieldDefn OGRField6(strFieldValue6.c_str(), OFTReal);
1308 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1310 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl
1311 << CPLGetLastErrorMsg() << endl;
1316 OGRLineString OGRls;
1318 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1320 for (
int j = 0; j <
m_VCoast[i].nGetNumPolygons(); j++)
1323 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1328 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1340 pOGRFeature->SetGeometry(&OGRls);
1343 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1345 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" polygon " << j <<
" in " << strFilePathName << endl
1346 << CPLGetLastErrorMsg() << endl;
1352 OGRFeature::DestroyFeature(pOGRFeature);
1361 eGType = wkbLineString;
1365 string strFieldValue1 =
"ShadowLine";
1366 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1367 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1369 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1370 << CPLGetLastErrorMsg() << endl;
1375 OGRLineString OGRls;
1377 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1379 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowBoundaries(); j++)
1382 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1385 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1389 for (
int nn = 0; nn < LShadow.
nGetSize(); nn++)
1392 pOGRFeature->SetGeometry(&OGRls);
1395 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1397 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl
1398 << CPLGetLastErrorMsg() << endl;
1404 OGRFeature::DestroyFeature(pOGRFeature);
1413 eGType = wkbLineString;
1417 string strFieldValue1 =
"DdriftLine";
1418 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1419 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1421 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1422 << CPLGetLastErrorMsg() << endl;
1427 OGRLineString OGRls;
1429 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1431 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowDowndriftBoundaries(); j++)
1434 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1437 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1441 for (
int nn = 0; nn < LDowndrift.
nGetSize(); nn++)
1444 pOGRFeature->SetGeometry(&OGRls);
1447 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1449 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl
1450 << CPLGetLastErrorMsg() << endl;
1456 OGRFeature::DestroyFeature(pOGRFeature);
1470 strFieldValue1 =
"Angle",
1471 strFieldValue2 =
"Height";
1474 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1475 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1477 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1478 << CPLGetLastErrorMsg() << endl;
1483 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1484 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1486 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1487 << CPLGetLastErrorMsg() << endl;
1492 OGRLineString OGRls;
1493 OGRMultiLineString OGRmls;
1501 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1506 pOGRFeature->SetGeometry(&OGRPt);
1508 double dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveAngle();
1509 double dHeight =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveHeight();
1515 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1516 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1519 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1521 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1522 << CPLGetLastErrorMsg() << endl;
1527 OGRFeature::DestroyFeature(pOGRFeature);
1534 CPLPopErrorHandler();
1537 GDALClose(pGDALDataSet);