Unverified Commit 376a8f12 authored by Stuart Sides's avatar Stuart Sides Committed by GitHub
Browse files

GEOS 3.9 PixelFOV (#4456)

parent ab679f1b
Loading
Loading
Loading
Loading
+22 −23
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ namespace Isis {
  QList<QPointF> PixelFOV::envelope(QList<QPointF> vertices) const{

    //Put the vertices in a line string
    QScopedPointer<geos::geom::CoordinateSequence> points(new geos::geom::CoordinateArraySequence());
    QScopedPointer<geos::geom::CoordinateArraySequence> points(new geos::geom::CoordinateArraySequence());

    for (int i = 0; i < vertices.size(); i++) {
      points->add(geos::geom::Coordinate(vertices[i].x(), vertices[i].y()));
@@ -240,10 +240,10 @@ namespace Isis {
                                                                           points.take()));

    //Compute a convex hull for the line string
    QScopedPointer<geos::geom::Geometry> boundingHull(pointString->convexHull());
    QScopedPointer<geos::geom::Geometry> boundingHull(pointString->convexHull().release());

    //Get the points
    geos::geom::CoordinateSequence *boundingPoints = boundingHull->getCoordinates();
    geos::geom::CoordinateSequence *boundingPoints = boundingHull->getCoordinates().release();

    QList<QPointF> boundingVertices;
    for (unsigned int i = 0; i < boundingPoints->getSize(); i++) {
@@ -270,7 +270,7 @@ namespace Isis {
    QList< QList<QPointF> > splitPoints;

    // Create a polygon to split.
    QScopedPointer<geos::geom::CoordinateSequence> pts(new geos::geom::CoordinateArraySequence());
    QScopedPointer<geos::geom::CoordinateArraySequence> pts(new geos::geom::CoordinateArraySequence());
    for (int i = 0; i < vertices.size(); i++) {
      pts->add(geos::geom::Coordinate(vertices[i].y(), vertices[i].x()));
    }
@@ -291,8 +291,7 @@ namespace Isis {
      // delete them when it is deleted.
      const geos::geom::Polygon *subPolygon =
          dynamic_cast<const geos::geom::Polygon *>(splitPolygons->getGeometryN(i));
      geos::geom::CoordinateSequence *subCoordinates = subPolygon->
                                                           getExteriorRing()->getCoordinates();
      geos::geom::CoordinateSequence *subCoordinates = subPolygon->getExteriorRing()->getCoordinates().release();
      for (unsigned int j = 0; j < subCoordinates->getSize(); j++) {
        subVertices.append(QPointF(subCoordinates->getAt(j).y,subCoordinates->getAt(j).x));
      }