本文整理汇总了C++中CoordArrayPtr::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CoordArrayPtr::getSize方法的具体用法?C++ CoordArrayPtr::getSize怎么用?C++ CoordArrayPtr::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoordArrayPtr
的用法示例。
在下文中一共展示了CoordArrayPtr::getSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: coord
void object::test<22>()
{
using geos::geom::Coordinate;
// Buffer for geometries
std::vector<GeometryPtr>* vec = new std::vector<GeometryPtr>();
// Add single point
Coordinate coord(x_, y_, z_);
GeometryPtr point = factory_.createPoint(coord);
ensure( point != 0 );
vec->push_back(point);
// Add single LineString
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(3);
ensure( coords != 0 );
coords->setAt(Coordinate(0, 0), 0);
coords->setAt(Coordinate(5, 5), 1);
coords->setAt(Coordinate(10, 5), 2);
ensure_equals( coords->getSize(), 3u );
GeometryPtr line = factory_.createLineString(coords);
vec->push_back(line);
// Create geometry collection
GeometryColPtr col = factory_.createGeometryCollection(vec);
ensure( coords != 0 );
ensure_equals( col->getGeometryTypeId(), geos::geom::GEOS_GEOMETRYCOLLECTION );
ensure_equals( col->getNumGeometries(), 2u );
// FREE MEMORY
factory_.destroyGeometry(col);
}
示例2:
void object::test<16>()
{
const std::size_t size = 5;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
ensure( coords != 0 );
ensure_equals( coords->getSize(), size );
LineStringPtr line = factory_.createLineString(coords);
ensure( "createLineString() returned null pointer.", line != 0 );
ensure( "createLineString() returned empty point.", !line->isEmpty() );
ensure( line->isSimple() );
ensure( line->getCoordinate() != 0 );
// TODO - mloskot - is this correct?
//ensure( line->isValid() );
ensure_equals( line->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
ensure_equals( line->getDimension(), geos::geom::Dimension::L );
ensure_equals( line->getBoundaryDimension(), geos::geom::Dimension::False );
ensure_equals( line->getNumPoints(), size );
ensure_equals( line->getLength(), 0.0 );
ensure_equals( line->getArea(), 0.0 );
// FREE MEMORY
factory_.destroyGeometry(line);
}