Loading isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ namespace Isis { geos::geom::Geometry *gridSquarePolygon = GetMultiPolygon(x - xSpacing / 2.0, y - ySpacing / 2, x + xSpacing / 2.0, y + ySpacing / 2, *multiPoly); geos::geom::Point *centroid = gridSquarePolygon->getCentroid(); geos::geom::Point *centroid = gridSquarePolygon->getCentroid().release(); delete gridSquarePolygon; if(centroid == NULL) continue; Loading Loading @@ -121,7 +121,7 @@ namespace Isis { geos::geom::Geometry *LimitPolygonSeeder::GetMultiPolygon(double dMinX, double dMinY, double dMaxX, double dMaxY, const geos::geom::MultiPolygon &orig) { geos::geom::CoordinateSequence *points = new geos::geom::CoordinateArraySequence(); geos::geom::CoordinateArraySequence *points = new geos::geom::CoordinateArraySequence(); points->add(geos::geom::Coordinate(dMinX, dMinY)); points->add(geos::geom::Coordinate(dMaxX, dMinY)); Loading @@ -130,7 +130,7 @@ namespace Isis { points->add(geos::geom::Coordinate(dMinX, dMinY)); geos::geom::Polygon *poly = Isis::globalFactory->createPolygon(Isis::globalFactory->createLinearRing(points), NULL); geos::geom::Geometry *overlap = poly->intersection(&orig); geos::geom::Geometry *overlap = poly->intersection(&orig).release(); return overlap; } Loading isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ int main() { Pvl pvl; pvl.addObject(o); cout << pvl << endl << endl; std::cout << pvl << std::endl << std::endl; PolygonSeeder *ps = PolygonSeederFactory::Create(pvl); Loading @@ -57,10 +57,10 @@ int main() { std::cout << "MinimumArea = " << ps->MinimumArea() << std::endl; cout << "Test 2, test a triangular polygon" << endl; std::cout << "Test 2, test a triangular polygon" << std::endl; try { // Call the seed member with a polygon geos::geom::CoordinateSequence *pts; geos::geom::CoordinateArraySequence *pts; vector<geos::geom::Geometry *> polys; // Create the A polygon Loading @@ -74,9 +74,9 @@ int main() { polys.push_back(Isis::globalFactory->createPolygon( Isis::globalFactory->createLinearRing(pts), NULL)); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(polys); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(&polys); cout << "Lon/Lat polygon = " << mp->toString() << endl; std::cout << "Lon/Lat polygon = " << mp->toString() << std::endl; // Create the projection necessary for seeding PvlGroup radii = Target::radiiGroup("MARS"); Isis::Pvl maplab; Loading Loading @@ -122,7 +122,7 @@ int main() { cout << "Test 3, test for too thin" << endl; try { // Call the seed member with a polygon geos::geom::CoordinateSequence *pts; geos::geom::CoordinatArraySequence *pts; vector<geos::geom::Geometry *> polys; // Create the A polygon Loading @@ -136,7 +136,7 @@ int main() { polys.push_back(Isis::globalFactory->createPolygon( Isis::globalFactory->createLinearRing(pts), NULL)); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(polys); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(&polys); cout << "Lon/Lat polygon = " << mp->toString() << endl; Loading Loading
isis/src/base/objs/LimitPolygonSeeder/LimitPolygonSeeder.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ namespace Isis { geos::geom::Geometry *gridSquarePolygon = GetMultiPolygon(x - xSpacing / 2.0, y - ySpacing / 2, x + xSpacing / 2.0, y + ySpacing / 2, *multiPoly); geos::geom::Point *centroid = gridSquarePolygon->getCentroid(); geos::geom::Point *centroid = gridSquarePolygon->getCentroid().release(); delete gridSquarePolygon; if(centroid == NULL) continue; Loading Loading @@ -121,7 +121,7 @@ namespace Isis { geos::geom::Geometry *LimitPolygonSeeder::GetMultiPolygon(double dMinX, double dMinY, double dMaxX, double dMaxY, const geos::geom::MultiPolygon &orig) { geos::geom::CoordinateSequence *points = new geos::geom::CoordinateArraySequence(); geos::geom::CoordinateArraySequence *points = new geos::geom::CoordinateArraySequence(); points->add(geos::geom::Coordinate(dMinX, dMinY)); points->add(geos::geom::Coordinate(dMaxX, dMinY)); Loading @@ -130,7 +130,7 @@ namespace Isis { points->add(geos::geom::Coordinate(dMinX, dMinY)); geos::geom::Polygon *poly = Isis::globalFactory->createPolygon(Isis::globalFactory->createLinearRing(points), NULL); geos::geom::Geometry *overlap = poly->intersection(&orig); geos::geom::Geometry *overlap = poly->intersection(&orig).release(); return overlap; } Loading
isis/src/base/objs/LimitPolygonSeeder/unitTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ int main() { Pvl pvl; pvl.addObject(o); cout << pvl << endl << endl; std::cout << pvl << std::endl << std::endl; PolygonSeeder *ps = PolygonSeederFactory::Create(pvl); Loading @@ -57,10 +57,10 @@ int main() { std::cout << "MinimumArea = " << ps->MinimumArea() << std::endl; cout << "Test 2, test a triangular polygon" << endl; std::cout << "Test 2, test a triangular polygon" << std::endl; try { // Call the seed member with a polygon geos::geom::CoordinateSequence *pts; geos::geom::CoordinateArraySequence *pts; vector<geos::geom::Geometry *> polys; // Create the A polygon Loading @@ -74,9 +74,9 @@ int main() { polys.push_back(Isis::globalFactory->createPolygon( Isis::globalFactory->createLinearRing(pts), NULL)); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(polys); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(&polys); cout << "Lon/Lat polygon = " << mp->toString() << endl; std::cout << "Lon/Lat polygon = " << mp->toString() << std::endl; // Create the projection necessary for seeding PvlGroup radii = Target::radiiGroup("MARS"); Isis::Pvl maplab; Loading Loading @@ -122,7 +122,7 @@ int main() { cout << "Test 3, test for too thin" << endl; try { // Call the seed member with a polygon geos::geom::CoordinateSequence *pts; geos::geom::CoordinatArraySequence *pts; vector<geos::geom::Geometry *> polys; // Create the A polygon Loading @@ -136,7 +136,7 @@ int main() { polys.push_back(Isis::globalFactory->createPolygon( Isis::globalFactory->createLinearRing(pts), NULL)); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(polys); geos::geom::MultiPolygon *mp = Isis::globalFactory->createMultiPolygon(&polys); cout << "Lon/Lat polygon = " << mp->toString() << endl; Loading