本文整理汇总了C++中GEOSGeomFromWKT函数的典型用法代码示例。如果您正苦于以下问题:C++ GEOSGeomFromWKT函数的具体用法?C++ GEOSGeomFromWKT怎么用?C++ GEOSGeomFromWKT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GEOSGeomFromWKT函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GEOSGeomFromWKT
void object::test<8>()
{
geom1_ = GEOSGeomFromWKT("MULTILINESTRING((0 0, 10 0),(10 0, 10 10))");
geom2_ = GEOSGeomFromWKT("LINESTRING(10 0, 10 -10)");
pat_ = GEOSRelateBoundaryNodeRule(geom1_, geom2_, 5);
ensure(0 == pat_);
}
开发者ID:BlueEyes-Lin,项目名称:sunmap,代码行数:7,代码来源:GEOSRelateBoundaryNodeRuleTest.cpp
示例2: initGEOS
void object::test<2>
()
{
numcalls = 0;
initGEOS(notice, notice);
GEOS_interruptRegisterCallback(countCalls);
ensure_equals(numcalls, 0);
GEOSGeometry* geom1 = GEOSGeomFromWKT("LINESTRING(0 0, 1 1, 2 2, 4 4)");
GEOSGeometry* geom2 = GEOSGeomFromWKT("LINESTRING(0 0, 1 1.01, 4 4.001)");
ensure("GEOSGeomFromWKT failed", nullptr != geom1);
GEOSGeometry* geom3 = GEOSSnap(geom1, geom2, 0.1);
ensure("GEOSSnap failed", nullptr != geom3);
ensure("interrupt callback never called", numcalls > 0);
GEOSGeom_destroy(geom1);
GEOSGeom_destroy(geom2);
GEOSGeom_destroy(geom3);
GEOS_interruptRegisterCallback(nullptr); /* unregister */
finishGEOS();
}
开发者ID:libgeos,项目名称:libgeos,代码行数:30,代码来源:GEOSInterruptTest.cpp
示例3: GEOSGeomFromWKT
void object::test<1>()
{
geom1_ = GEOSGeomFromWKT("POINT(10 10)");
geom2_ = GEOSGeomFromWKT("POINT(3 6)");
double dist;
int ret = GEOSDistance(geom1_, geom2_, &dist);
ensure_equals(ret, 1);
ensure_distance(dist, 8.06225774829855, 1e-12);
}
开发者ID:mwtoews,项目名称:libgeos,代码行数:11,代码来源:GEOSDistanceTest.cpp
示例4: GEOSGeomFromWKT
void object::test<1>()
{
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
ensure( 0 != geom1_ );
ensure( 0 != geom2_ );
GEOSCoordSequence *coords_;
coords_ = GEOSNearestPoints(geom1_, geom2_);
ensure( 0 == coords_ );
}
开发者ID:BlueEyes-Lin,项目名称:sunmap,代码行数:13,代码来源:GEOSNearestPointsTest.cpp
示例5: GEOSGeomFromWKT
void object::test<4>
()
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 10)");
geom2_ = GEOSGeomFromWKT("LINESTRING(0 10, 10 0)");
prepGeom1_ = GEOSPrepare(geom1_);
ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedIntersects(prepGeom1_, geom2_);
ensure_equals(ret, 1);
}
开发者ID:libgeos,项目名称:libgeos,代码行数:13,代码来源:GEOSPreparedGeometryTest.cpp
示例6: GEOSGeomFromWKT
void object::test<1>()
{
input_ = GEOSGeomFromWKT("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
ensure( 0 != input_ );
expected_ = GEOSGeomFromWKT("LINESTRING (130 240, 650 240, 130 240)");
ensure( 0 != expected_ );
GEOSGeometry* output = GEOSConvexHull(input_);
ensure( 0 != output );
ensure( 0 == GEOSisEmpty(output) );
// TODO
//ensure( 0 != GEOSEquals(output, expected_));
}
开发者ID:TesseractG,项目名称:node-spatialite,代码行数:14,代码来源:GEOSConvexHullTest.cpp
示例7: wkt0
void object::test<7>()
{
std::string wkt0("LINESTRING ("
"665.7317504882812500 133.0762634277343700,"
"1774.4752197265625000 19.9391822814941410,"
"756.2413940429687500 466.8306579589843700,"
"626.1337890625000000 1898.0147705078125000,"
"433.8007202148437500 404.6052856445312500)");
geom1_ = GEOSGeomFromWKT(wkt0.c_str());
ensure( 0 != geom1_ );
double width = 57.164000837203;
// left-sided
{
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_MITRE, 5.57);
ensure( 0 != geom2_ );
// likely, 5 >= 5
ensure(GEOSGeomGetNumPoints(geom2_) >= GEOSGeomGetNumPoints(geom1_));
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
//ensure_equals(std::string(wkt_), ...);
}
// right-sided
{
width = -width;
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_MITRE, 5.57);
ensure( 0 != geom2_ );
// likely, 5 >= 7
ensure(GEOSGeomGetNumPoints(geom2_) >= GEOSGeomGetNumPoints(geom1_));
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
//ensure_equals(std::string(wkt_), ...);
}
}
开发者ID:BlueEyes-Lin,项目名称:sunmap,代码行数:35,代码来源:GEOSOffsetCurveTest.cpp
示例8: GEOSGeomFromWKT
/// Polygon fully within rectangle
template<> template<> void object::test<12>()
{
const char *wkt = "POLYGON((1 1, 1 30, 30 30, 30 1, 1 1),(10 10, 20 10, 20 20, 10 20, 10 10))";
geom1_ = GEOSGeomFromWKT(wkt);
geom2_ = GEOSClipByRect(geom1_, 0, 0, 40, 40);
isEqual(geom2_, wkt);
}
开发者ID:MarkusMattinen,项目名称:libspatialite,代码行数:8,代码来源:GEOSClipByRectTest.cpp
示例9: GEOSGeomFromWKT
void object::test<3>()
{
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((1 1,1 2,2 2,2 1,1 1))");
ensure( nullptr != geom1_ );
ensure( nullptr != geom2_ );
char const r1 = GEOSWithin(geom1_, geom2_);
ensure_equals(int(r1), 0);
char const r2 = GEOSWithin(geom2_, geom1_);
ensure_equals(int(r2), 1);
}
开发者ID:mwtoews,项目名称:libgeos,代码行数:16,代码来源:GEOSWithinTest.cpp
示例10: GEOSGeomFromWKT
void object::test<1>()
{
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
ensure( 0 != geom1_ );
ensure( 0 != geom2_ );
char const r1 = GEOSIntersects(geom1_, geom2_);
ensure_equals(r1, 0);
char const r2 = GEOSIntersects(geom2_, geom1_);
ensure_equals(r2, 0);
}
开发者ID:AvlWx2014,项目名称:basemap,代码行数:16,代码来源:GEOSIntersectsTest.cpp
示例11: GEOSGeomFromWKT
void object::test<1>()
{
const int size = 2;
GEOSGeometry* geoms[size] = { 0 };
geoms[0] = GEOSGeomFromWKT("LINESTRING(1 3, 3 3, 3 1, 1 1, 1 3)");
geoms[1] = GEOSGeomFromWKT("LINESTRING(1 3, 3 3, 3 1, 1 1, 1 3)");
GEOSGeometry* g = GEOSPolygonizer_getCutEdges(geoms, size);
ensure(0 != g);
ensure_equals(GEOSGetNumGeometries(g), size);
GEOSGeom_destroy(g);
GEOSGeom_destroy(geoms[0]);
GEOSGeom_destroy(geoms[1]);
}
开发者ID:neerajneeruz,项目名称:SPLiteDemo3,代码行数:17,代码来源:GEOSPolygonizer_getCutEdgesTest.cpp
示例12: GEOSGeomFromWKT
void object::test<1>()
{
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
ensure ( 0 != GEOSisEmpty(geom1_) );
geom2_ = GEOSSimplify(geom1_, 43.2);
ensure ( 0 != GEOSisEmpty(geom2_) );
}
开发者ID:dillongardner,项目名称:basemap,代码行数:10,代码来源:GEOSSimplifyTest.cpp
示例13: GEOSGeomFromWKT
void object::test<2>()
{
geom1_ = GEOSGeomFromWKT("POINT (6 3)");
ensure( 0 != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
ensure( 0 != geom2_ );
ensure_equals(toWKT(geom2_), std::string("POINT (6 3)"));
}
开发者ID:GunioRobot,项目名称:geos,代码行数:10,代码来源:GEOSUnaryUnionTest.cpp
示例14: GEOSGeomFromWKT
void object::test<1>()
{
GEOSGeometry* geom1 = GEOSGeomFromWKT("POLYGON EMPTY");
ensure ( 0 != GEOSisEmpty(geom1) );
GEOSGeometry* geom2 = GEOSSimplify(geom1, 43.2);
ensure ( 0 != GEOSisEmpty(geom2) );
}
开发者ID:asapnet,项目名称:geos,代码行数:10,代码来源:GEOSSimplifyTest.cpp
示例15: test_wkt
void test_wkt(std::string const& wkt)
{
geom1_ = GEOSGeomFromWKT(wkt.c_str());
ensure ( 0 != geom1_ );
char* wkt_c = GEOSGeomToWKT(geom1_);
std::string out(wkt_c);
free(wkt_c);
ensure_equals(out, wkt);
}
开发者ID:AvlWx2014,项目名称:basemap,代码行数:11,代码来源:GEOSGeomToWKTTest.cpp
示例16: test_writer_wkt
void test_writer_wkt(GEOSWKTWriter *writer, std::string const& wkt)
{
geom1_ = GEOSGeomFromWKT(wkt.c_str());
ensure ( 0 != geom1_ );
char* wkt_c = GEOSWKTWriter_write(writer,geom1_);
std::string out(wkt_c);
free(wkt_c);
ensure_equals(out, wkt);
}
开发者ID:AvlWx2014,项目名称:basemap,代码行数:11,代码来源:GEOSGeomToWKTTest.cpp
注:本文中的GEOSGeomFromWKT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论