411 stringstream strstrFileName;
413 OGRwkbGeometryType eGType = wkbUnknown;
414 string strType =
"unknown";
422 eGType = wkbLineString;
431 eGType = wkbLineString;
440 eGType = wkbLineString;
448 eGType = wkbLineString;
512 eGType = wkbLineString;
528 eGType = wkbLineString;
536 eGType = wkbLineString;
577 eGType = wkbLineString;
594 strFilePathName.append(
"_");
595 stringstream ststrTmp;
609 strFilePathName.append(ststrTmp.str());
610 strstrFileName << ststrTmp.str();
622 if (pGDALDriver == NULL)
629 GDALDataset* pGDALDataSet = pGDALDriver->Create(strFilePathName.c_str(), 0, 0, 0, GDT_Unknown,
m_papszGDALVectorOptions);
631 if (pGDALDataSet == NULL)
633 cerr <<
ERR <<
"cannot create " <<
m_strVectorGISOutFormat <<
" named " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
638 OGRSpatialReference OGRSpatialRef;
648 OGRSpatialRef.importFromEPSG(25830);
659 OGRLayer* pOGRLayer = pGDALDataSet->CreateLayer(strstrFileName.str().c_str(), &OGRSpatialRef, eGType,
m_papszGDALVectorOptions);
661 if (pOGRLayer == NULL)
663 cerr <<
ERR <<
"cannot create '" << strType <<
"' layer in " << strFilePathName << endl
664 << CPLGetLastErrorMsg() << endl;
669 CPLPushErrorHandler(CPLQuietErrorHandler);
676 string const strFieldValue1 =
"Coast";
677 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
679 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
681 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
688 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
691 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
694 pOGRFeature->SetField(strFieldValue1.c_str(), i);
697 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
699 OGRls.addPoint(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX(),
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
701 pOGRFeature->SetGeometry(&OGRls);
704 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
706 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
712 OGRFeature::DestroyFeature(pOGRFeature);
721 string const strFieldValue1 =
"NMR";
722 string const strFieldValue2 =
"tiempo";
723 string const strFieldValue3 =
"surge_mm";
725 string const strFieldValue4 =
"runup_mm";
753 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTReal);
754 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTReal);
755 OGRFieldDefn
const OGRField3(strFieldValue3.c_str(), OFTInteger64);
757 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
759 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
763 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
765 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
769 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
771 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
776 OGRLineString
const OGR2ls;
811 OGRFeature* pOGR3Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
812 OGRFieldDefn
const OGRField6(strFieldValue1.c_str(), OFTReal);
813 OGRFieldDefn
const OGRField7(strFieldValue2.c_str(), OFTReal);
814 OGRFieldDefn
const OGRField4(strFieldValue3.c_str(), OFTInteger64);
816 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
818 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
822 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
824 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
828 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
830 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
835 OGRLineString OGR3ls;
842 pOGR3Feature->SetField(strFieldValue3.c_str(), surge_level);
853 pOGR3Feature->SetGeometry(&OGR3ls);
857 if (pOGRLayer->CreateFeature(pOGR3Feature) != OGRERR_NONE)
859 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
865 OGRFeature::DestroyFeature(pOGR3Feature);
872 OGRFeature* pOGR4Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
873 OGRFieldDefn
const OGRField8(strFieldValue1.c_str(), OFTReal);
874 OGRFieldDefn
const OGRField9(strFieldValue2.c_str(), OFTReal);
875 OGRFieldDefn
const OGRField5(strFieldValue4.c_str(), OFTInteger64);
877 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
879 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
883 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
885 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
889 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
891 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
896 OGRLineString OGR4ls;
903 pOGR4Feature->SetField(strFieldValue4.c_str(), runup_level);
914 pOGR4Feature->SetGeometry(&OGR4ls);
918 if (pOGRLayer->CreateFeature(pOGR4Feature) != OGRERR_NONE)
920 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
926 OGRFeature::DestroyFeature(pOGR4Feature);
938 string const strFieldValue1 =
"CliffEdge";
939 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
941 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
943 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
950 for (
int i = 0; i < static_cast<int>(
m_VCliffEdge.size()); i++)
953 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
956 pOGRFeature->SetField(strFieldValue1.c_str(), i);
965 pOGRFeature->SetGeometry(&OGRls);
968 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
970 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cliff edge " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
976 OGRFeature::DestroyFeature(pOGRFeature);
986 string const strFieldValue1 =
"NormalID";
987 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
989 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
991 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
996 string const strFieldValue2 =
"Coast";
997 string const strFieldValue3 =
"StartCoast";
998 string const strFieldValue4 =
"EndCoast";
999 string const strFieldValue5 =
"HitLand";
1000 string const strFieldValue6 =
"HitIntervention";
1001 string const strFieldValue7 =
"HitCoast";
1002 string const strFieldValue8 =
"HitNormal";
1003 string const strFieldValue9 =
"TooShort";
1004 string const strFieldValue10 =
"TruncSame";
1005 string const strFieldValue11 =
"TruncDiff";
1006 string const strFieldValue12 =
"CShore";
1008 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTInteger);
1009 OGRFieldDefn
const OGRField3(strFieldValue3.c_str(), OFTInteger);
1010 OGRFieldDefn
const OGRField4(strFieldValue4.c_str(), OFTInteger);
1011 OGRFieldDefn
const OGRField5(strFieldValue5.c_str(), OFTInteger);
1012 OGRFieldDefn
const OGRField6(strFieldValue6.c_str(), OFTInteger);
1013 OGRFieldDefn
const OGRField7(strFieldValue7.c_str(), OFTInteger);
1014 OGRFieldDefn
const OGRField8(strFieldValue8.c_str(), OFTInteger);
1015 OGRFieldDefn
const OGRField9(strFieldValue9.c_str(), OFTInteger);
1016 OGRFieldDefn
const OGRField10(strFieldValue10.c_str(), OFTInteger);
1017 OGRFieldDefn
const OGRField11(strFieldValue11.c_str(), OFTInteger);
1018 OGRFieldDefn
const OGRField12(strFieldValue12.c_str(), OFTInteger);
1020 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1022 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1026 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1028 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1032 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1034 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1038 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1040 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1044 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1046 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1050 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
1052 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 7 '" << strFieldValue7 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1056 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
1058 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 8 '" << strFieldValue8 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1062 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
1064 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 9 '" << strFieldValue9 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1068 if (pOGRLayer->CreateField(&OGRField10) != OGRERR_NONE)
1070 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 10 '" << strFieldValue10 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1074 if (pOGRLayer->CreateField(&OGRField11) != OGRERR_NONE)
1076 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 11 '" << strFieldValue11 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1080 if (pOGRLayer->CreateField(&OGRField12) != OGRERR_NONE)
1082 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 12 '" << strFieldValue12 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1087 OGRLineString OGRls;
1089 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1091 for (
int j = 0; j <
m_VCoast[i].nGetNumProfiles(); j++)
1098 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1101 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1102 pOGRFeature->SetField(strFieldValue2.c_str(), pProfile->
nGetCoast());
1103 pOGRFeature->SetField(strFieldValue3.c_str(), pProfile->
bStartOfCoast());
1104 pOGRFeature->SetField(strFieldValue4.c_str(), pProfile->
bEndOfCoast());
1105 pOGRFeature->SetField(strFieldValue5.c_str(), pProfile->
bHitLand());
1106 pOGRFeature->SetField(strFieldValue6.c_str(), pProfile->
bHitIntervention());
1107 pOGRFeature->SetField(strFieldValue7.c_str(), pProfile->
bHitCoast());
1109 pOGRFeature->SetField(strFieldValue9.c_str(), pProfile->
bTooShort());
1112 pOGRFeature->SetField(strFieldValue12.c_str(), pProfile->
bCShoreProblem());
1118 pOGRFeature->SetGeometry(&OGRls);
1122 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1124 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" and profile " << j <<
" in " << strFilePathName << endl
1125 << CPLGetLastErrorMsg() << endl;
1130 OGRFeature::DestroyFeature(pOGRFeature);
1149 string strFieldValue1;
1152 strFieldValue1 =
"Curve";
1155 strFieldValue1 =
"SC_Energy";
1158 strFieldValue1 =
"MeanEnergy";
1161 strFieldValue1 =
"Height";
1164 strFieldValue1 =
"Node";
1167 strFieldValue1 =
"Notch";
1170 strFieldValue1 =
"Wavesetup";
1173 strFieldValue1 =
"Stormsurge";
1176 strFieldValue1 =
"Runup";
1178 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTReal);
1180 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1182 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1187 OGRLineString
const OGRls;
1188 OGRMultiLineString
const OGRmls;
1191 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1193 for (
int j = 0; j <
m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
1196 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1199 OGRPt.setX(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX());
1200 OGRPt.setY(
m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
1201 pOGRFeature->SetGeometry(&OGRPt);
1205 double const dCurvature =
m_VCoast[i].dGetDetailedCurvature(j);
1211 pOGRFeature->SetField(strFieldValue1.c_str(), dCurvature);
1217 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1218 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1221 pOGRFeature->SetField(strFieldValue1.c_str(),
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy());
1227 if (
m_VCoast[i].pGetCoastLandform(j) == NULL)
1228 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1232 double dEnergy =
m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy();
1236 pOGRFeature->SetField(strFieldValue1.c_str(), dEnergy);
1243 double const dHeight =
m_VCoast[i].dGetBreakingWaveHeight(j);
1244 pOGRFeature->SetField(strFieldValue1.c_str(), dHeight);
1250 double const dWaveSetupSurge =
m_VCoast[i].dGetWaveSetupSurge(j);
1251 pOGRFeature->SetField(strFieldValue1.c_str(), dWaveSetupSurge);
1263 double const dRunUp =
m_VCoast[i].dGetRunUp(j);
1264 pOGRFeature->SetField(strFieldValue1.c_str(), dRunUp);
1269 int const nNode =
m_VCoast[i].nGetPolygonNode(j);
1275 pOGRFeature->SetField(strFieldValue1.c_str(), nNode);
1282 if (pCoastLandform == NULL)
1283 pOGRFeature->SetField(strFieldValue1.c_str(),
DBL_NODATA);
1288 double dNotchDepth = 0.0;
1299 pOGRFeature->SetField(strFieldValue1.c_str(), dNotchDepth);
1304 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1306 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" point " << j <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1311 OGRFeature::DestroyFeature(pOGRFeature);
1321 string const strFieldValue1 =
"Angle";
1322 string const strFieldValue2 =
"Height";
1325 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTReal);
1327 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1329 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1334 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTReal);
1336 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1338 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1343 OGRLineString
const OGRls;
1344 OGRMultiLineString
const OGRmls;
1355 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1360 pOGRFeature->SetGeometry(&OGRPt);
1362 double const dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetWaveAngle();
1363 double const dHeight =
m_pRasterGrid->m_Cell[nX][nY].dGetWaveHeight();
1369 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1370 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1373 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1375 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1380 OGRFeature::DestroyFeature(pOGRFeature);
1391 string const strFieldValue1 =
"Angle";
1392 string const strFieldValue2 =
"Height";
1395 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTReal);
1397 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1399 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1404 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTReal);
1406 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1408 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1413 OGRLineString
const OGRls;
1414 OGRMultiLineString
const OGRmls;
1422 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1427 pOGRFeature->SetGeometry(&OGRPt);
1429 double const dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetTotWaveAngle() /
static_cast<double>(
m_ulIter);
1430 double const dHeight =
m_pRasterGrid->m_Cell[nX][nY].dGetWaveHeight() /
static_cast<double>(
m_ulIter);
1436 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1437 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1440 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1442 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1447 OGRFeature::DestroyFeature(pOGRFeature);
1457 string const strFieldValue1 =
"Polygon";
1458 string const strFieldValue2 =
"CoastNode";
1459 string const strFieldValue3 =
"TotSedChng";
1460 string const strFieldValue4 =
"FinSedChng";
1461 string const strFieldValue5 =
"SndSedChng";
1462 string const strFieldValue6 =
"CrsSedChng";
1464 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
1466 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1468 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1472 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTInteger);
1474 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1476 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1480 OGRFieldDefn
const OGRField3(strFieldValue3.c_str(), OFTReal);
1482 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1484 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 3 '" << strFieldValue3 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1488 OGRFieldDefn
const OGRField4(strFieldValue4.c_str(), OFTReal);
1490 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1492 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 4 '" << strFieldValue4 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1496 OGRFieldDefn
const OGRField5(strFieldValue5.c_str(), OFTReal);
1498 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1500 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 5 '" << strFieldValue5 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1504 OGRFieldDefn
const OGRField6(strFieldValue6.c_str(), OFTReal);
1506 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1508 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 6 '" << strFieldValue6 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1513 OGRLineString OGRls;
1515 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1517 for (
int j = 0; j <
m_VCoast[i].nGetNumPolygons(); j++)
1520 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1525 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1537 pOGRFeature->SetGeometry(&OGRls);
1540 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1542 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for coast " << i <<
" polygon " << j <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1548 OGRFeature::DestroyFeature(pOGRFeature);
1558 string const strFieldValue1 =
"ShadowLine";
1559 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
1561 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1563 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1568 OGRLineString OGRls;
1570 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1572 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowBoundaries(); j++)
1575 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1578 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1583 for (
int nn = 0; nn < LShadow.
nGetSize(); nn++)
1586 pOGRFeature->SetGeometry(&OGRls);
1589 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1591 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1597 OGRFeature::DestroyFeature(pOGRFeature);
1607 string const strFieldValue1 =
"DdriftLine";
1608 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTInteger);
1610 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1612 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1617 OGRLineString OGRls;
1619 for (
int i = 0; i < static_cast<int>(
m_VCoast.size()); i++)
1621 for (
int j = 0; j <
m_VCoast[i].nGetNumShadowDowndriftBoundaries(); j++)
1624 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1627 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1632 for (
int nn = 0; nn < LDowndrift.
nGetSize(); nn++)
1635 pOGRFeature->SetGeometry(&OGRls);
1638 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1640 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle << j <<
" for coast " << i <<
" in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1646 OGRFeature::DestroyFeature(pOGRFeature);
1656 string const strFieldValue1 =
"Angle";
1657 string const strFieldValue2 =
"Height";
1660 OGRFieldDefn
const OGRField1(strFieldValue1.c_str(), OFTReal);
1662 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1664 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 1 '" << strFieldValue1 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1669 OGRFieldDefn
const OGRField2(strFieldValue2.c_str(), OFTReal);
1671 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1673 cerr <<
ERR <<
"cannot create " << strType <<
" attribute field 2 '" << strFieldValue2 <<
"' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1678 OGRLineString
const OGRls;
1679 OGRMultiLineString
const OGRmls;
1687 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1692 pOGRFeature->SetGeometry(&OGRPt);
1694 double const dOrientation =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveAngle();
1695 double const dHeight =
m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveHeight();
1701 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1702 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1705 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1707 cerr <<
ERR <<
"cannot create " << strType <<
" feature " << strPlotTitle <<
" for cell [" << nX <<
"][" << nY <<
"] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1712 OGRFeature::DestroyFeature(pOGRFeature);
1720 CPLPopErrorHandler();
1723 GDALClose(pGDALDataSet);