CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
gis_vector.cpp
Go to the documentation of this file.
1
10
11/* ===============================================================================================================================
12 This file is part of CoastalME, the Coastal Modelling Environment.
13
14 CoastalME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19===============================================================================================================================*/
20#include <cstdio>
21
22#include <iostream>
23using std::cerr;
24using std::endl;
25using std::ios;
26
27#include <sstream>
28using std::stringstream;
29
30#include <gdal.h>
31#include <gdal_priv.h>
32#include <ogr_core.h>
33#include <ogrsf_frmts.h>
34#include <ogr_feature.h>
35#include <ogr_geometry.h>
36#include <cpl_error.h>
37
38#include "cme.h"
39#include "simulation.h"
40#include "coast.h"
41#include "cliff.h"
42
43//===============================================================================================================================
45//===============================================================================================================================
46int CSimulation::nReadVectorGISFile(int const nDataItem)
47{
48 int nMaxLayer = 0;
49 int nNeedGeometry = 0;
50
51 string strGISFile;
52 string strGeometry;
53
54 // Set up file name and constraints
55 switch (nDataItem)
56 {
61 break;
62
66
69
72
73 break;
74
75 case (FLOOD_LOCATION_VEC):
76 strGISFile = m_strFloodLocationShapefile;
77 nMaxLayer = FLOOD_LOCATION_MAX_LAYER;
78 nNeedGeometry = FLOOD_LOCATION_POINT_GEOMETRY;
79 break;
80 }
81
82 // Open the GDAL/OGR datasource
83 GDALDataset* pOGRDataSource = static_cast<GDALDataset*>(GDALOpenEx(strGISFile.c_str(), GDAL_OF_VECTOR, NULL, NULL, NULL));
84
85 if (pOGRDataSource == NULL)
86 {
87 // Can't open file (note will already have sent GDAL error message to stdout)
88 cerr << ERR << "cannot open " << strGISFile << " for input: " << CPLGetLastErrorMsg() << endl;
90 }
91
92 // Find out number of layers, and compare with the required number
93 int const nLayer = pOGRDataSource->GetLayerCount();
94
95 if (nLayer > nMaxLayer)
96 LogStream << WARN << "need " << nMaxLayer << (nMaxLayer > 1 ? "layers" : "layer") << " in " << strGISFile << ", " << nLayer << " found. Only the first " << nMaxLayer << (nMaxLayer > 1 ? "layers" : "layer") << " will be read." << endl;
97
98 for (int n = 0; n < nMaxLayer; n++)
99 {
100 // Open this layer
101 OGRLayer* pOGRLayer;
102 pOGRLayer = pOGRDataSource->GetLayer(n);
103
104 // Get features from the layer
105 OGRFeature* pOGRFeature;
106
107 // Make sure we are at the beginning of the layer
108 pOGRLayer->ResetReading();
109
110 // Now iterate for all features in the layer
111 while ((pOGRFeature = pOGRLayer->GetNextFeature()) != NULL)
112 {
113 // First get the geometry for this feature
114 OGRGeometry* pOGRGeometry;
115 pOGRGeometry = pOGRFeature->GetGeometryRef();
116
117 if (pOGRGeometry == NULL)
118 {
119 cerr << ERR << " null geometry in " << strGISFile << "." << endl;
121 }
122
123 // Now get the geometry type
124 int const nGeometry = wkbFlatten(pOGRGeometry->getGeometryType());
125 int nThisGeometry = 0;
126
127 switch (nGeometry)
128 {
129 case wkbPoint:
130 nThisGeometry = VEC_GEOMETRY_POINT;
131 strGeometry = "point";
132 break;
133
134 case wkbLineString:
135 nThisGeometry = VEC_GEOMETRY_LINE;
136 strGeometry = "line";
137 break;
138
139 case wkbPolygon:
140 nThisGeometry = VEC_GEOMETRY_POLYGON;
141 strGeometry = "polygon";
142 break;
143
144 default:
145 nThisGeometry = VEC_GEOMETRY_OTHER;
146 strGeometry = "other";
147 break;
148 }
149
150 // Have we got the expected geometry type?
151 if (nThisGeometry != nNeedGeometry)
152 {
153 // Error, we do not have the desired geometry
154 string strNeedGeometry;
155
156 switch (nNeedGeometry)
157 {
159 strNeedGeometry = "point";
160 break;
161
163 strNeedGeometry = "line";
164 break;
165
167 strNeedGeometry = "polygon";
168 break;
169
171 strNeedGeometry = "other";
172 break;
173 }
174
175 cerr << strGeometry << " data found in " << strGISFile << ", but " << strNeedGeometry << " data is needed" << endl;
177 }
178
179 // The geometry type is OK, so process the geometry data
180 int nPoints = 0;
181 OGRPoint* pOGRPoint;
182 OGRLineString* pOGRLineString;
183 double dPointGridX;
184 double dPointGridY;
185
186 switch (nDataItem)
187 {
189 // Point data: convert the wave station coordinates from ext CRS to grid CRS
190 pOGRPoint = static_cast<OGRPoint*>(pOGRGeometry);
191 dPointGridX = dExtCRSXToGridX(pOGRPoint->getX());
192 dPointGridY = dExtCRSYToGridY(pOGRPoint->getY());
193
194 // Safety check to ensure that point is inside the grid in the +ve direction
195 if (dPointGridX >= m_nXGridSize)
197
198 if (dPointGridY >= m_nYGridSize)
200
201 // Now store the wave station coordinates, we will use these in the spatial interpolation of deep water waves
202 m_VdDeepWaterWaveStationX.push_back(dExtCRSXToGridX(dPointGridX));
203 m_VdDeepWaterWaveStationY.push_back(dExtCRSYToGridY(dPointGridY));
204 break;
205
208 {
209 // Point data: convert the sediment input coordinates from ext CRS to grid CRS
210 pOGRPoint = static_cast<OGRPoint*>(pOGRGeometry);
211 dPointGridX = dExtCRSXToGridX(pOGRPoint->getX());
212 dPointGridY = dExtCRSYToGridY(pOGRPoint->getY());
213
214 // Check point data is inside the grid in the +ve direction
215 if (dPointGridX >= m_nXGridSize)
217
218 if (dPointGridY >= m_nYGridSize)
220
221 // Now store the sediment input coordinates
222 m_VdSedimentInputLocationX.push_back(dPointGridX);
223 m_VdSedimentInputLocationY.push_back(dPointGridY);
224 }
225
227 {
228 // Line data: convert the sediment input coordinates from ext CRS to grid CRS
229 pOGRLineString = static_cast<OGRLineString*>(pOGRGeometry);
230
231 nPoints = pOGRLineString->getNumPoints();
232
233 for (int i = 0; i < nPoints; i++)
234 {
235 double const dX = dExtCRSXToGridX(pOGRLineString->getX(i));
236 double const dY = dExtCRSYToGridY(pOGRLineString->getY(i));
237
238 // Check point data is inside the grid in the +ve direction
239 if (dX >= m_nXGridSize)
240 continue;
241
242 if (dY >= m_nYGridSize)
243 continue;
244
245 // Now store the sediment input coordinates
246 m_VdSedimentInputLocationX.push_back(dX);
247 m_VdSedimentInputLocationY.push_back(dY);
248 }
249 }
250
251 break;
252
253 case (FLOOD_LOCATION_VEC):
254 // Point data: convert the flood location coordinates from ext CRS to grid CRS
255 pOGRPoint = static_cast<OGRPoint*>(pOGRGeometry);
256 dPointGridX = dExtCRSXToGridX(pOGRPoint->getX());
257 dPointGridY = dExtCRSYToGridY(pOGRPoint->getY());
258
259 // Check point data is inside the grid in the +ve direction
260 if (dPointGridX >= m_nXGridSize)
262
263 if (dPointGridY >= m_nYGridSize)
265
266 // Now stote the flood location coordinates
267 m_VdFloodLocationX.push_back(dPointGridX);
268 m_VdFloodLocationY.push_back(dPointGridY);
269 break;
270 }
271
272 // Next get the attributes of this feature
273 OGRFeatureDefn* pOGRFeatureDefn = pOGRLayer->GetLayerDefn();
274
275 int nFieldIndex = -1;
276 int nID = -1;
277
278 switch (nDataItem)
279 {
281 // First get the station ID
282 nFieldIndex = pOGRFeatureDefn->GetFieldIndex(DEEP_WATER_WAVE_STATION_ID.c_str());
283
284 if (nFieldIndex == -1)
285 {
286 // Can't find this field in the vector file
287 cerr << ERR << "cannot find " << DEEP_WATER_WAVE_STATION_ID << " field in " << strGISFile << ": " << CPLGetLastErrorMsg() << endl;
289 }
290
291 // Get the Station ID for this point
292 nID = pOGRFeature->GetFieldAsInteger(nFieldIndex);
293 m_VnDeepWaterWaveStationID.push_back(nID);
294
295 break;
296
298 // First get the station ID
299 nFieldIndex = pOGRFeatureDefn->GetFieldIndex(SEDIMENT_INPUT_EVENT_LOCATION_ID.c_str());
300
301 if (nFieldIndex == -1)
302 {
303 // Can't find this field in the vector file
304 cerr << ERR << "cannot find " << SEDIMENT_INPUT_EVENT_LOCATION_ID << " field in " << strGISFile << ": " << CPLGetLastErrorMsg() << endl;
306 }
307
308 // Get the Station ID for this point (note that we read it as an integer, not caring what type of field is actually in the shapefile)
309 nID = pOGRFeature->GetFieldAsInteger(nFieldIndex);
310
312 // Save the ID for the point
313 m_VnSedimentInputLocationID.push_back(nID);
314
316 {
317 // Save the ID for every point in the line
318 for (int i = 0; i < nPoints; i++)
319 m_VnSedimentInputLocationID.push_back(nID);
320 }
321
322 break;
323
324 case (FLOOD_LOCATION_VEC):
325 // First get the station ID
326 nFieldIndex = pOGRFeatureDefn->GetFieldIndex(FLOOD_LOCATION_ID.c_str());
327
328 if (nFieldIndex == -1)
329 {
330 // Can't find this field in the vector file
331 cerr << ERR << "cannot find " << FLOOD_LOCATION_ID << " field in " << strGISFile << ": " << CPLGetLastErrorMsg() << endl;
333 }
334
335 // Get the Station ID for this point (note that we read it as an integer, not caring what type of field is actually in the shapefile)
336 nID = pOGRFeature->GetFieldAsInteger(nFieldIndex);
337
338 // Save the ID for the point
339 m_VnFloodLocationID.push_back(nID);
340 break;
341 }
342 }
343
344 // Get rid of the Feature object
345 OGRFeature::DestroyFeature(pOGRFeature);
346 }
347
348 // Save some info, to be shown in the text output
349 switch (nDataItem)
350 {
352 m_strOGRDWWVDriverCode = pOGRDataSource->GetDriverName();
353
354 for (auto&& oFeatureLayerPair : pOGRDataSource->GetFeatures())
355 {
356 m_strOGRDWWVDriverDesc += oFeatureLayerPair.layer->GetName();
358 }
359
360 m_strOGRDWWVDataType = "integer";
361 m_strOGRDWWVGeometry = strGeometry;
362 break;
363
365 m_strOGRSedInputDriverCode = pOGRDataSource->GetDriverName();
366
367 for (auto&& oFeatureLayerPair : pOGRDataSource->GetFeatures())
368 {
369 m_strOGRSedInputDriverDesc += oFeatureLayerPair.layer->GetName();
371 }
372
373 m_strOGRSedInputGeometry = "integer";
374 m_strOGRSedInputDataType = strGeometry;
375 break;
376
377 case (FLOOD_LOCATION_VEC):
378 m_strOGRFloodDriverCode = pOGRDataSource->GetDriverName();
379
380 for (auto&& oFeatureLayerPair : pOGRDataSource->GetFeatures())
381 {
382 m_strOGRFloodDriverDesc += oFeatureLayerPair.layer->GetName();
384 }
385
386 m_strOGRFloodGeometry = "integer";
387 m_strOGRFloodDataType = strGeometry;
388 break;
389 }
390
391 // Clean up: get rid of the data source object
392 GDALClose(pOGRDataSource);
393
394 return RTN_OK;
395}
396
397//===============================================================================================================================
399//===============================================================================================================================
400bool CSimulation::bWriteVectorGISFile(int const nDataItem, string const* strPlotTitle)
401{
402 // Begin constructing the file name for this save
403 string strFilePathName(m_strOutPath);
404 stringstream strstrFileName;
405
406 OGRwkbGeometryType eGType = wkbUnknown;
407 string strType = "unknown";
408
409 switch (nDataItem)
410 {
411 case (VECTOR_PLOT_COAST):
412 strFilePathName.append(VECTOR_COAST_NAME);
413 strstrFileName << VECTOR_COAST_NAME;
414
415 eGType = wkbLineString;
416 strType = "line";
417
418 break;
419
421 strFilePathName.append(VECTOR_COAST_SWL_HIGHEST_NAME);
422 strstrFileName << VECTOR_COAST_SWL_HIGHEST_NAME;
423
424 eGType = wkbLineString;
425 strType = "line";
426
427 break;
428
430 strFilePathName.append(VECTOR_COAST_SWL_LOWEST_NAME);
431 strstrFileName << VECTOR_COAST_SWL_LOWEST_NAME;
432
433 eGType = wkbLineString;
434 strType = "line";
435
436 break;
437
439 strFilePathName.append(VECTOR_CLIFF_EDGE_NAME);
440 strstrFileName << VECTOR_CLIFF_EDGE_NAME;
441
442 eGType = wkbLineString;
443 strType = "line";
444
445 break;
446
447 case (VECTOR_PLOT_NORMALS):
448 strFilePathName.append(VECTOR_NORMALS_NAME);
449 strstrFileName << VECTOR_NORMALS_NAME;
450
451 eGType = wkbLineString;
452 strType = "line";
453
454 break;
455
457 strFilePathName.append(VECTOR_INVALID_NORMALS_NAME);
458
459 eGType = wkbLineString;
460 strType = "line";
461
462 break;
463
465 strFilePathName.append(VECTOR_COAST_CURVATURE_NAME);
466
467 eGType = wkbPoint;
468 strType = "point";
469
470 break;
471
473 strFilePathName.append(VECTOR_WAVE_ANGLE_AND_HEIGHT_NAME);
474
475 eGType = wkbPoint;
476 strType = "point";
477
478 break;
479
481 strFilePathName.append(VECTOR_AVG_WAVE_ANGLE_AND_HEIGHT_NAME);
482
483 eGType = wkbPoint;
484 strType = "point";
485
486 break;
487
489 strFilePathName.append(VECTOR_WAVE_ENERGY_SINCE_COLLAPSE_NAME);
490
491 eGType = wkbPoint;
492 strType = "point";
493
494 break;
495
497 strFilePathName.append(VECTOR_MEAN_WAVE_ENERGY_NAME);
498
499 eGType = wkbPoint;
500 strType = "point";
501
502 break;
503
505 strFilePathName.append(VECTOR_BREAKING_WAVE_HEIGHT_NAME);
506
507 eGType = wkbPoint;
508 strType = "point";
509
510 break;
511
513 strFilePathName.append(VECTOR_POLYGON_NODE_NAME);
514
515 eGType = wkbPoint;
516 strType = "point";
517
518 break;
519
521 strFilePathName.append(VECTOR_POLYGON_BOUNDARY_NAME);
522
523 eGType = wkbLineString;
524 strType = "line";
525
526 break;
527
529 strFilePathName.append(VECTOR_CLIFF_NOTCH_ACTIVE_NAME);
530
531 eGType = wkbPoint;
532 strType = "point";
533
534 break;
535
537 strFilePathName.append(VECTOR_SHADOW_ZONE_BOUNDARY_NAME);
538
539 eGType = wkbLineString;
540 strType = "line";
541
542 break;
543
545 strFilePathName.append(VECTOR_DOWNDRIFT_ZONE_BOUNDARY_NAME);
546
547 eGType = wkbLineString;
548 strType = "line";
549
550 break;
551
553 strFilePathName.append(VECTOR_DEEP_WATER_WAVE_ANGLE_AND_HEIGHT_NAME);
554
555 eGType = wkbPoint;
556 strType = "point";
557
558 break;
559
561 strFilePathName.append(VECTOR_WAVE_SETUP_NAME);
562
563 eGType = wkbPoint;
564 strType = "point";
565
566 break;
567
569 strFilePathName.append(VECTOR_STORM_SURGE_NAME);
570
571 eGType = wkbPoint;
572 strType = "point";
573
574 break;
575
577 strFilePathName.append(VECTOR_WAVE_TRANSECT_POINTS_NAME);
578
579 eGType = wkbPoint;
580 strType = "point";
581
582 break;
583
584 case (VECTOR_PLOT_RUN_UP):
585 strFilePathName.append(VECTOR_RUN_UP_NAME);
586
587 eGType = wkbPoint;
588 strType = "point";
589
590 break;
591
593 strFilePathName.append(VECTOR_FLOOD_LINE_NAME);
594 strstrFileName << VECTOR_FLOOD_LINE_NAME;
595
596 eGType = wkbLineString;
597 strType = "line";
598
599 break;
600
601 // case (VECTOR_PLOT_FLOOD_SWL_SETUP_SURGE_LINE):
602 // strFilePathName.append(VECTOR_FLOOD_SWL_SETUP_SURGE_LINE_NAME);
603 // strstrFileName << VECTOR_FLOOD_SWL_SETUP_SURGE_LINE_NAME;
604 // break;
605
606 // case (VECTOR_PLOT_FLOOD_SWL_SETUP_SURGE_RUNUP_LINE):
607 // strFilePathName.append(VECTOR_FLOOD_SWL_SETUP_SURGE_RUNUP_LINE_NAME);
608 // strstrFileName << VECTOR_FLOOD_SWL_SETUP_SURGE_RUNUP_LINE_NAME;
609 // break;
610 }
611
612 // Append the 'save number' to the filename, and prepend zeros to the save number
613 strFilePathName.append("_");
614 stringstream ststrTmp;
615
617 {
618 // Save number is sequential
619 ststrTmp << FillToWidth('0', m_nGISMaxSaveDigits) << m_nGISSave;
620 }
621
622 else
623 {
624 // Save number is iteration
625 ststrTmp << FillToWidth('0', m_nGISMaxSaveDigits) << m_ulIter;
626 }
627
628 strFilePathName.append(ststrTmp.str());
629 strstrFileName << ststrTmp.str();
630
631 // Make a copy of the filename without any extension
632 // string strFilePathNameNoExt = strFilePathName;
633
634 // If desired, append an extension
635 if (! m_strOGRVectorOutputExtension.empty())
636 strFilePathName.append(m_strOGRVectorOutputExtension);
637
638 // Set up the vector driver
639 GDALDriver* pGDALDriver = GetGDALDriverManager()->GetDriverByName(m_strVectorGISOutFormat.c_str());
640
641 if (pGDALDriver == NULL)
642 {
643 cerr << ERR << "vector GIS output driver " << m_strVectorGISOutFormat << CPLGetLastErrorMsg() << endl;
644 return false;
645 }
646
647 // Now create the dataset
648 GDALDataset* pGDALDataSet = pGDALDriver->Create(strFilePathName.c_str(), 0, 0, 0, GDT_Unknown, m_papszGDALVectorOptions);
649
650 if (pGDALDataSet == NULL)
651 {
652 cerr << ERR << "cannot create " << m_strVectorGISOutFormat << " named " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
653 return false;
654 }
655
656 // Create a spatial reference object
657 OGRSpatialReference OGRSpatialRef;
658
659 // And tell it about the coordinate system used by the basement raster layer
661 {
662 OGRSpatialRef.importFromWkt(m_strGDALBasementDEMProjection.c_str());
663 }
664
665 else
666 {
667 OGRSpatialRef.importFromEPSG(25830); // TODO 035 Also handle other EPSG for vector spatial reference systems
668 }
669
670 // Now create the output layer
671 // // OGRLayer* pOGRLayer = pGDALDataSet->CreateLayer(strFilePathNameNoExt.c_str(), &OGRSpatialRef, eGType, m_papszGDALVectorOptions);
672 // if (EQUAL(m_strVectorGISOutFormat.c_str(), "geojson"))
673 // {
674 // CPLSetConfigOption("GDAL_VALIDATE_CREATION_OPTIONS", "NO");
675 // m_papszGDALVectorOptions = CSLSetNameValue(m_papszGDALVectorOptions, "COORDINATE_PRECISION", "2");
676 // }
677
678 OGRLayer* pOGRLayer = pGDALDataSet->CreateLayer(strstrFileName.str().c_str(), &OGRSpatialRef, eGType, m_papszGDALVectorOptions);
679
680 if (pOGRLayer == NULL)
681 {
682 cerr << ERR << "cannot create '" << strType << "' layer in " << strFilePathName << endl
683 << CPLGetLastErrorMsg() << endl;
684 return false;
685 }
686
687 // Need to switch off GDAL/OGR error messages here, since real (floating point) fields in ESRI shapefiles are treated as width 24 with 15 decimal places of precision (unless an explicit width is given). If fields exceed this, then a "not successfully written. Possibly due to too larger number with respect to field width" error message is shown. Get this to fail silently
688 CPLPushErrorHandler(CPLQuietErrorHandler);
689
690 switch (nDataItem)
691 {
692 case (VECTOR_PLOT_COAST):
693 {
694 // The layer has been created, so create an integer-numbered value (the number of the coast object) for the multi-line
695 string const strFieldValue1 = "Coast";
696 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
697
698 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
699 {
700 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
701 return false;
702 }
703
704 // OK, now do features
705 OGRLineString OGRls;
706
707 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
708 {
709 // Create a feature object, one per coast
710 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
711
712 // Set the feature's attribute (the coast number)
713 pOGRFeature->SetField(strFieldValue1.c_str(), i);
714
715 // Now attach a geometry to the feature object
716 for (int j = 0; j < m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
717 // In external CRS
718 OGRls.addPoint(m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX(), m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
719
720 pOGRFeature->SetGeometry(&OGRls);
721
722 // Create the feature in the output layer
723 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
724 {
725 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
726 return false;
727 }
728
729 // Tidy up: empty the line string and get rid of the feature object
730 OGRls.empty();
731 OGRFeature::DestroyFeature(pOGRFeature);
732 }
733
734 break;
735 }
736
738 {
739 // The layer has been created, so create an integer-numbered value (the number of the coast object) for the multi-line
740 string const strFieldValue1 = "Coast";
741 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
742
743 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
744 {
745 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
746 return false;
747 }
748
749 // OK, now do features
750 OGRLineString OGRls;
751
752 for (int i = 0; i < static_cast<int>(m_VHighestSWLCoastLine.size()); i++)
753 {
754 // Create a feature object, one per coast
755 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
756
757 // Set the feature's attribute (the coast number)
758 pOGRFeature->SetField(strFieldValue1.c_str(), i);
759
760 // Now attach a geometry to the feature object
761 for (int j = 0; j < m_VHighestSWLCoastLine[i].nGetSize(); j++)
762 // In external CRS
763 OGRls.addPoint(m_VHighestSWLCoastLine[i].dGetXAt(j), m_VHighestSWLCoastLine[i].dGetYAt(j));
764
765 pOGRFeature->SetGeometry(&OGRls);
766
767 // Create the feature in the output layer
768 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
769 {
770 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for highest SWL coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
771 return false;
772 }
773
774 // Tidy up: empty the line string and get rid of the feature object
775 OGRls.empty();
776 OGRFeature::DestroyFeature(pOGRFeature);
777 }
778
779 break;
780 }
781
783 {
784 // The layer has been created, so create an integer-numbered value (the number of the coast object) for the multi-line
785 string const strFieldValue1 = "Coast";
786 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
787
788 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
789 {
790 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
791 return false;
792 }
793
794 // OK, now do features
795 OGRLineString OGRls;
796
797 for (int i = 0; i < static_cast<int>(m_VLowestSWLCoastLine.size()); i++)
798 {
799 // Create a feature object, one per coast
800 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
801
802 // Set the feature's attribute (the coast number)
803 pOGRFeature->SetField(strFieldValue1.c_str(), i);
804
805 // Now attach a geometry to the feature object
806 for (int j = 0; j < m_VLowestSWLCoastLine[i].nGetSize(); j++)
807 // In external CRS
808 OGRls.addPoint(m_VLowestSWLCoastLine[i].dGetXAt(j), m_VLowestSWLCoastLine[i].dGetYAt(j));
809
810 pOGRFeature->SetGeometry(&OGRls);
811
812 // Create the feature in the output layer
813 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
814 {
815 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for lowest SWL coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
816 return false;
817 }
818
819 // Tidy up: empty the line string and get rid of the feature object
820 OGRls.empty();
821 OGRFeature::DestroyFeature(pOGRFeature);
822 }
823
824 break;
825 }
826
827
829 {
830 // The layer has been created, so create an integer-numbered value (the number of the coast object) for the multi-line
831 string const strFieldValue1 = "NMR";
832 string const strFieldValue2 = "tiempo";
833 string const strFieldValue3 = "surge_mm";
834 // string strFieldValue4 = "eta-surge(mm)";
835 string const strFieldValue4 = "runup_mm";
836
837 // Create a feature with general properties
838 // OGRLineString OGRls;
839 // OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
840
841 // Testing coordinate system
842 // if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
843 // {
844 // cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
845 // return false;
846 // }
847 // if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
848 // {
849 // cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
850 // return false;
851 // }
852
853 // pOGRFeature->SetGeometry(&OGRls);
854 // Create the feature in the output layer
855 // if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
856 // {
857 // cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
858 // return false;
859 // }
860 // OGRFeature::DestroyFeature(pOGRFeature);
861 // Create a feature object, one per coast
862
863 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTReal);
864 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTReal);
865 OGRFieldDefn const OGRField3(strFieldValue3.c_str(), OFTInteger64);
866
867 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
868 {
869 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
870 return false;
871 }
872
873 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
874 {
875 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
876 return false;
877 }
878
879 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
880 {
881 cerr << ERR << "cannot create " << strType << " attribute field 3 '" << strFieldValue3 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
882 return false;
883 }
884
885 // OK, now do features
886 OGRLineString const OGR2ls;
887
888 // for (int i = 0; i < static_cast<int>(m_VFloodWaveSetupSurge.size()); i++)
889 // {
890 // OGRFeature* pOGR2Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
891 // pOGR2Feature->SetField(strFieldValue1.c_str(), m_dThisIterSWL);
892 // pOGR2Feature->SetField(strFieldValue2.c_str(), m_ulIter);
893 // int setup_level = int(m_dThisIterDiffWaveSetupWaterLevel * 1000);
894 // pOGR2Feature->SetField(strFieldValue3.c_str(), setup_level);
895 // // Set the feature's attribute (the coast number)
896 // // Now attach a geometry to the feature object
897 // for (int j = 0; j < m_VFloodWaveSetup[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
898 // {
899 // // In external CRS
900 // // Add SWL + wave setup line
901 // OGR2ls.addPoint(m_VFloodWaveSetup[i].pPtGetCoastlinePointExtCRS(j)->dGetX(), m_VFloodWaveSetup[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
902 // }
903
904 // pOGR2Feature->SetGeometry(&OGR2ls);
905 // OGR2ls.empty();
906
907 // // Create the feature in the output layer
908 // if (pOGRLayer->CreateFeature(pOGR2Feature) != OGRERR_NONE)
909 // {
910 // cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
911 // return false;
912 // }
913
914 // // Tidy up: empty the line string and get rid of the feature object
915 // // OGRls.empty();
916 // OGRFeature::DestroyFeature(pOGR2Feature);
917 // }
919 {
920 // Create a feature object, one per coast
921 OGRFeature* pOGR3Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
922 OGRFieldDefn const OGRField6(strFieldValue1.c_str(), OFTReal);
923 OGRFieldDefn const OGRField7(strFieldValue2.c_str(), OFTReal);
924 OGRFieldDefn const OGRField4(strFieldValue3.c_str(), OFTInteger64);
925
926 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
927 {
928 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
929 return false;
930 }
931
932 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
933 {
934 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
935 return false;
936 }
937
938 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
939 {
940 cerr << ERR << "cannot create " << strType << " attribute field 4 '" << strFieldValue4 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
941 return false;
942 }
943
944 // OK, now do features
945 OGRLineString OGR3ls;
946
947 for (int i = 0; i < static_cast<int>(m_VFloodWaveSetupSurge.size()); i++)
948 {
949 pOGR3Feature->SetField(strFieldValue1.c_str(), m_dThisIterSWL);
950 pOGR3Feature->SetField(strFieldValue2.c_str(), static_cast<double>(m_bGISSaveDigitsSequential ? m_nGISSave : m_ulIter));
951 int const surge_level = int(m_dThisIterDiffWaveSetupSurgeWaterLevel * 1000);
952 pOGR3Feature->SetField(strFieldValue3.c_str(), surge_level);
953
954 // Set the feature's attribute (the coast number)
955 // Now attach a geometry to the feature object
956 for (int j = 0; j < m_VFloodWaveSetupSurge[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
957 {
958 // In external CRS
959 // Add SWL + wave setup + storm surge line
960 OGR3ls.addPoint(m_VFloodWaveSetupSurge[i].pPtGetCoastlinePointExtCRS(j)->dGetX(), m_VFloodWaveSetupSurge[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
961 }
962
963 pOGR3Feature->SetGeometry(&OGR3ls);
964 OGR3ls.empty();
965
966 // Create the feature in the output layer
967 if (pOGRLayer->CreateFeature(pOGR3Feature) != OGRERR_NONE)
968 {
969 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
970 return false;
971 }
972
973 // Tidy up: empty the line string and get rid of the feature object
974 // OGRls.empty();
975 OGRFeature::DestroyFeature(pOGR3Feature);
976 }
977 }
978
980 {
981 // Create a feature object, one per coast
982 OGRFeature* pOGR4Feature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
983 OGRFieldDefn const OGRField8(strFieldValue1.c_str(), OFTReal);
984 OGRFieldDefn const OGRField9(strFieldValue2.c_str(), OFTReal);
985 OGRFieldDefn const OGRField5(strFieldValue4.c_str(), OFTInteger64);
986
987 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
988 {
989 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
990 return false;
991 }
992
993 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
994 {
995 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
996 return false;
997 }
998
999 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1000 {
1001 cerr << ERR << "cannot create " << strType << " attribute field 5 '" << strFieldValue4 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1002 return false;
1003 }
1004
1005 // OK, now do features
1006 OGRLineString OGR4ls;
1007
1008 for (int i = 0; i < static_cast<int>(m_VFloodWaveSetupSurgeRunup.size()); i++)
1009 {
1010 pOGR4Feature->SetField(strFieldValue1.c_str(), m_dThisIterSWL);
1011 pOGR4Feature->SetField(strFieldValue2.c_str(), static_cast<double>(m_bGISSaveDigitsSequential ? m_nGISSave : m_ulIter));
1012 int const runup_level = int(m_dThisIterDiffWaveSetupSurgeRunupWaterLevel * 1000);
1013 pOGR4Feature->SetField(strFieldValue4.c_str(), runup_level);
1014
1015 // Set the feature's attribute (the coast number)
1016 // Now attach a geometry to the feature object
1017 for (int j = 0; j < m_VFloodWaveSetupSurgeRunup[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
1018 {
1019 // In external CRS
1020 // Add SWL + wave setup + surge + runup line
1021 OGR4ls.addPoint(m_VFloodWaveSetupSurgeRunup[i].pPtGetCoastlinePointExtCRS(j)->dGetX(), m_VFloodWaveSetupSurgeRunup[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
1022 }
1023
1024 pOGR4Feature->SetGeometry(&OGR4ls);
1025 OGR4ls.empty();
1026
1027 // Create the feature in the output layer
1028 if (pOGRLayer->CreateFeature(pOGR4Feature) != OGRERR_NONE)
1029 {
1030 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1031 return false;
1032 }
1033
1034 // Tidy up: empty the line string and get rid of the feature object
1035 // OGRls.empty();
1036 OGRFeature::DestroyFeature(pOGR4Feature);
1037 }
1038 }
1039
1040 // OGRls.empty();
1041
1042 break;
1043 }
1044
1046 {
1047 // The layer has been created, so create an integer-numbered value (the number of the cliff edge object) for the multi-line
1048 string const strFieldValue1 = "CliffEdge";
1049 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1050
1051 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1052 {
1053 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1054 return false;
1055 }
1056
1057 // OK, now do features
1058 OGRLineString OGRls;
1059
1060 for (int i = 0; i < static_cast<int>(m_VCliffToe.size()); i++)
1061 {
1062 // Create a feature object, one per cliff edge
1063 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1064
1065 // Set the feature's attribute (the cliff edge number)
1066 pOGRFeature->SetField(strFieldValue1.c_str(), i);
1067
1068 // Now attach a geometry to the feature object
1069 for (int j = 0; j < m_VCliffToe[i].nGetSize(); j++)
1070 {
1071 // Use external CRS coordinates directly (already smoothed)
1072 OGRls.addPoint(m_VCliffToe[i].dGetXAt(j), m_VCliffToe[i].dGetYAt(j));
1073 }
1074
1075 pOGRFeature->SetGeometry(&OGRls);
1076
1077 // Create the feature in the output layer
1078 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1079 {
1080 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for cliff edge " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1081 return false;
1082 }
1083
1084 // Tidy up: empty the line string and destroy the feature object
1085 OGRls.empty();
1086 OGRFeature::DestroyFeature(pOGRFeature);
1087 }
1088
1089 break;
1090 }
1091
1092 case (VECTOR_PLOT_NORMALS):
1094 {
1095 // The layer has been created, so create an integer-numbered value (the number of the normal) associated with the line
1096 string const strFieldValue1 = "NormalID";
1097 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1098
1099 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1100 {
1101 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1102 return false;
1103 }
1104
1105 // Also create other integer-numbered values for the category codes of the coastline-normal profile
1106 string const strFieldValue2 = "Coast";
1107 string const strFieldValue3 = "StartCoast";
1108 string const strFieldValue4 = "EndCoast";
1109 string const strFieldValue5 = "HitLand";
1110 string const strFieldValue6 = "HitIntervention";
1111 string const strFieldValue7 = "HitCoast";
1112 string const strFieldValue8 = "HitNormal";
1113 string const strFieldValue9 = "TooShort";
1114 string const strFieldValue10 = "TruncSame";
1115 string const strFieldValue11 = "TruncDiff";
1116 string const strFieldValue12 = "CShore";
1117
1118 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTInteger);
1119 OGRFieldDefn const OGRField3(strFieldValue3.c_str(), OFTInteger);
1120 OGRFieldDefn const OGRField4(strFieldValue4.c_str(), OFTInteger);
1121 OGRFieldDefn const OGRField5(strFieldValue5.c_str(), OFTInteger);
1122 OGRFieldDefn const OGRField6(strFieldValue6.c_str(), OFTInteger);
1123 OGRFieldDefn const OGRField7(strFieldValue7.c_str(), OFTInteger);
1124 OGRFieldDefn const OGRField8(strFieldValue8.c_str(), OFTInteger);
1125 OGRFieldDefn const OGRField9(strFieldValue9.c_str(), OFTInteger);
1126 OGRFieldDefn const OGRField10(strFieldValue10.c_str(), OFTInteger);
1127 OGRFieldDefn const OGRField11(strFieldValue11.c_str(), OFTInteger);
1128 OGRFieldDefn const OGRField12(strFieldValue12.c_str(), OFTInteger);
1129
1130 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1131 {
1132 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1133 return false;
1134 }
1135
1136 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1137 {
1138 cerr << ERR << "cannot create " << strType << " attribute field 3 '" << strFieldValue3 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1139 return false;
1140 }
1141
1142 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1143 {
1144 cerr << ERR << "cannot create " << strType << " attribute field 4 '" << strFieldValue4 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1145 return false;
1146 }
1147
1148 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1149 {
1150 cerr << ERR << "cannot create " << strType << " attribute field 5 '" << strFieldValue5 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1151 return false;
1152 }
1153
1154 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1155 {
1156 cerr << ERR << "cannot create " << strType << " attribute field 6 '" << strFieldValue6 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1157 return false;
1158 }
1159
1160 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
1161 {
1162 cerr << ERR << "cannot create " << strType << " attribute field 7 '" << strFieldValue7 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1163 return false;
1164 }
1165
1166 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
1167 {
1168 cerr << ERR << "cannot create " << strType << " attribute field 8 '" << strFieldValue8 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1169 return false;
1170 }
1171
1172 if (pOGRLayer->CreateField(&OGRField9) != OGRERR_NONE)
1173 {
1174 cerr << ERR << "cannot create " << strType << " attribute field 9 '" << strFieldValue9 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1175 return false;
1176 }
1177
1178 if (pOGRLayer->CreateField(&OGRField10) != OGRERR_NONE)
1179 {
1180 cerr << ERR << "cannot create " << strType << " attribute field 10 '" << strFieldValue10 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1181 return false;
1182 }
1183
1184 if (pOGRLayer->CreateField(&OGRField11) != OGRERR_NONE)
1185 {
1186 cerr << ERR << "cannot create " << strType << " attribute field 11 '" << strFieldValue11 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1187 return false;
1188 }
1189
1190 if (pOGRLayer->CreateField(&OGRField12) != OGRERR_NONE)
1191 {
1192 cerr << ERR << "cannot create " << strType << " attribute field 12 '" << strFieldValue12 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1193 return false;
1194 }
1195
1196 // OK, now create features
1197 OGRLineString OGRls;
1198
1199 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
1200 {
1201 for (int j = 0; j < m_VCoast[i].nGetNumProfiles(); j++)
1202 {
1203 CGeomProfile* pProfile = m_VCoast[i].pGetProfile(j);
1204
1205 if (((nDataItem == VECTOR_PLOT_NORMALS) && (pProfile->bOKIncStartAndEndOfCoast())) || ((nDataItem == VECTOR_PLOT_INVALID_NORMALS) && (! pProfile->bOKIncStartAndEndOfCoast())))
1206 {
1207 // Create a feature object, one per profile
1208 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1209
1210 // Set the feature's attributes
1211 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1212 pOGRFeature->SetField(strFieldValue2.c_str(), pProfile->nGetCoastID());
1213 pOGRFeature->SetField(strFieldValue3.c_str(), pProfile->bStartOfCoast());
1214 pOGRFeature->SetField(strFieldValue4.c_str(), pProfile->bEndOfCoast());
1215 pOGRFeature->SetField(strFieldValue5.c_str(), pProfile->bHitLand());
1216 pOGRFeature->SetField(strFieldValue6.c_str(), pProfile->bHitIntervention());
1217 pOGRFeature->SetField(strFieldValue7.c_str(), pProfile->bHitCoast());
1218 pOGRFeature->SetField(strFieldValue8.c_str(), pProfile->bHitAnotherProfile());
1219 pOGRFeature->SetField(strFieldValue9.c_str(), pProfile->bTooShort());
1220 pOGRFeature->SetField(strFieldValue10.c_str(), pProfile->bTruncatedSameCoast());
1221 pOGRFeature->SetField(strFieldValue11.c_str(), pProfile->bTruncatedDifferentCoast());
1222 pOGRFeature->SetField(strFieldValue12.c_str(), pProfile->bCShoreProblem());
1223
1224 // Now attach a geometry to the feature object
1225 for (int k = 0; k < pProfile->nGetProfileSize(); k++)
1226 OGRls.addPoint(pProfile->pPtGetPointInProfile(k)->dGetX(), pProfile->pPtGetPointInProfile(k)->dGetY());
1227
1228 pOGRFeature->SetGeometry(&OGRls);
1229 OGRls.empty();
1230
1231 // Create the feature in the output layer
1232 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1233 {
1234 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " and profile " << j << " in " << strFilePathName << endl
1235 << CPLGetLastErrorMsg() << endl;
1236 return false;
1237 }
1238
1239 // Tidy up: get rid of the feature object
1240 OGRFeature::DestroyFeature(pOGRFeature);
1241 }
1242 }
1243 }
1244
1245 break;
1246 }
1247
1256 case (VECTOR_PLOT_RUN_UP):
1257 {
1258 // The layer has been created, so create a real-numbered value associated with each point
1259 string strFieldValue1;
1260
1261 if (nDataItem == VECTOR_PLOT_COAST_CURVATURE)
1262 strFieldValue1 = "Curve";
1263 else if (nDataItem == VECTOR_PLOT_WAVE_ENERGY_SINCE_COLLAPSE)
1264 strFieldValue1 = "SC_Energy";
1265 else if (nDataItem == VECTOR_PLOT_MEAN_WAVE_ENERGY)
1266 strFieldValue1 = "MeanEnergy";
1267 else if (nDataItem == VECTOR_PLOT_BREAKING_WAVE_HEIGHT)
1268 strFieldValue1 = "Height";
1269 else if (nDataItem == VECTOR_PLOT_POLYGON_NODES)
1270 strFieldValue1 = "Node";
1271 else if (nDataItem == VECTOR_PLOT_CLIFF_NOTCH_ACTIVE)
1272 strFieldValue1 = "Notch";
1273 else if (nDataItem == VECTOR_PLOT_WAVE_SETUP)
1274 strFieldValue1 = "Wavesetup";
1275 else if (nDataItem == VECTOR_PLOT_STORM_SURGE)
1276 strFieldValue1 = "Stormsurge";
1277 else if (nDataItem == VECTOR_PLOT_RUN_UP)
1278 strFieldValue1 = "Runup";
1279
1280 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTReal);
1281
1282 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1283 {
1284 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1285 return false;
1286 }
1287
1288 // OK, now create features
1289 OGRLineString const OGRls;
1290 OGRMultiLineString const OGRmls;
1291 OGRPoint OGRPt;
1292
1293 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
1294 {
1295 for (int j = 0; j < m_VCoast[i].pLGetCoastlineExtCRS()->nGetSize(); j++)
1296 {
1297 // Create a feature object, one per coastline point
1298 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1299
1300 // Set the feature's geometry (in external CRS)
1301 OGRPt.setX(m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetX());
1302 OGRPt.setY(m_VCoast[i].pPtGetCoastlinePointExtCRS(j)->dGetY());
1303 pOGRFeature->SetGeometry(&OGRPt);
1304
1305 if (nDataItem == VECTOR_PLOT_COAST_CURVATURE)
1306 {
1307 double const dCurvature = m_VCoast[i].dGetDetailedCurvature(j);
1308
1309 if (bFPIsEqual(dCurvature, DBL_NODATA, TOLERANCE))
1310 continue;
1311
1312 // Set the feature's attribute
1313 pOGRFeature->SetField(strFieldValue1.c_str(), dCurvature);
1314 }
1315
1316 else if (nDataItem == VECTOR_PLOT_WAVE_ENERGY_SINCE_COLLAPSE)
1317 {
1318 // Set the feature's attribute
1319 if (m_VCoast[i].pGetCoastLandform(j) == NULL)
1320 pOGRFeature->SetField(strFieldValue1.c_str(), DBL_NODATA);
1321 else
1322 pOGRFeature->SetField(strFieldValue1.c_str(), m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy());
1323 }
1324
1325 else if (nDataItem == VECTOR_PLOT_MEAN_WAVE_ENERGY)
1326 {
1327 // Set the feature's attribute
1328 if (m_VCoast[i].pGetCoastLandform(j) == NULL)
1329 pOGRFeature->SetField(strFieldValue1.c_str(), DBL_NODATA);
1330 else
1331 {
1332 double dEnergy = m_VCoast[i].pGetCoastLandform(j)->dGetTotAccumWaveEnergy();
1333 dEnergy *= 24;
1334 dEnergy /= m_dSimElapsed; // Is in energy units per day
1335
1336 pOGRFeature->SetField(strFieldValue1.c_str(), dEnergy);
1337 }
1338 }
1339 else if (nDataItem == VECTOR_PLOT_BREAKING_WAVE_HEIGHT)
1340 {
1341 // Set the feature's attribute
1342 double const dHeight = m_VCoast[i].dGetBreakingWaveHeight(j);
1343 pOGRFeature->SetField(strFieldValue1.c_str(), dHeight);
1344 }
1345 else if (nDataItem == VECTOR_PLOT_WAVE_SETUP)
1346 {
1347 // Set the feature's attribute
1348 double const dWaveSetupSurge = m_VCoast[i].dGetWaveSetupSurge(j);
1349 pOGRFeature->SetField(strFieldValue1.c_str(), dWaveSetupSurge);
1350 }
1351
1352 // else if (nDataItem == VECTOR_PLOT_STORM_SURGE)
1353 // {
1354 // // Set the feature's attribute
1355 // double dStormSurge = m_VCoast[i].dGetStormSurge(j);
1356 // pOGRFeature->SetField(strFieldValue1.c_str(), dStormSurge);
1357 // }
1358 else if (nDataItem == VECTOR_PLOT_RUN_UP)
1359 {
1360 // Set the feature's attribute
1361 double const dRunUp = m_VCoast[i].dGetRunUp(j);
1362 pOGRFeature->SetField(strFieldValue1.c_str(), dRunUp);
1363 }
1364 else if (nDataItem == VECTOR_PLOT_POLYGON_NODES)
1365 {
1366 int const nNode = m_VCoast[i].nGetPolygonNode(j);
1367
1368 if (nNode == INT_NODATA)
1369 continue;
1370
1371 // Set the feature's attribute
1372 pOGRFeature->SetField(strFieldValue1.c_str(), nNode);
1373 }
1374 else if (nDataItem == VECTOR_PLOT_CLIFF_NOTCH_ACTIVE)
1375 {
1376 CACoastLandform* pCoastLandform = m_VCoast[i].pGetCoastLandform(j);
1377
1378 if (pCoastLandform == NULL)
1379 pOGRFeature->SetField(strFieldValue1.c_str(), DBL_NODATA);
1380 else
1381 {
1382 int const nCategory = pCoastLandform->nGetLandFormCategory();
1383 double dNotchDepth = 0.0;
1384
1385 if ((nCategory == LF_CLIFF_ON_COASTLINE) || (nCategory == LF_CLIFF_INLAND))
1386 {
1387 CRWCliff const* pCliff = reinterpret_cast<CRWCliff*>(pCoastLandform);
1388
1389 // Get attribute values from the cliff object
1390 if (pCliff->bHasCollapsed())
1391 dNotchDepth = m_dCellSide;
1392 else
1393 dNotchDepth = pCliff->dGetNotchIncision();
1394 }
1395
1396 // Set the feature's attribute
1397 pOGRFeature->SetField(strFieldValue1.c_str(), dNotchDepth);
1398 }
1399 }
1400
1401 // Create the feature in the output layer
1402 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1403 {
1404 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " point " << j << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1405 return false;
1406 }
1407
1408 // Get rid of the feature object
1409 OGRFeature::DestroyFeature(pOGRFeature);
1410 }
1411 }
1412
1413 break;
1414 }
1415
1417 {
1418 // The layer has been created, so create real-numbered values associated with each point
1419 string const strFieldValue1 = "Angle";
1420 string const strFieldValue2 = "Height";
1421
1422 // Create the first field
1423 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTReal);
1424
1425 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1426 {
1427 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1428 return false;
1429 }
1430
1431 // Create the second field
1432 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTReal);
1433
1434 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1435 {
1436 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1437 return false;
1438 }
1439
1440 // OK, now create features
1441 OGRLineString const OGRls;
1442 OGRMultiLineString const OGRmls;
1443 OGRPoint OGRPt;
1444
1445 for (int nX = 0; nX < m_nXGridSize; nX++)
1446 {
1447 for (int nY = 0; nY < m_nYGridSize; nY++)
1448 {
1449 // Only output a value if the cell is a sea cell which is not in the active zone (wave height and angle values are meaningless if in the active zone)
1450 if ((m_pRasterGrid->m_Cell[nX][nY].bIsInContiguousSea()) && (!m_pRasterGrid->m_Cell[nX][nY].bIsInActiveZone()))
1451 {
1452 // Create a feature object, one per sea cell
1453 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1454
1455 // Set the feature's geometry (in external CRS)
1456 OGRPt.setX(dGridCentroidXToExtCRSX(nX));
1457 OGRPt.setY(dGridCentroidYToExtCRSY(nY));
1458 pOGRFeature->SetGeometry(&OGRPt);
1459
1460 double const dOrientation = m_pRasterGrid->m_Cell[nX][nY].dGetWaveAngle();
1461 double const dHeight = m_pRasterGrid->m_Cell[nX][nY].dGetWaveHeight();
1462
1463 if (bFPIsEqual(dHeight, DBL_NODATA, TOLERANCE) || bFPIsEqual(dOrientation, DBL_NODATA, TOLERANCE))
1464 continue;
1465
1466 // Set the feature's attributes
1467 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1468 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1469
1470 // Create the feature in the output layer
1471 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1472 {
1473 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for cell [" << nX << "][" << nY << "] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1474 return false;
1475 }
1476
1477 // Get rid of the feature object
1478 OGRFeature::DestroyFeature(pOGRFeature);
1479 }
1480 }
1481 }
1482
1483 break;
1484 }
1485
1487 {
1488 // The layer has been created, so create fields for wave transect point attributes
1489 string const strFieldValue1 = "ProfileID";
1490 string const strFieldValue2 = "CoastID";
1491 string const strFieldValue3 = "HeightX";
1492 string const strFieldValue4 = "HeightY";
1493 string const strFieldValue5 = "Height";
1494 string const strFieldValue6 = "Angle";
1495 string const strFieldValue7 = "Breaking";
1496 string const strFieldValue8 = "IsSynthetic";
1497
1498 // Create field definitions
1499 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1500 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1501 {
1502 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1503 return false;
1504 }
1505
1506 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTInteger);
1507 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1508 {
1509 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1510 return false;
1511 }
1512
1513 OGRFieldDefn const OGRField3(strFieldValue3.c_str(), OFTReal);
1514 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1515 {
1516 cerr << ERR << "cannot create " << strType << " attribute field 3 '" << strFieldValue3 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1517 return false;
1518 }
1519
1520 OGRFieldDefn const OGRField4(strFieldValue4.c_str(), OFTReal);
1521 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1522 {
1523 cerr << ERR << "cannot create " << strType << " attribute field 4 '" << strFieldValue4 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1524 return false;
1525 }
1526
1527 OGRFieldDefn const OGRField5(strFieldValue5.c_str(), OFTReal);
1528 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1529 {
1530 cerr << ERR << "cannot create " << strType << " attribute field 5 '" << strFieldValue5 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1531 return false;
1532 }
1533
1534 OGRFieldDefn const OGRField6(strFieldValue6.c_str(), OFTReal);
1535 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1536 {
1537 cerr << ERR << "cannot create " << strType << " attribute field 6 '" << strFieldValue6 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1538 return false;
1539 }
1540
1541 OGRFieldDefn const OGRField7(strFieldValue7.c_str(), OFTInteger);
1542 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
1543 {
1544 cerr << ERR << "cannot create " << strType << " attribute field 7 '" << strFieldValue7 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1545 return false;
1546 }
1547
1548 OGRFieldDefn const OGRField8(strFieldValue8.c_str(), OFTInteger);
1549 if (pOGRLayer->CreateField(&OGRField8) != OGRERR_NONE)
1550 {
1551 cerr << ERR << "cannot create " << strType << " attribute field 8 '" << strFieldValue8 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1552 return false;
1553 }
1554
1555 // Now create features for each point in each transect
1556 OGRPoint OGRPt;
1557
1558 for (size_t nTransect = 0; nTransect < m_VAllTransectsWithSynthetic.size(); nTransect++)
1559 {
1560 TransectWaveData const& transect = m_VAllTransectsWithSynthetic[nTransect];
1561
1562 for (size_t nPoint = 0; nPoint < transect.VdX.size(); nPoint++)
1563 {
1564 // Create a feature object for this point
1565 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1566
1567 // Set the feature's geometry (convert from grid CRS to external CRS)
1568 OGRPt.setX(dGridCentroidXToExtCRSX(static_cast<int>(transect.VdX[nPoint])));
1569 OGRPt.setY(dGridCentroidYToExtCRSY(static_cast<int>(transect.VdY[nPoint])));
1570 pOGRFeature->SetGeometry(&OGRPt);
1571
1572 // Calculate wave height and angle from components
1573 double const dHeightX = transect.VdHeightX[nPoint];
1574 double const dHeightY = transect.VdHeightY[nPoint];
1575 double const dHeight = sqrt(dHeightX * dHeightX + dHeightY * dHeightY);
1576 double dAngle = atan2(dHeightX, dHeightY) * 180.0 / PI;
1577 if (dAngle < 0)
1578 dAngle += 360.0;
1579
1580 // Set the feature's attributes
1581 pOGRFeature->SetField(strFieldValue1.c_str(), transect.nProfileID);
1582 pOGRFeature->SetField(strFieldValue2.c_str(), transect.nCoastID);
1583 pOGRFeature->SetField(strFieldValue3.c_str(), dHeightX);
1584 pOGRFeature->SetField(strFieldValue4.c_str(), dHeightY);
1585 pOGRFeature->SetField(strFieldValue5.c_str(), dHeight);
1586 pOGRFeature->SetField(strFieldValue6.c_str(), dAngle);
1587 pOGRFeature->SetField(strFieldValue7.c_str(), transect.VbBreaking[nPoint] ? 1 : 0);
1588 pOGRFeature->SetField(strFieldValue8.c_str(), (transect.nProfileID == -1) ? 1 : 0);
1589
1590 // Create the feature in the output layer
1591 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1592 {
1593 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for transect " << nTransect << " point " << nPoint << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1594 return false;
1595 }
1596
1597 // Get rid of the feature object
1598 OGRFeature::DestroyFeature(pOGRFeature);
1599 }
1600 }
1601
1602 break;
1603 }
1604
1606 {
1607 // The layer has been created, so create real-numbered values associated with each point
1608 string const strFieldValue1 = "Angle";
1609 string const strFieldValue2 = "Height";
1610
1611 // Create the first field
1612 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTReal);
1613
1614 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1615 {
1616 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1617 return false;
1618 }
1619
1620 // Create the second field
1621 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTReal);
1622
1623 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1624 {
1625 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1626 return false;
1627 }
1628
1629 // OK, now create features
1630 OGRLineString const OGRls;
1631 OGRMultiLineString const OGRmls;
1632 OGRPoint OGRPt;
1633
1634 for (int nX = 0; nX < m_nXGridSize; nX++)
1635 {
1636 for (int nY = 0; nY < m_nYGridSize; nY++)
1637 {
1638 // Create a feature object, one per sea cell
1639 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1640
1641 // Set the feature's geometry (in external CRS)
1642 OGRPt.setX(dGridCentroidXToExtCRSX(nX));
1643 OGRPt.setY(dGridCentroidYToExtCRSY(nY));
1644 pOGRFeature->SetGeometry(&OGRPt);
1645
1646 double const dOrientation = m_pRasterGrid->m_Cell[nX][nY].dGetTotWaveAngle() / static_cast<double>(m_ulIter);
1647 double const dHeight = m_pRasterGrid->m_Cell[nX][nY].dGetWaveHeight() / static_cast<double>(m_ulIter);
1648
1649 if (bFPIsEqual(dHeight, DBL_NODATA, TOLERANCE) || bFPIsEqual(dOrientation, DBL_NODATA, TOLERANCE))
1650 continue;
1651
1652 // Set the feature's attributes
1653 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1654 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1655
1656 // Create the feature in the output layer
1657 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1658 {
1659 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for cell [" << nX << "][" << nY << "] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1660 return false;
1661 }
1662
1663 // Get rid of the feature object
1664 OGRFeature::DestroyFeature(pOGRFeature);
1665 }
1666 }
1667
1668 break;
1669 }
1670
1672 {
1673 // The layer has been created, so create seven integer-numbered values for the polygon
1674 string const strFieldValue1 = "Coast";
1675 string const strFieldValue2 = "Polygon";
1676 string const strFieldValue3 = "CoastNode";
1677 string const strFieldValue4 = "TotSedChng";
1678 string const strFieldValue5 = "FinSedChng";
1679 string const strFieldValue6 = "SndSedChng";
1680 string const strFieldValue7 = "CrsSedChng";
1681
1682 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1683 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1684 {
1685 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1686 return false;
1687 }
1688
1689 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTInteger);
1690 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1691 {
1692 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1693 return false;
1694 }
1695
1696 OGRFieldDefn const OGRField3(strFieldValue3.c_str(), OFTReal);
1697 if (pOGRLayer->CreateField(&OGRField3) != OGRERR_NONE)
1698 {
1699 cerr << ERR << "cannot create " << strType << " attribute field 3 '" << strFieldValue3 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1700 return false;
1701 }
1702
1703 OGRFieldDefn const OGRField4(strFieldValue4.c_str(), OFTReal);
1704 if (pOGRLayer->CreateField(&OGRField4) != OGRERR_NONE)
1705 {
1706 cerr << ERR << "cannot create " << strType << " attribute field 4 '" << strFieldValue4 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1707 return false;
1708 }
1709
1710 OGRFieldDefn const OGRField5(strFieldValue5.c_str(), OFTReal);
1711 if (pOGRLayer->CreateField(&OGRField5) != OGRERR_NONE)
1712 {
1713 cerr << ERR << "cannot create " << strType << " attribute field 5 '" << strFieldValue5 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1714 return false;
1715 }
1716
1717 OGRFieldDefn const OGRField6(strFieldValue6.c_str(), OFTReal);
1718 if (pOGRLayer->CreateField(&OGRField6) != OGRERR_NONE)
1719 {
1720 cerr << ERR << "cannot create " << strType << " attribute field 6 '" << strFieldValue6 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1721 return false;
1722 }
1723
1724 OGRFieldDefn const OGRField7(strFieldValue7.c_str(), OFTReal);
1725 if (pOGRLayer->CreateField(&OGRField7) != OGRERR_NONE)
1726 {
1727 cerr << ERR << "cannot create " << strType << " attribute field 7 '" << strFieldValue6 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1728 return false;
1729 }
1730
1731 // OK, now do features
1732 OGRLineString OGRls;
1733
1734 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
1735 {
1736 for (int j = 0; j < m_VCoast[i].nGetNumPolygons(); j++)
1737 {
1738 // Create a feature object, one per polygon
1739 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1740
1741 CGeomCoastPolygon* pPolygon = m_VCoast[i].pGetPolygon(j);
1742
1743 // Set the feature's attributes
1744 pOGRFeature->SetField(strFieldValue1.c_str(), i);
1745 pOGRFeature->SetField(strFieldValue2.c_str(), j);
1746 pOGRFeature->SetField(strFieldValue3.c_str(), pPolygon->nGetNodeCoastPoint());
1747 pOGRFeature->SetField(strFieldValue4.c_str(), pPolygon->dGetBeachDepositionAndSuspensionAllUncons());
1748 pOGRFeature->SetField(strFieldValue5.c_str(), pPolygon->dGetSuspensionUnconsFine());
1749 pOGRFeature->SetField(strFieldValue6.c_str(), pPolygon->dGetBeachDepositionUnconsSand());
1750 pOGRFeature->SetField(strFieldValue7.c_str(), pPolygon->dGetBeachDepositionUnconsCoarse());
1751
1752 // Now attach a geometry to the feature object
1753 for (int n = 0; n < pPolygon->nGetBoundarySize(); n++)
1754 // In external CRS
1755 OGRls.addPoint(pPolygon->pPtGetBoundaryPoint(n)->dGetX(), pPolygon->pPtGetBoundaryPoint(n)->dGetY());
1756
1757 pOGRFeature->SetGeometry(&OGRls);
1758
1759 // Create the feature in the output layer
1760 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1761 {
1762 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for coast " << i << " polygon " << j << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1763 return false;
1764 }
1765
1766 // Tidy up: empty the line string and get rid of the feature object
1767 OGRls.empty();
1768 OGRFeature::DestroyFeature(pOGRFeature);
1769 }
1770 }
1771
1772 break;
1773 }
1774
1776 {
1777 // Create an integer-numbered value (the number of the shadow boundary line object) for the multi-line
1778 string const strFieldValue1 = "ShadowLine";
1779 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1780
1781 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1782 {
1783 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1784 return false;
1785 }
1786
1787 // OK, now do features
1788 OGRLineString OGRls;
1789
1790 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
1791 {
1792 for (int j = 0; j < m_VCoast[i].nGetNumShadowBoundaries(); j++)
1793 {
1794 // Create a feature object, one per coast
1795 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1796
1797 // Set the feature's attribute (the shadow boundary line number)
1798 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1799
1800 // Now attach a geometry to the feature object
1801 CGeomLine LShadow = *m_VCoast[i].pGetShadowBoundary(j);
1802
1803 for (int nn = 0; nn < LShadow.nGetSize(); nn++)
1804 OGRls.addPoint(LShadow.dGetXAt(nn), LShadow.dGetYAt(nn));
1805
1806 pOGRFeature->SetGeometry(&OGRls);
1807
1808 // Create the feature in the output layer
1809 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1810 {
1811 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << j << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1812 return false;
1813 }
1814
1815 // Tidy up: empty the line string and get rid of the feature object
1816 OGRls.empty();
1817 OGRFeature::DestroyFeature(pOGRFeature);
1818 }
1819 }
1820
1821 break;
1822 }
1823
1825 {
1826 // Create an integer-numbered value (the number of the downdrift boundary line object) for the multi-line
1827 string const strFieldValue1 = "DdriftLine";
1828 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTInteger);
1829
1830 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1831 {
1832 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1833 return false;
1834 }
1835
1836 // OK, now do features
1837 OGRLineString OGRls;
1838
1839 for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
1840 {
1841 for (int j = 0; j < m_VCoast[i].nGetNumShadowDowndriftBoundaries(); j++)
1842 {
1843 // Create a feature object, one per coast
1844 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1845
1846 // Set the feature's attribute (the downdrift boundary line number)
1847 pOGRFeature->SetField(strFieldValue1.c_str(), j);
1848
1849 // Now attach a geometry to the feature object
1850 CGeomLine LDowndrift = *m_VCoast[i].pGetShadowDowndriftBoundary(j);
1851
1852 for (int nn = 0; nn < LDowndrift.nGetSize(); nn++)
1853 OGRls.addPoint(LDowndrift.dGetXAt(nn), LDowndrift.dGetYAt(nn));
1854
1855 pOGRFeature->SetGeometry(&OGRls);
1856
1857 // Create the feature in the output layer
1858 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1859 {
1860 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << j << " for coast " << i << " in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1861 return false;
1862 }
1863
1864 // Tidy up: empty the line string and get rid of the feature object
1865 OGRls.empty();
1866 OGRFeature::DestroyFeature(pOGRFeature);
1867 }
1868 }
1869
1870 break;
1871 }
1872
1874 {
1875 // The layer has been created, so create real-numbered values associated with each point
1876 string const strFieldValue1 = "Angle";
1877 string const strFieldValue2 = "Height";
1878
1879 // Create the first field
1880 OGRFieldDefn const OGRField1(strFieldValue1.c_str(), OFTReal);
1881
1882 if (pOGRLayer->CreateField(&OGRField1) != OGRERR_NONE)
1883 {
1884 cerr << ERR << "cannot create " << strType << " attribute field 1 '" << strFieldValue1 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1885 return false;
1886 }
1887
1888 // Create the second field
1889 OGRFieldDefn const OGRField2(strFieldValue2.c_str(), OFTReal);
1890
1891 if (pOGRLayer->CreateField(&OGRField2) != OGRERR_NONE)
1892 {
1893 cerr << ERR << "cannot create " << strType << " attribute field 2 '" << strFieldValue2 << "' in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1894 return false;
1895 }
1896
1897 // OK, now create features
1898 OGRLineString const OGRls;
1899 OGRMultiLineString const OGRmls;
1900 OGRPoint OGRPt;
1901
1902 for (int nX = 0; nX < m_nXGridSize; nX++)
1903 {
1904 for (int nY = 0; nY < m_nYGridSize; nY++)
1905 {
1906 // Create a feature object, one per cell (does this whether the sea is a sea cell or a land cell)
1907 OGRFeature* pOGRFeature = OGRFeature::CreateFeature(pOGRLayer->GetLayerDefn());
1908
1909 // Set the feature's geometry (in external CRS)
1910 OGRPt.setX(dGridCentroidXToExtCRSX(nX));
1911 OGRPt.setY(dGridCentroidYToExtCRSY(nY));
1912 pOGRFeature->SetGeometry(&OGRPt);
1913
1914 double const dOrientation = m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveAngle();
1915 double const dHeight = m_pRasterGrid->m_Cell[nX][nY].dGetCellDeepWaterWaveHeight();
1916
1917 if (bFPIsEqual(dHeight, DBL_NODATA, TOLERANCE) || bFPIsEqual(dOrientation, DBL_NODATA, TOLERANCE) || (!m_pRasterGrid->m_Cell[nX][nY].bIsInContiguousSea()))
1918 continue;
1919
1920 // Set the feature's attributes
1921 pOGRFeature->SetField(strFieldValue1.c_str(), dOrientation);
1922 pOGRFeature->SetField(strFieldValue2.c_str(), dHeight);
1923
1924 // Create the feature in the output layer
1925 if (pOGRLayer->CreateFeature(pOGRFeature) != OGRERR_NONE)
1926 {
1927 cerr << ERR << "cannot create " << strType << " feature " << strPlotTitle << " for cell [" << nX << "][" << nY << "] in " << strFilePathName << endl << CPLGetLastErrorMsg() << endl;
1928 return false;
1929 }
1930
1931 // Get rid of the feature object
1932 OGRFeature::DestroyFeature(pOGRFeature);
1933 }
1934 }
1935
1936 break;
1937 }
1938 }
1939
1940 CPLPopErrorHandler();
1941
1942 // Get rid of the dataset object
1943 GDALClose(pGDALDataSet);
1944
1945 return true;
1946}
int nGetSize(void) const
Definition 2d_shape.cpp:53
Abstract class, used as a base class for landform objects on the coastline.
int nGetLandFormCategory(void) const
Get the landform category.
double dGetY(void) const
Returns the CGeom2DPoint object's double Y coordinate.
Definition 2d_point.cpp:51
double dGetX(void) const
Returns the CGeom2DPoint object's double X coordinate.
Definition 2d_point.cpp:45
Geometry class used for coast polygon objects.
double dGetBeachDepositionUnconsSand(void) const
Returns the depth of sand-sized unconsolidated sediment deposited on this polygon during this timeste...
double dGetBeachDepositionUnconsCoarse(void) const
Returns the depth of coarse-sized unconsolidated sediment deposited on this polygon during this times...
CGeom2DPoint * pPtGetBoundaryPoint(int const)
Get the coordinates (external CRS) of a specified point on the polygon's boundary.
double dGetBeachDepositionAndSuspensionAllUncons(void) const
Returns this timestep's total (all size classes) deposition and to-suspension movement of unconsolida...
int nGetNodeCoastPoint(void) const
Get the coast node point.
int nGetBoundarySize(void) const
Get the number of points in the polygon's boundary.
double dGetSuspensionUnconsFine(void) const
Returns this timestep's to-suspension movement of fine unconsolidated sediment on this polygon,...
Geometry class used to represent 2D vector line objects.
Definition line.h:28
double dGetYAt(int const)
Returns the Y value at a given place in the line.
Definition line.cpp:60
double dGetXAt(int const)
Returns the X value at a given place in the line.
Definition line.cpp:54
Geometry class used to represent coast profile objects.
Definition profile.h:33
bool bTruncatedDifferentCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:209
bool bHitAnotherProfile(void) const
Returns the switch which indicates whether this profile hits another profile badly.
Definition profile.cpp:221
bool bHitLand(void) const
Returns the switch which indicates whether this profile has hit land.
Definition profile.cpp:149
bool bTooShort(void) const
Returns the switch which indicates whether this profile is too short to be useful.
Definition profile.cpp:185
bool bHitCoast(void) const
Returns the switch which indicates whether this profile has hit a coast.
Definition profile.cpp:173
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point (external CRS) from the profile.
Definition profile.cpp:364
bool bOKIncStartAndEndOfCoast(void) const
Returns true if this is a problem-free profile (however it could be a start-of-coast or an end-of-coa...
Definition profile.cpp:262
int nGetCoastID(void) const
Returns this profile's coast ID.
Definition profile.cpp:68
int nGetProfileSize(void) const
Returns the number of external CRS points in the profile (only two, initally; and always just two for...
Definition profile.cpp:358
bool bStartOfCoast(void) const
Returns the switch to indicate whether this is a start-of-coast profile.
Definition profile.cpp:104
bool bTruncatedSameCoast(void) const
Returns the switch which indicates whether this profile has been truncated, due to hitting another pr...
Definition profile.cpp:197
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:116
bool bCShoreProblem(void) const
Returns the switch which indicates whether this profile has a CShore problem.
Definition profile.cpp:137
bool bHitIntervention(void) const
Returns the switch which indicates whether this profile has hit an intervention.
Definition profile.cpp:161
Real-world class used to represent the 'cliff' category of coastal landform object.
Definition cliff.h:28
bool bHasCollapsed(void) const
Returns the value of the cliff collapse switch.
Definition cliff.cpp:52
double dGetNotchIncision(void) const
Returns the horizontal incision (in external CRS units) of the cliff's erosional notch (the 'overhang...
Definition cliff.cpp:82
int m_nGISMaxSaveDigits
The maximum number of digits in GIS filenames. These can be sequential, or the iteration number.
Definition simulation.h:516
string m_strOGRVectorOutputExtension
GDAL-OGR vector output drive file extension.
bool m_bFloodSWLSetupSurgeLine
Are we saving the flood still water level setup surge line? TODO 007 Finish surge and runup stuff.
Definition simulation.h:441
bool m_bSedimentInputAtPoint
Do we have sediment inputat a point?
Definition simulation.h:396
double m_dThisIterSWL
The still water level for this timestep (this includes tidal changes and any long-term SWL change)
Definition simulation.h:726
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
int m_nXGridSize
The size of the grid in the x direction.
Definition simulation.h:477
vector< double > m_VdDeepWaterWaveStationY
Y coordinate (grid CRS) for deep water wave station.
ofstream LogStream
char ** m_papszGDALVectorOptions
Options for GDAL when handling vector files.
Definition simulation.h:474
vector< CRWCoast > m_VFloodWaveSetupSurgeRunup
TODO 007 Finish surge and runup stuff.
vector< CRWCoast > m_VCoast
The coastline objects.
string m_strOGRSedInputDataType
GDAL data type for the sediment input event locations vector file.
vector< TransectWaveData > m_VAllTransectsWithSynthetic
Storage for wave transect points (real and synthetic) for debug output.
bool bWriteVectorGISFile(int const, string const *)
Writes vector GIS files using GDAL/OGR.
double m_dThisIterDiffWaveSetupSurgeWaterLevel
TODO 007 Finish surge and runup stuff.
Definition simulation.h:747
vector< int > m_VnSedimentInputLocationID
ID for sediment input location, this corresponds with the ID in the sediment input time series file.
int m_nYGridSize
The size of the grid in the y direction.
Definition simulation.h:480
string m_strSedimentInputEventShapefile
The name of the sediment input events shape file.
string m_strVectorGISOutFormat
Vector GIS output format.
string m_strDeepWaterWaveStationsShapefile
The name of the deep water wave stations shape file.
vector< CGeomLine > m_VLowestSWLCoastLine
Coastline (external CRS) at the lowest SWL so far during this simulation.
vector< CRWCoast > m_VFloodWaveSetupSurge
TODO 007 Finish surge and runup stuff.
string m_strOGRFloodGeometry
GDAL geometry for the flood input locations point or vector file.
string m_strOGRSedInputDriverDesc
string m_strOGRDWWVDriverCode
GDAL code for the deep water wave stations vector file.
vector< double > m_VdFloodLocationX
X coordinate (grid CRS) for total water level flooding.
bool m_bSedimentInputAlongLine
Do we have sediment input along a line?
Definition simulation.h:402
bool m_bFloodSWLSetupSurgeRunupLineSave
Are we saving the flood still water level setup surge runup line? TODO 007 Finish surge and runup stu...
Definition simulation.h:450
vector< CGeomLine > m_VHighestSWLCoastLine
Coastline (external CRS) at the highest SWL so far during this simulation.
int nReadVectorGISFile(int const)
Reads vector GIS datafiles using GDAL/OGR.
vector< double > m_VdDeepWaterWaveStationX
X coordinate (grid CRS) for deep water wave station.
vector< double > m_VdSedimentInputLocationX
X coordinate (grid CRS) for sediment input event.
bool m_bSedimentInputAtCoast
Do we have sediment input at the coast?
Definition simulation.h:399
vector< CGeomLine > m_VCliffToe
The traced cliff toe lines (in external CRS)
double dGridCentroidYToExtCRSY(int const) const
Given the integer Y-axis ordinate of a cell in the raster grid CRS, returns the external CRS Y-axis o...
Definition gis_utils.cpp:74
string m_strOGRDWWVDriverDesc
string m_strOGRFloodDriverCode
GDAL code for the flood input locations point or vector file.
double m_dSimElapsed
Time simulated so far, in hours.
Definition simulation.h:693
vector< int > m_VnDeepWaterWaveStationID
ID for deep water wave station, this corresponds with the ID in the wave time series file.
vector< int > m_VnFloodLocationID
ID for flood location.
string m_strFloodLocationShapefile
The name of the flood loction events shape file.
bool m_bGISSaveDigitsSequential
Are the GIS save digits (which are part of each GIS file name) sequential, or are they the iteration ...
Definition simulation.h:453
double dExtCRSXToGridX(double const) const
Transforms an X-axis ordinate in the external CRS to the equivalent X-axis ordinate in the raster gri...
string m_strOGRDWWVGeometry
GDAL geometry for the deep water wave stations vector file.
string m_strOutPath
Path for all output files.
vector< double > m_VdSedimentInputLocationY
X coordinate (grid CRS) for sediment input event.
int m_nGISSave
The save number for GIS files (can be sequential, or the iteration number)
Definition simulation.h:519
double dExtCRSYToGridY(double const) const
Transforms a Y-axis ordinate in the external CRS to the equivalent Y-axis ordinate in the raster grid...
string m_strOGRSedInputGeometry
GDAL geometry for the sediment input event locations vector file.
string m_strOGRSedInputDriverCode
GDAL code for the sediment input event locations vector file.
string m_strOGRFloodDriverDesc
string m_strOGRFloodDataType
GDAL data type for the flood input locations point or vector file.
string m_strGDALBasementDEMProjection
GDAL projection string for the basement DEM raster file.
unsigned long m_ulIter
The number of the current iteration (time step)
Definition simulation.h:609
double dGridCentroidXToExtCRSX(int const) const
Given the integer X-axis ordinate of a cell in the raster grid CRS, returns the external CRS X-axis o...
Definition gis_utils.cpp:65
string m_strOGRDWWVDataType
GDAL data type for the deep water wave stations vector file.
double m_dThisIterDiffWaveSetupSurgeRunupWaterLevel
TODO 007 Finish surge and runup stuff.
Definition simulation.h:750
double m_dCellSide
Length of a cell side (in external CRS units)
Definition simulation.h:672
vector< double > m_VdFloodLocationY
X coordinate (grid CRS) for total water level flooding.
Contains CRWCliff definitions.
This file contains global definitions for CoastalME.
int const INT_NODATA
Definition cme.h:380
double const TOLERANCE
Definition cme.h:725
int const VECTOR_PLOT_STORM_SURGE
Definition cme.h:576
int const VECTOR_PLOT_BREAKING_WAVE_HEIGHT
Definition cme.h:559
int const VECTOR_PLOT_POLYGON_NODES
Definition cme.h:573
int const FLOOD_LOCATION_POINT_GEOMETRY
Definition cme.h:480
int const VECTOR_PLOT_NORMALS
Definition cme.h:571
string const VECTOR_WAVE_ANGLE_AND_HEIGHT_NAME
Definition cme.h:1090
string const VECTOR_SHADOW_ZONE_BOUNDARY_NAME
Definition cme.h:1085
int const SEDIMENT_INPUT_EVENT_LOCATION_MAX_LAYER
Definition cme.h:478
string const VECTOR_POLYGON_BOUNDARY_NAME
Definition cme.h:1079
int const SEDIMENT_INPUT_EVENT_LOCATION_VEC
Definition cme.h:477
string const ERR
Definition cme.h:805
int const RTN_ERR_WAVESTATION_LOCATION
Definition cme.h:650
string const VECTOR_WAVE_TRANSECT_POINTS_NAME
Definition cme.h:1096
string const VECTOR_BREAKING_WAVE_HEIGHT_NAME
Definition cme.h:1049
int const VECTOR_PLOT_COAST_SWL_HIGHEST
Definition cme.h:564
int const VECTOR_PLOT_COAST_CURVATURE
Definition cme.h:563
string const VECTOR_COAST_NAME
Definition cme.h:1057
double const PI
Definition cme.h:707
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1213
int const VECTOR_PLOT_RUN_UP
Definition cme.h:574
int const LF_CLIFF_INLAND
Definition cme.h:438
int const VECTOR_PLOT_SHADOW_ZONE_BOUNDARY
Definition cme.h:575
int const VECTOR_PLOT_INVALID_NORMALS
Definition cme.h:569
string const FLOOD_LOCATION_ID
Definition cme.h:835
string const VECTOR_STORM_SURGE_NAME
Definition cme.h:1087
int const FLOOD_LOCATION_VEC
Definition cme.h:482
int const DEEP_WATER_WAVE_STATIONS_VEC
Definition cme.h:474
int const RTN_ERR_SEDIMENT_INPUT_EVENT_LOCATION
Definition cme.h:649
string const VECTOR_CLIFF_EDGE_NAME
Definition cme.h:1051
string const DEEP_WATER_WAVE_STATION_ID
Definition cme.h:833
string const VECTOR_AVG_WAVE_ANGLE_AND_HEIGHT_NAME
Definition cme.h:1047
string const VECTOR_RUN_UP_NAME
Definition cme.h:1083
int const VECTOR_PLOT_DOWNDRIFT_ZONE_BOUNDARY
Definition cme.h:567
int const VECTOR_PLOT_COAST
Definition cme.h:562
int const VECTOR_PLOT_FLOOD_LINE
Definition cme.h:568
string const VECTOR_FLOOD_LINE_NAME
Definition cme.h:1065
string const VECTOR_CLIFF_NOTCH_ACTIVE_NAME
Definition cme.h:1053
int const VECTOR_PLOT_COAST_SWL_LOWEST
Definition cme.h:565
int const DEEP_WATER_WAVE_STATIONS_POINT_GEOMETRY
Definition cme.h:476
int const RTN_ERR_VECTOR_FILE_READ
Definition cme.h:600
string const VECTOR_WAVE_ENERGY_SINCE_COLLAPSE_NAME
Definition cme.h:1092
int const VEC_GEOMETRY_POLYGON
Definition cme.h:470
int const VECTOR_PLOT_WAVE_ENERGY_SINCE_COLLAPSE
Definition cme.h:578
string const WARN
Definition cme.h:806
int const VECTOR_PLOT_WAVE_ANGLE_AND_HEIGHT
Definition cme.h:577
int const VECTOR_PLOT_CLIFF_NOTCH_ACTIVE
Definition cme.h:561
string const VECTOR_DEEP_WATER_WAVE_ANGLE_AND_HEIGHT_NAME
Definition cme.h:1061
int const SEDIMENT_INPUT_EVENT_LOCATION_LINE_GEOMETRY
Definition cme.h:481
string const SEDIMENT_INPUT_EVENT_LOCATION_ID
Definition cme.h:834
int const VECTOR_PLOT_CLIFF_EDGE
Definition cme.h:560
int const VECTOR_PLOT_POLYGON_BOUNDARY
Definition cme.h:572
int const VEC_GEOMETRY_LINE
Definition cme.h:469
int const VECTOR_PLOT_MEAN_WAVE_ENERGY
Definition cme.h:570
int const RTN_OK
Definition cme.h:585
int const LF_CLIFF_ON_COASTLINE
Definition cme.h:437
int const VEC_GEOMETRY_POINT
Definition cme.h:468
double const DBL_NODATA
Definition cme.h:736
string const VECTOR_COAST_CURVATURE_NAME
Definition cme.h:1056
int const VECTOR_PLOT_AVG_WAVE_ANGLE_AND_HEIGHT
Definition cme.h:558
int const VECTOR_PLOT_DEEP_WATER_WAVE_ANGLE_AND_HEIGHT
Definition cme.h:566
string const VECTOR_INVALID_NORMALS_NAME
Definition cme.h:1073
int const SEDIMENT_INPUT_EVENT_LOCATION_POINT_GEOMETRY
Definition cme.h:479
int const VECTOR_PLOT_WAVE_SETUP
Definition cme.h:579
int const VECTOR_PLOT_WAVE_TRANSECT_POINTS
Definition cme.h:580
int const VEC_GEOMETRY_OTHER
Definition cme.h:471
int const DEEP_WATER_WAVE_STATIONS_MAX_LAYER
Definition cme.h:475
int const FLOOD_LOCATION_MAX_LAYER
Definition cme.h:483
string const VECTOR_POLYGON_NODE_NAME
Definition cme.h:1081
string const VECTOR_NORMALS_NAME
Definition cme.h:1077
string const VECTOR_WAVE_SETUP_NAME
Definition cme.h:1094
string const VECTOR_COAST_SWL_LOWEST_NAME
Definition cme.h:1059
string const VECTOR_COAST_SWL_HIGHEST_NAME
Definition cme.h:1058
string const VECTOR_DOWNDRIFT_ZONE_BOUNDARY_NAME
Definition cme.h:1063
string const VECTOR_MEAN_WAVE_ENERGY_NAME
Definition cme.h:1075
char const SPACE
Definition cme.h:357
Contains CRWCoast definitions.
Contains CSimulation definitions.