Beispiel #1
0
  /**
   * Check the polygon to see if it meets standard criteria.
   *
   * @param xymp The multipoly containing the coordinates in x/y units instead
   *             of lon/lat
   * @param xyBoundBox The bounding box of the multipoly
   * 
   * @return std::string A string with an appropriate message to throw if
   * a test was unsuccessful or an empty string if all tests passed.
   */
  std::string PolygonSeeder::StandardTests(const geos::geom::MultiPolygon *xymp,
                                           const geos::geom::Envelope *xyBoundBox) {
    if (xymp->getArea() < MinimumArea()) {
      std::string msg = "Polygon did not meet the minimum area of [";
      msg += Isis::iString(MinimumArea()) + "]";
      return msg;
    }

    double thickness = 
        xymp->getArea() /
        pow(std::max(xyBoundBox->getWidth(), xyBoundBox->getHeight()), 2.0);
    if (thickness < MinimumThickness()) {
      std::string msg = "Polygon did not meet the minimum thickness ratio of [";
      msg += Isis::iString(MinimumThickness()) + "]";
      return msg;
    }

    return "";
  }
Beispiel #2
0
  PvlGroup LimitPolygonSeeder::PluginParameters(QString grpName) {
    PvlGroup pluginInfo(grpName);

    PvlKeyword name("Name", Algorithm());
    PvlKeyword minThickness("MinimumThickness", toString(MinimumThickness()));
    PvlKeyword minArea("MinimumArea", toString(MinimumArea()));
    PvlKeyword majAxis("MajorAxisPoints", toString(p_majorAxisPts));
    PvlKeyword minAxis("MinorAxisPoints", toString(p_minorAxisPts));

    pluginInfo.addKeyword(name);
    pluginInfo.addKeyword(minThickness);
    pluginInfo.addKeyword(minArea);
    pluginInfo.addKeyword(majAxis);
    pluginInfo.addKeyword(minAxis);

    return pluginInfo;
  }