현재 C++ GEOS API를 사용하여 vector
(typedef Points
)의 x 및 y 멤버 변수를 반복합니다.GEOS C++ geos :: Geometry 버퍼 (0) 거짓 어설 션 on convexHull
geos::geom::Geometry
개체를 만들고 자기 교차로를 방지하기 위해 0으로 버퍼링 한 다음 볼록 헐을 작성하여이 벡터를 convexHull로 바꿉니다.
이미 convexHull 인 객체를 보낼 때마다 Assertion 'precisionModel' failed
이라는 어설 션을 얻습니다.
GEOS 버그입니까? 볼록 다각형을 버퍼링하지 않도록주의해야합니까?
geo_algos_test2 : /tmp/libgeos/src/operation/buffer/BufferBuilder.cpp:373 : 지오스 :: 기하 형상 :: * 지오스 :: 동작 :: :: BufferBuilder 완충액 : 완충액 (CONST 지오스 :: 기하 구조 : 형상 *), 이중 : 어설`precisionModel은 '실패 * 여기
내 코드입니다.
// Remove self intersections or collinear points
geos::geom::GeometryFactory factory;
geos::geom::CoordinateSequence* temp =
factory.getCoordinateSequenceFactory()->create((std::size_t)0, 0);
// Convert vector of cruise points to GEOS
for (auto point : poly) {
temp->add(geos::geom::Coordinate(point.x, point.y));
}
// Add beggining point to create linear ring
temp->add(geos::geom::Coordinate(poly.begin()->x, poly.begin()->y));
// Create Linear Ring For Constructor
geos::geom::LinearRing* box = factory.createLinearRing(temp);
// Factory returns a pointer, dereference this
geos::geom::Geometry* GEOSPoly = factory.createPolygon(box, NULL);
// Remove Self Intersections and create Hull
return GEOSPoly->buffer(0); //line that causes assertion
어설 션은 세그먼트 화 오류가 아닙니다. 어설 션은 진행하기 전에 어떤 조건이 충족되었는지 확인하기 위해 코드에 삽입 된 검사이며 검사에 실패했습니다. – PaulMcKenzie
미안, 나는 단언을 의미했다. 내부 라이브러리의 실패한 검사 – DaynaJuliana