Ejemplo n.º 1
0
/* private */
auto_ptr<Geometry>
GeometryPrecisionReducer::fixPolygonalTopology(const geom::Geometry& geom )
{
  /**
   * If precision model was *not* changed, need to flip
   * geometry to targetPM, buffer in that model, then flip back
   */
  auto_ptr<Geometry> tmp;
  auto_ptr<GeometryFactory> tmpFactory;

  const Geometry* geomToBuffer = &geom;

  if ( ! newFactory ) {
    tmpFactory = createFactory(*geom.getFactory(), targetPM);
    tmp.reset( tmpFactory->createGeometry(&geom) );
    geomToBuffer = tmp.get();
  }

  auto_ptr<Geometry> bufGeom ( geomToBuffer->buffer(0) );

  if ( ! newFactory ) {
    // a slick way to copy the geometry with the original precision factory
    bufGeom.reset( geom.getFactory()->createGeometry(bufGeom.get()) );
  }

  return bufGeom;
}
Ejemplo n.º 2
0
/* public */
SharedPathsOp::SharedPathsOp(
    const geom::Geometry& g1, const geom::Geometry& g2)
  :
  _g1(g1),
  _g2(g2),
  _gf(*g1.getFactory())
{
  checkLinealInput(_g1);
  checkLinealInput(_g2);
}