7#include "PolygonSeeder.h"
10#include "LeastSquares.h"
12#include "PolygonTools.h"
13#include "PolynomialBivariate.h"
14#include "LeastSquares.h"
16#include "ProjectionFactory.h"
91 errorSpot =
"Algorithm";
92 PvlGroup &algo = pvl.findGroup(
"PolygonSeederAlgorithm", Pvl::Traverse);
95 PvlGroup &invalgo =
invalidInput->findGroup(
"PolygonSeederAlgorithm",
102 if(invalgo.hasKeyword(
"Name"))
103 invalgo.deleteKeyword(
"Name");
106 errorSpot =
"MinimumThickness";
108 if(algo.hasKeyword(
"MinimumThickness")) {
112 if(invalgo.hasKeyword(
"MinimumThickness"))
113 invalgo.deleteKeyword(
"MinimumThickness");
116 errorSpot =
"MinimumArea";
118 if(algo.hasKeyword(
"MinimumArea")) {
122 if(invalgo.hasKeyword(
"MinimumArea"))
123 invalgo.deleteKeyword(
"MinimumArea");
125 catch(IException &e) {
126 QString msg =
"Improper format for PolygonSeeder PVL [";
127 msg += pvl.fileName() +
"]. Location [" + errorSpot +
"]";
128 throw IException(IException::User, msg, _FILEINFO_);
147 const geos::geom::Envelope *xyBoundBox) {
149 QString msg =
"Polygon did not meet the minimum area of [";
156 pow(std::max(xyBoundBox->getWidth(), xyBoundBox->getHeight()), 2.0);
158 QString msg =
"Polygon did not meet the minimum thickness ratio of [";
211 PvlGroup pluginInfo(grpName);
217 pluginInfo.addKeyword(name);
218 pluginInfo.addKeyword(minThickness);
219 pluginInfo.addKeyword(minArea);
Pvl InvalidInput()
This method returns a copy of the Pvl passed in by the constructor (from a def file probably) minus w...
virtual void Parse(Pvl &pvl)
Initialize parameters in the PolygonSeeder class using a PVL specification.
Pvl * invalidInput
The Pvl passed in by the constructor minus what was used.
QString StandardTests(const geos::geom::MultiPolygon *multiPoly, const geos::geom::Envelope *polyBoundBox)
Check the polygon to see if it meets standard criteria.
virtual PvlGroup PluginParameters(QString grpName)
Plugin parameters.
virtual ~PolygonSeeder()
Destroys the PolygonSeeder object.
double p_minimumThickness
The value for the 'MinimumThickness' Keyword in the PolygonSeederAlgorithm group of the Pvl that is p...
QString p_algorithmName
The value for the 'Name' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into t...
PolygonSeeder(Pvl &pvl)
Create PolygonSeeder object.
double MinimumArea()
Return the minimum allowed area of the polygon.
double MinimumThickness()
Return the minimum allowed thickness of the polygon.
QString Algorithm() const
The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constr...
double p_minimumArea
The value for the 'MinimumArea' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed...
const PolygonSeeder & operator=(const PolygonSeeder &other)
Assignment operator.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.