Example #1
0
QList<ControlPoint *> getValidPoints(Cube &cube, STRtree &coordTree) {
  ImagePolygon poly;
  try {
    cube.read(poly);
  }
  catch (IException &e) {
    QString msg = "Footprintinit must be run prior to running cnetadd";
    msg += " with POLYGON=TRUE for cube [" + cube.fileName() + "]";
    throw IException(e, IException::User, msg, _FILEINFO_);
  }

  std::vector<void *> matches;
  MultiPolygon *polys = poly.Polys();
  for (unsigned int i = 0; i < polys->getNumGeometries(); i++) {
    const Geometry *geometry = polys->getGeometryN(i);
    const Envelope *boundingBox = geometry->getEnvelopeInternal();

    coordTree.query(boundingBox, matches);
  }

  QList<ControlPoint *> results;
  for (unsigned int i = 0; i < matches.size(); i++) {
    results.append((ControlPoint *) matches[i]);
  }

  return results;
}
mapnik::geometry::multi_polygon<double>  geowave_featureset::create_multi_polygon(MultiPolygon multi_polygon)
{
    mapnik::geometry::multi_polygon<double> multi_polygon_out;
    for (int geom_idx = 0; geom_idx < multi_polygon.getNumGeometries(); ++geom_idx)
        multi_polygon_out.push_back(create_polygon(java_cast<Polygon>(multi_polygon.getGeometryN(geom_idx))));
    return multi_polygon_out;
}