本文整理汇总了C++中PointPtr::getCoordinate方法的典型用法代码示例。如果您正苦于以下问题:C++ PointPtr::getCoordinate方法的具体用法?C++ PointPtr::getCoordinate怎么用?C++ PointPtr::getCoordinate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointPtr
的用法示例。
在下文中一共展示了PointPtr::getCoordinate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: coord
void object::test<10>()
{
geos::geom::Coordinate coord(x_, y_, z_);
CoordArrayPtr sequence = new geos::geom::CoordinateArraySequence();
ensure( "sequence is null pointer.", sequence != 0 );
sequence->add(coord);
PointPtr pt = factory_.createPoint(sequence);
ensure( "createPoint() returned null pointer.", pt != 0 );
ensure( "createPoint() returned empty point.", !pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
ensure( pt->getCoordinate() != 0 );
CoordinateCPtr pcoord = pt->getCoordinate();
ensure( pcoord != 0 );
ensure_equals( pcoord->x, x_ );
ensure_equals( pcoord->y, y_ );
ensure_equals( pcoord->z, z_ );
GeometryPtr geo = 0;
geo = pt->getEnvelope();
ensure( geo != 0 );
ensure( !geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = pt->getCentroid();
ensure( geo != 0 );
ensure( !geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = pt->getBoundary();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = pt->convexHull();
ensure( geo != 0 );
ensure( !geo->isEmpty() );
factory_.destroyGeometry(geo);
ensure_equals( pt->getGeometryTypeId(), geos::geom::GEOS_POINT );
ensure_equals( pt->getDimension(), geos::geom::Dimension::P );
ensure_equals( pt->getBoundaryDimension(), geos::geom::Dimension::False );
ensure_equals( pt->getNumPoints(), 1u );
ensure_equals( pt->getLength(), 0.0 );
ensure_equals( pt->getArea(), 0.0 );
// FREE MEMORY
factory_.destroyGeometry(pt);
}
示例2: pointCentr
void object::test<38>()
{
// First centroid
PointPtr point = poly_->getCentroid();
ensure( point != nullptr );
ensure( !point->isEmpty() );
ensure_equals( point->getGeometryTypeId(), geos::geom::GEOS_POINT );
CoordinateCPtr pointCoord = point->getCoordinate();
ensure( pointCoord != nullptr );
geos::geom::Coordinate pointCentr(*pointCoord);
// FREE MEMORY
factory_->destroyGeometry(point);
// Second centroid
geos::geom::Coordinate coordCentr;
bool isCentroid = poly_->getCentroid(coordCentr);
ensure( isCentroid );
// Comparison of two centroids
ensure_equals( "Check Polygon::getCentroid() functions.", coordCentr, pointCentr );
}
示例3:
void object::test<8>()
{
PointPtr pt = factory_.createPoint();
ensure( "createPoint() returned null pointer.", pt != 0 );
ensure( "createPoint() returned non-empty point.", pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
ensure( pt->getCentroid() == 0 );
ensure( pt->getCoordinate() == 0 );
GeometryPtr geo = 0;
geo = pt->getEnvelope();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = pt->getBoundary();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
geo = pt->convexHull();
ensure( geo != 0 );
ensure( geo->isEmpty() );
factory_.destroyGeometry(geo);
ensure_equals( pt->getGeometryTypeId(), geos::geom::GEOS_POINT );
ensure_equals( pt->getDimension(), geos::geom::Dimension::P );
ensure_equals( pt->getBoundaryDimension(), geos::geom::Dimension::False );
ensure_equals( pt->getNumPoints(), 0u );
ensure_equals( pt->getLength(), 0.0 );
ensure_equals( pt->getArea(), 0.0 );
// FREE MEMORY
factory_.destroyGeometry(pt);
}