54 std::vector<geos::geom::Point *> points;
57 const geos::geom::Envelope *mPolyBoundBox = multiPoly->getEnvelopeInternal();
65 for(
unsigned int i = 0; i < multiPoly->getNumGeometries(); ++i) {
66 const geos::geom::Polygon *poly = multiPoly->getGeometryN(i);
72 geos::geom::Point *centroid = poly->getCentroid().release();
73 double centerX = centroid->getX();
74 double centerY = centroid->getY();
76 const geos::geom::Envelope *polyBoundBox = poly->getEnvelopeInternal();
78 int xStepsToCentroid = (int)((centerX - polyBoundBox->getMinX()) /
p_Xspacing + 0.5);
79 int yStepsToCentroid = (int)((centerY - polyBoundBox->getMinY()) /
p_Yspacing + 0.5);
80 double dRealMinX = centerX - (xStepsToCentroid *
p_Xspacing);
81 double dRealMinY = centerY - (yStepsToCentroid *
p_Yspacing);
85 for(
double y = dRealMinY; y <= polyBoundBox->getMaxY(); y +=
p_Yspacing) {
87 for(
double x = dRealMinX; x <= polyBoundBox->getMaxX(); x +=
p_Xspacing) {
88 geos::geom::Coordinate c(x + dDeltaXToReal, y + dDeltaYToReal);
89 geos::geom::Point *p = Isis::globalFactory->createPoint(c).release();
91 points.push_back(Isis::globalFactory->createPoint(c).release());
95 geos::geom::Coordinate c2(x - dDeltaXToReal, y - dDeltaYToReal);
96 p = Isis::globalFactory->createPoint(c2).release();
98 points.push_back(Isis::globalFactory->createPoint(c2).release());
121 PvlGroup &algo = pvl.findGroup(
"PolygonSeederAlgorithm", Pvl::Traverse);
122 PvlGroup &invalgo =
invalidInput->findGroup(
"PolygonSeederAlgorithm",
127 if(algo.hasKeyword(
"XSpacing")) {
129 if(invalgo.hasKeyword(
"XSpacing")) {
130 invalgo.deleteKeyword(
"XSpacing");
134 QString msg =
"PVL for StripSeeder must contain [XSpacing] in [";
135 msg += pvl.fileName() +
"]";
136 throw IException(IException::User, msg, _FILEINFO_);
140 if(algo.hasKeyword(
"YSpacing")) {
142 if(invalgo.hasKeyword(
"YSpacing")) {
143 invalgo.deleteKeyword(
"YSpacing");
147 QString msg =
"PVL for StripSeeder must contain [YSpacing] in [";
148 msg += pvl.fileName() +
"]";
149 throw IException(IException::User, msg, _FILEINFO_);
152 catch(IException &e) {
153 QString msg =
"Improper format for PolygonSeeder PVL [" + pvl.fileName() +
"]";
154 throw IException(IException::User, msg, _FILEINFO_);
158 IString msg =
"X Spacing must be greater that 0.0 [(" + IString(
p_Xspacing) +
"]";
159 throw IException(IException::User, msg, _FILEINFO_);
162 IString msg =
"Y Spacing must be greater that 0.0 [(" + IString(
p_Yspacing) +
"]";
163 throw IException(IException::User, msg, _FILEINFO_);