Unverified Commit 863eac71 authored by Tim Giroux's avatar Tim Giroux Committed by GitHub
Browse files

GEOS 3.9 footprintmerge, cnetcheck, cnetwinnow, and HiJitCube (#4453)

* footprintmerge, cnetcheck, and cnetwinnow fit geos 3.9 api

* include HiJitCube changes
parent cb59ebfb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@ void IsisMain() {

  //  Create union poly
  geos::geom::GeometryCollection *polyCollection =
    Isis::globalFactory->createGeometryCollection(allPolys);
  geos::geom::Geometry *unionPoly = polyCollection->buffer(0);
    Isis::globalFactory->createGeometryCollection(&allPolys);
  geos::geom::Geometry *unionPoly = polyCollection->buffer(0).release();


  //  How many polygons are in unionPoly
@@ -98,7 +98,7 @@ void IsisMain() {
  else if(unionPoly->getGeometryTypeId() == geos::geom::GEOS_MULTIPOLYGON) {
    geos::geom::MultiPolygon *multi = PolygonTools::MakeMultiPolygon(unionPoly);
    for(unsigned int i = 0; i < multi->getNumGeometries(); ++i) {
      islandPolys.push_back(multi->getGeometryN(i)->clone());
      islandPolys.push_back(multi->getGeometryN(i)->clone().release());
    }
  }

+2 −2
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ namespace Isis {
    double controlFitness = 0;

    static  geos::geom::GeometryFactory::Ptr geosFactory = geos::geom::GeometryFactory::create();
    geos::geom::CoordinateSequence * pts = new geos::geom::CoordinateArraySequence();
    geos::geom::CoordinateArraySequence * pts = new geos::geom::CoordinateArraySequence();
    QList< ControlMeasure * > measures = cnet.GetMeasuresInCube(sn);

    // Populate pts with a list of control points
@@ -588,7 +588,7 @@ namespace Isis {

      // Calculate the convex hull
      geos::geom::Geometry * convexHull = geosFactory->createPolygon(
          geosFactory->createLinearRing(pts), 0)->convexHull();
          geosFactory->createLinearRing(pts), 0)->convexHull().release();

      // Calculate the area of the convex hull
      double convexArea = convexHull->getArea();
+2 −2
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ namespace Isis {
    bool ignorMeas;
    QList<ControlMeasure *> cubeMeasures = net.GetMeasuresInCube(serialNum);
    static  geos::geom::GeometryFactory::Ptr geosFactory = geos::geom::GeometryFactory::create();
    geos::geom::CoordinateSequence * pts = new geos::geom::CoordinateArraySequence();
    geos::geom::CoordinateArraySequence * pts = new geos::geom::CoordinateArraySequence();
    for (i=0;i<cubeMeasures.size();i++) {
      if (cubeMeasures[i]->IsIgnored()) continue;  //skip ignored measures
      if (cubeMeasures[i]->Parent()->IsIgnored()) continue; //skip measures of ignored points
@@ -459,7 +459,7 @@ namespace Isis {
    if (pts->size() >= 4) {
      // Calculate the convex hull
      geos::geom::Geometry * convexHull = geosFactory->createPolygon(
          geosFactory->createLinearRing(pts), 0)->convexHull();
          geosFactory->createLinearRing(pts), 0)->convexHull().release();
      // Calculate the area of the convex hull
      area = convexHull->getArea();
    }
+3 −3
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ namespace Isis {
  }

  bool HiJitCube::overlap(const HiJitCube &cube, Corners &ovlCorners) {
    geos::geom::Geometry *ovl = fpGeom->intersection(cube.Poly());
    geos::geom::Geometry *ovl = fpGeom->intersection(cube.Poly()).release();
//  cout << "Overlap: " << ovl->toString() << std::endl;
    ovlCorners = FocalPlaneToImage(getCorners(*ovl));
    delete ovl;
@@ -353,7 +353,7 @@ namespace Isis {
    int line0(jdata.fpLine0 + jdata.lineOffset), lineN(line0 + lineCount() - 1);

//  Allocate a new coordinate sequence and define it
    geos::geom::CoordinateSequence *pts = new geos::geom::CoordinateArraySequence();
    geos::geom::CoordinateArraySequence *pts = new geos::geom::CoordinateArraySequence();
    pts->add(geos::geom::Coordinate(samp0, lineN));
    pts->add(geos::geom::Coordinate(sampN, lineN));
    pts->add(geos::geom::Coordinate(sampN, line0));
@@ -395,7 +395,7 @@ namespace Isis {
    if((poly.isValid()) && (!poly.isEmpty())) {

//  Get the coordinate list
      geos::geom::CoordinateSequence *clist = poly.getCoordinates();
      geos::geom::CoordinateSequence *clist = poly.getCoordinates().release();
      const geos::geom::Coordinate *minpt = clist->minCoordinate();
//    cout << "MinPoint: " << minpt->x << ", " << minpt->y << std::endl;