本文整理汇总了C++中geos::geom::GeometryFactory::createPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryFactory::createPoint方法的具体用法?C++ GeometryFactory::createPoint怎么用?C++ GeometryFactory::createPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geos::geom::GeometryFactory
的用法示例。
在下文中一共展示了GeometryFactory::createPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_point
point_type make_point(const osmium::geom::Coordinates& xy) const {
try {
return point_type{m_geos_factory->createPoint(geos::geom::Coordinate{xy.x, xy.y})};
} catch (const geos::util::GEOSException& e) {
THROW(osmium::geos_geometry_error(e.what()));
}
}
示例2: make_point
point_type make_point(const osmium::geom::Coordinates& xy) const {
try {
return point_type(m_geos_factory.createPoint(geos::geom::Coordinate(xy.x, xy.y)));
} catch (geos::util::GEOSException&) {
THROW(osmium::geos_geometry_error());
}
}
示例3: create_discs
void create_discs(geos::geom::GeometryFactory& gf, int num, double radius,
std::vector<geos::geom::Polygon*>* g)
{
for (int i = 0; i < num; ++i) {
for (int j = 0; j < num; ++j) {
std::auto_ptr<geos::geom::Point> pt(
gf.createPoint(geos::geom::Coordinate(i, j)));
g->push_back(dynamic_cast<geos::geom::Polygon*>(pt->buffer(radius)));
}
}
}
示例4: pg
bool
pointsWithinDistance(vector<Coordinate>& coords, double dist)
{
// we expect some numerical instability here
// OffsetPointGenerator could produce points
// at *slightly* farther locations then
// requested
//
dist *= 1.0000001;
for (size_t i=0, n=coords.size(); i<n; ++i)
{
const Coordinate& c = coords[i];
auto_ptr<Geometry> pg(gf.createPoint(c));
double rdist = g->distance(pg.get());
if ( rdist > dist )
{
return false;
}
}
return true;
}