405 stringstream strstrFileName;
505 strFilePathName.append(
"_");
506 stringstream ststrTmp;
520 strFilePathName.append(ststrTmp.str());
521 strstrFileName << ststrTmp.str();
533 if (pGDALDriver == NULL)
540 GDALDataset * pGDALDataSet = pGDALDriver->Create(strFilePathName.c_str(), 0, 0, 0, GDT_Unknown,
m_papszGDALVectorOptions);
542 if (pGDALDataSet == NULL)
545 << CPLGetLastErrorMsg() << endl;
550 OGRSpatialReference OGRSpatialRef;
560 OGRSpatialRef.importFromEPSG(25830);
563 OGRwkbGeometryType eGType = wkbUnknown;
564 string strType =
"unknown";
574 OGRLayer * pOGRLayer = pGDALDataSet->CreateLayer(strstrFileName.str().c_str(), &OGRSpatialRef, eGType,
m_papszGDALVectorOptions);
576 if (pOGRLayer == NULL)
578 cerr <<
ERR <<
"cannot create '" << strType <<
"' layer in " << strFilePathName << endl
579 << CPLGetLastErrorMsg() << endl;
584 CPLPushErrorHandler(CPLQuietErrorHandler);
590 eGType = wkbLineString;
594 string strFieldValue1 =
"Coast";
595 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
597 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
599 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
600 << CPLGetLastErrorMsg() << endl;
607 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
610 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
613 pOGRFeature->SetField(strFieldValue1.c_str(), i);
616 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
618 OGRls.addPoint(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX(),
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
620 pOGRFeature->SetGeometry(&OGRls);
623 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
625 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl
626 << CPLGetLastErrorMsg() << endl;
632 OGRFeature::DestroyFeature(pOGRFeature);
640 eGType = wkbLineString;
644 string strFieldValue1 =
"NMR";
645 string strFieldValue2 =
"tiempo";
646 string strFieldValue3 =
"surge_mm";
648 string strFieldValue4 =
"runup_mm";
679 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
680 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
681 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTInteger64);
683 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
685 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
686 << CPLGetLastErrorMsg() << endl;
690 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
692 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
693 << CPLGetLastErrorMsg() << endl;
697 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
699 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl
700 << CPLGetLastErrorMsg() << endl;
705 OGRLineString OGR2ls;
741 OGRFeature * pOGR3Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
742 OGRFieldDefn OGRField6(strFieldValue1.c_str(), OFTReal);
743 OGRFieldDefn OGRField7(strFieldValue2.c_str(), OFTReal);
744 OGRFieldDefn OGRField4(strFieldValue3.c_str(), OFTInteger64);
746 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
748 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
749 << CPLGetLastErrorMsg() << endl;
753 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
755 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
756 << CPLGetLastErrorMsg() << endl;
760 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
762 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl
763 << CPLGetLastErrorMsg() << endl;
768 OGRLineString OGR3ls;
776 pOGR3Feature->SetField(strFieldValue3.c_str(), surge_level);
787 pOGR3Feature->SetGeometry(&OGR3ls);
791 if (pOGRLayer->CreateFeature(pOGR3Feature) != OGRERR_NONE)
793 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl
794 << CPLGetLastErrorMsg() << endl;
800 OGRFeature::DestroyFeature(pOGR3Feature);
807 OGRFeature * pOGR4Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
808 OGRFieldDefn OGRField8(strFieldValue1.c_str(), OFTReal);
809 OGRFieldDefn OGRField9(strFieldValue2.c_str(), OFTReal);
810 OGRFieldDefn OGRField5(strFieldValue4.c_str(), OFTInteger64);
812 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
814 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
818 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
820 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
824 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
826 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
831 OGRLineString OGR4ls;
838 pOGR4Feature->SetField(strFieldValue4.c_str(), runup_level);
849 pOGR4Feature->SetGeometry(&OGR4ls);
853 if (pOGRLayer->CreateFeature(pOGR4Feature) != OGRERR_NONE)
855 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
861 OGRFeature::DestroyFeature(pOGR4Feature);
872 eGType = wkbLineString;
876 string strFieldValue1 =
"CliffEdge";
877 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
879 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
881 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
882 << CPLGetLastErrorMsg() << endl;
889 for (
int i = 0; i < static_cast<int>(
m_VCliffEdge.size()); i++)
892 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
895 pOGRFeature->SetField(strFieldValue1.c_str(), i);
904 pOGRFeature->SetGeometry(&OGRls);
907 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
909 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cliff edge " << i <<
" in " << strFilePathName << endl
910 << CPLGetLastErrorMsg() << endl;
916 OGRFeature::DestroyFeature(pOGRFeature);
925 eGType = wkbLineString;
929 string strFieldValue1 =
"Normal";
930 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
932 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
934 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
935 << CPLGetLastErrorMsg() << endl;
940 string strFieldValue2 =
"StartCoast";
941 string strFieldValue3 =
"EndCoast";
942 string strFieldValue4 =
"HitLand";
943 string strFieldValue5 =
"HitIntervention";
944 string strFieldValue6 =
"HitCoast";
945 string strFieldValue7 =
"HitNormal";
946 string strFieldValue8 =
"CShore";
948 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTInteger);
949 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTInteger);
950 OGRFieldDefn OGRField4(strFieldValue4.c_str(), OFTInteger);
951 OGRFieldDefn OGRField5(strFieldValue5.c_str(), OFTInteger);
952 OGRFieldDefn OGRField6(strFieldValue6.c_str(), OFTInteger);
953 OGRFieldDefn OGRField7(strFieldValue7.c_str(), OFTInteger);
954 OGRFieldDefn OGRField8(strFieldValue7.c_str(), OFTInteger);
956 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
958 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
962 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
964 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
968 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
970 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
974 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
976 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
980 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
982 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
986 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
988 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 7 '" << strFieldValue7 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
992 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
994 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 8 '" << strFieldValue8 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1001 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1003 for (
int j = 0; j <
m_VCoast[i].nGetNumProfiles(); j++)
1010 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1013 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1014 pOGRFeature->SetField(strFieldValue2.c_str(), 0);
1015 pOGRFeature->SetField(strFieldValue3.c_str(), 0);
1016 pOGRFeature->SetField(strFieldValue4.c_str(), 0);
1017 pOGRFeature->SetField(strFieldValue5.c_str(), 0);
1018 pOGRFeature->SetField(strFieldValue6.c_str(), 0);
1019 pOGRFeature->SetField(strFieldValue7.c_str(), 0);
1020 pOGRFeature->SetField(strFieldValue8.c_str(), 0);
1023 pOGRFeature->SetField(strFieldValue2.c_str(), 1);
1026 pOGRFeature->SetField(strFieldValue3.c_str(), 1);
1029 pOGRFeature->SetField(strFieldValue4.c_str(), 1);
1032 pOGRFeature->SetField(strFieldValue5.c_str(), 1);
1035 pOGRFeature->SetField(strFieldValue6.c_str(), 1);
1038 pOGRFeature->SetField(strFieldValue7.c_str(), 1);
1041 pOGRFeature->SetField(strFieldValue8.c_str(), 1);
1047 pOGRFeature->SetGeometry(&OGRls);
1051 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1053 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" and profile " << j <<
" in " << strFilePathName << endl
1054 << CPLGetLastErrorMsg() << endl;
1059 OGRFeature::DestroyFeature(pOGRFeature);
1081 string strFieldValue1;
1084 strFieldValue1 =
"Curve";
1087 strFieldValue1 =
"SC_Energy";
1090 strFieldValue1 =
"MeanEnergy";
1093 strFieldValue1 =
"Height";
1096 strFieldValue1 =
"Node";
1099 strFieldValue1 =
"Notch";
1102 strFieldValue1 =
"Wavesetup";
1105 strFieldValue1 =
"Stormsurge";
1108 strFieldValue1 =
"Runup";
1110 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1112 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1114 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1115 << CPLGetLastErrorMsg() << endl;
1120 OGRLineString OGRls;
1121 OGRMultiLineString OGRmls;
1124 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1126 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
1129 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1132 OGRPt.setX(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX());
1133 OGRPt.setY(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
1134 pOGRFeature->SetGeometry(&OGRPt);
1138 double dCurvature =
m_VCoast[i].dGetDetailedCurvature(j);
1144 pOGRFeature->SetField(strFieldValue1.c_str(), dCurvature);
1150 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1151 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1154 pOGRFeature->SetField(strFieldValue1.c_str(),
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy());
1160 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1161 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1165 double dEnergy =
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy();
1169 pOGRFeature->SetField(strFieldValue1.c_str(), dEnergy);
1176 double dHeight =
m_VCoast[i].dGetBreakingWaveHeight(j);
1177 pOGRFeature->SetField(strFieldValue1.c_str(), dHeight);
1183 double dWaveSetupSurge =
m_VCoast[i].dGetWaveSetupSurge(j);
1184 pOGRFeature->SetField(strFieldValue1.c_str(), dWaveSetupSurge);
1196 double dRunUp =
m_VCoast[i].dGetRunUp(j);
1197 pOGRFeature->SetField(strFieldValue1.c_str(), dRunUp);
1202 int nNode =
m_VCoast[i].nGetPolygonNode(j);
1208 pOGRFeature->SetField(strFieldValue1.c_str(), nNode);
1215 if (pCoastLandform == NULL)
1216 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1221 double dNotchDepth = 0.0;
1232 pOGRFeature->SetField(strFieldValue1.c_str(), dNotchDepth);
1237 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1239 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" point " << j <<
" in " << strFilePathName << endl
1240 << CPLGetLastErrorMsg() << endl;
1245 OGRFeature::DestroyFeature(pOGRFeature);
1259 strFieldValue1 =
"Angle",
1260 strFieldValue2 =
"Height";
1263 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1265 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1267 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1268 << CPLGetLastErrorMsg() << endl;
1273 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1275 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1277 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1278 << CPLGetLastErrorMsg() << endl;
1283 OGRLineString OGRls;
1284 OGRMultiLineString OGRmls;
1295 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1300 pOGRFeature->SetGeometry(&OGRPt);
1303 dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetWaveAngle(),
1310 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1311 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1314 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1316 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1317 << CPLGetLastErrorMsg() << endl;
1322 OGRFeature::DestroyFeature(pOGRFeature);
1337 strFieldValue1 =
"Angle",
1338 strFieldValue2 =
"Height";
1341 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1343 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1345 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1346 << CPLGetLastErrorMsg() << endl;
1351 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1353 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1355 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1356 << CPLGetLastErrorMsg() << endl;
1361 OGRLineString OGRls;
1362 OGRMultiLineString OGRmls;
1370 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1375 pOGRFeature->SetGeometry(&OGRPt);
1385 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1386 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1389 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1391 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1392 << CPLGetLastErrorMsg() << endl;
1397 OGRFeature::DestroyFeature(pOGRFeature);
1406 eGType = wkbPolygon;
1407 strType =
"polygon";
1411 strFieldValue1 =
"Polygon",
1412 strFieldValue2 =
"CoastNode",
1413 strFieldValue3 =
"TotSedChng",
1414 strFieldValue4 =
"FinSedChng",
1415 strFieldValue5 =
"SndSedChng",
1416 strFieldValue6 =
"CrsSedChng";
1418 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1420 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1422 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1423 << CPLGetLastErrorMsg() << endl;
1427 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTInteger);
1429 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1431 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1432 << CPLGetLastErrorMsg() << endl;
1436 OGRFieldDefn OGRField3(strFieldValue3.c_str(), OFTReal);
1438 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1440 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl
1441 << CPLGetLastErrorMsg() << endl;
1445 OGRFieldDefn OGRField4(strFieldValue4.c_str(), OFTReal);
1447 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1449 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl
1450 << CPLGetLastErrorMsg() << endl;
1454 OGRFieldDefn OGRField5(strFieldValue5.c_str(), OFTReal);
1456 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1458 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl
1459 << CPLGetLastErrorMsg() << endl;
1463 OGRFieldDefn OGRField6(strFieldValue6.c_str(), OFTReal);
1465 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1467 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl
1468 << CPLGetLastErrorMsg() << endl;
1473 OGRLineString OGRls;
1475 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1477 for (
int j = 0; j <
m_VCoast[i].nGetNumPolygons(); j++)
1480 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1485 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1497 pOGRFeature->SetGeometry(&OGRls);
1500 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1502 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" polygon " << j <<
" in " << strFilePathName << endl
1503 << CPLGetLastErrorMsg() << endl;
1509 OGRFeature::DestroyFeature(pOGRFeature);
1518 eGType = wkbLineString;
1522 string strFieldValue1 =
"ShadowLine";
1523 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1525 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1527 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1528 << CPLGetLastErrorMsg() << endl;
1533 OGRLineString OGRls;
1535 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1537 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowBoundaries(); j++)
1540 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1543 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1548 for (
int nn = 0; nn < LShadow.
nGetSize(); nn++)
1551 pOGRFeature->SetGeometry(&OGRls);
1554 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1556 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl
1557 << CPLGetLastErrorMsg() << endl;
1563 OGRFeature::DestroyFeature(pOGRFeature);
1572 eGType = wkbLineString;
1576 string strFieldValue1 =
"DdriftLine";
1577 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTInteger);
1579 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1581 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1582 << CPLGetLastErrorMsg() << endl;
1587 OGRLineString OGRls;
1589 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1591 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowDowndriftBoundaries(); j++)
1594 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1597 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1602 for (
int nn = 0; nn < LDowndrift.
nGetSize(); nn++)
1605 pOGRFeature->SetGeometry(&OGRls);
1608 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1610 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl
1611 << CPLGetLastErrorMsg() << endl;
1617 OGRFeature::DestroyFeature(pOGRFeature);
1631 strFieldValue1 =
"Angle",
1632 strFieldValue2 =
"Height";
1635 OGRFieldDefn OGRField1(strFieldValue1.c_str(), OFTReal);
1637 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1639 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl
1640 << CPLGetLastErrorMsg() << endl;
1645 OGRFieldDefn OGRField2(strFieldValue2.c_str(), OFTReal);
1647 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1649 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl
1650 << CPLGetLastErrorMsg() << endl;
1655 OGRLineString OGRls;
1656 OGRMultiLineString OGRmls;
1664 OGRFeature * pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1669 pOGRFeature->SetGeometry(&OGRPt);
1671 double dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveAngle();
1672 double dHeight =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveHeight();
1678 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1679 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1682 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1684 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl
1685 << CPLGetLastErrorMsg() << endl;
1690 OGRFeature::DestroyFeature(pOGRFeature);
1698 CPLPopErrorHandler();
1701 GDALClose(pGDALDataSet);