1.点
geos::geom::Coordinate vertex(vertex_infos.at(i).x, vertex_infos.at(i).y, vertex_infos.at(i).z);
std::unique_ptr<geos::geom::Point> vertex_geom(geos::geom::GeometryFactory::getDefaultInstance()->createPoint(vertex));
多个点
std::vector<geos::geom::Coordinate> multi_point_coords;
std::unique_ptr<geos::geom::MultiPoint> trajectory_multi_point(geos::geom::GeometryFactory::getDefaultInstance()->createMultiPoint(std::move(multi_point_coords)));
2.线 和 线段
std::unique_ptr<geos::geom::CoordinateArraySequence> linestring_coordArray = std::make_unique<geos::geom::CoordinateArraySequence>();
linestring_coordArray->add(c1);
linestring_coordArray->add(c2);
std::unique_ptr<geos::geom::LineString> line_string = geos::geom::GeometryFactory::getDefaultInstance()->createLineString(std::move(linestring_coordArray));
geos::geom::LineSegment line_seg(c1, c2); // geos::geom::Coordinate
std::vector<geos::geom::Coordinate> coordinates;
auto coordinates_copy = coordinates;
auto coordinate_seq = geos::geom::CoordinateArraySequenceFactory::instance()->create(std::move(coordinates_copy));
auto line_string = geos::geom::GeometryFactory::getDefaultInstance()->createLineString(std::move(coordinate_seq));
auto buffer_geom = line_string->buffer(15);
auto searchEnv = buffer_geom->getEnvelopeInternal();
std::vector<void *> matched_vertex_infos;
quad_tree.query(searchEnv, matched_vertex_infos);
geos::geom::LineSegment line_seg(coordinates[i], coordinates[i + 1]);
3.根据四个点创建面
geos::geom::GeometryFactory::Ptr factory = geos::geom::GeometryFactory::create();
std::unique_ptr<geos::geom::CoordinateArraySequence> coordinates = std::make_unique<geos::geom::CoordinateArraySequence>();
geos::geom::Coordinate begPoint(FirstlineGeometry.at(i - 1).x_, FirstlineGeometry.at(i - 1).y_, FirstlineGeometry.at(i - 1).z_);
geos::geom::Coordinate endPoint(FirstlineGeometry.at(i).x_, FirstlineGeometry.at(i).y_, FirstlineGeometry.at(i).z_);
coordinates->add(begPoint);
coordinates->add(endPoint);
coordinates->add(endProjInfo._projectPoint);
coordinates->add(begProjInfo._projectPoint);
coordinates->add(begPoint);
std::unique_ptr<geos::geom::LinearRing> ring = factory->createLinearRing(std::move(coordinates));
std::unique_ptr<geos::geom::Polygon> cross_section_polygon = factory->createPolygon(std::move(ring));