本文整理汇总了C++中LineStringPtr::getEnvelope方法的典型用法代码示例。如果您正苦于以下问题:C++ LineStringPtr::getEnvelope方法的具体用法?C++ LineStringPtr::getEnvelope怎么用?C++ LineStringPtr::getEnvelope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineStringPtr
的用法示例。
在下文中一共展示了LineStringPtr::getEnvelope方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void object::test<16>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
ensure( geo != 0 );
LineStringPtr line = dynamic_cast<LineStringPtr>(geo);
ensure(line != 0);
GeometryPtr envelope = line->getEnvelope();
ensure( envelope != 0 );
ensure( !envelope->isEmpty() );
ensure_equals( envelope->getDimension(), geos::geom::Dimension::A );
factory_.destroyGeometry(envelope);
// FREE TESTED LINESTRING
factory_.destroyGeometry(line);
}
示例2:
void object::test<15>()
{
LineStringPtr line = factory_.createLineString();
ensure( "createLineString() returned null pointer.", line != 0 );
ensure( "createLineString() returned non-empty point.", line->isEmpty() );
ensure( line->isSimple() );
ensure( line->isValid() );
ensure( line->getCentroid() == 0 );
// TODO - mloskot - waiting for some decision
// http://geos.refractions.net/pipermail/geos-devel/2006-March/002006.html
//ensure( line->getCoordinate() == 0 );
GeometryPtr geo = 0;
geo = line->getEnvelope();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = line->getBoundary();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = line->convexHull();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
ensure_equals( line->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
ensure_equals( line->getDimension(), geos::geom::Dimension::L );
ensure_equals( line->getBoundaryDimension(), geos::geom::Dimension::P ); // empty linestring
ensure_equals( line->getNumPoints(), 0u );
ensure_equals( line->getLength(), 0.0 );
ensure_equals( line->getArea(), 0.0 );
// FREE MEMORY
factory_.destroyGeometry(line);
}