Conversation
| std::size_t countWktCoordinates(std::string const& wkt) { | ||
| auto const open = wkt.find('('); | ||
| auto const close = wkt.rfind(')'); | ||
| if (open == std::string::npos || close == std::string::npos || close <= open) { |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #512 +/- ##
==========================================
+ Coverage 83.70% 83.80% +0.09%
==========================================
Files 55 55
Lines 8837 8859 +22
Branches 1057 1056 -1
==========================================
+ Hits 7397 7424 +27
+ Misses 1419 1414 -5
Partials 21 21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Moderate issues remain with Boost dependency propagation, public API compatibility, and malformed WKT parsing.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request replaces the custom geometry types and parsers with Boost.Geometry, updating consumers, tests, dependencies, CI, and documentation.
Changes:
- Adds Boost.Geometry-based
PointandPolyLinealiases with parsing and formatting helpers. - Updates geometry usage, tests, and distance calculations.
- Adds Boost requirements across builds, packaging, CI, and documentation.
File summaries
| File | Summary |
|---|---|
test/mdt/Test_PointsCluster.cpp |
Updates point comparisons. |
test/geometry/Test_PolyLine.cpp |
Tests Boost WKT parsing and formatting. |
test/geometry/Test_Point.cpp |
Tests parsing, formatting, and distance behavior. |
src/dsf/mobility/RoadNetwork.cpp |
Uses the new WKT parsing helpers. |
src/dsf/geometry/PolyLine.hpp |
Defines the Boost linestring alias and formatter. |
src/dsf/geometry/PolyLine.cpp |
Implements linestring parsing. |
src/dsf/geometry/Point.hpp |
Defines the Boost point alias and formatter. |
src/dsf/geometry/Point.cpp |
Implements point parsing and haversine distance. |
setup.py |
Adds Homebrew Boost discovery. |
README.md |
Documents Boost installation requirements. |
pyproject.toml |
Adds Boost to wheel build dependencies. |
CMakeLists.txt |
Locates and links Boost headers. |
.github/workflows/pytest.yml |
Adds Ubuntu Boost dependencies. |
.github/workflows/codeql.yml |
Adds Ubuntu Boost dependencies. |
.github/workflows/cmake_tests.yml |
Adds Boost across test platforms. |
.github/workflows/cmake_examples.yml |
Adds Boost across example platforms. |
.github/workflows/binding.yml |
Adds Boost across binding platforms. |
.github/workflows/benchmark_release.yml |
Adds Ubuntu Boost dependencies. |
.claude/README.md |
Adds repository agent guidance. |
.claude/data-formats.md |
Documents geometry data formats. |
.claude/conventions.md |
Documents repository conventions. |
.claude/build-and-test.md |
Documents build and test procedures. |
.claude/architecture.md |
Documents project architecture. |
.claude/api-reference.md |
Documents the public API. |
Review details
Suppressed comments (3)
src/dsf/geometry/Point.cpp:24
- When
cursoris on a nonnumeric character inside the parentheses,strtodscans the whole null-terminated WKT and can find a number afterbodyEnd; that number is then counted as an in-body coordinate. A malformed input with a missing coordinate and a trailing numeric token can therefore pass this guard while Boost has zero-filled the missing value. Reject parses wherenext > bodyEndbefore incrementing the count.
std::strtod(cursor, &next);
if (next == cursor) {
src/dsf/geometry/Point.hpp:25
- Replacing the class with an alias removes the public WKT constructor,
operator==, and structured-binding support that downstream C++ callers could use. The in-tree tests were rewritten around the new APIs, butDSF_VERSIONremains 7.1.0, so this is an unannounced source-breaking change; retain compatibility or explicitly version and document the break.
using Point = boost::geometry::model::d2::
point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::degree>>;
src/dsf/geometry/PolyLine.hpp:16
- Replacing
PolyLinewith this alias removes the publicPolyLine(std::string const&, std::string const&)constructor. Existing downstream calls no longer compile andpolyLineFromWktis not source-compatible; becauseDSF_VERSIONremains 7.1.0, this break should either be preserved through a compatibility API or explicitly versioned and documented.
using PolyLine = boost::geometry::model::linestring<Point>;
- Files reviewed: 24/24 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| # Link other libraries | ||
| target_link_libraries(dsf PUBLIC TBB::tbb SQLiteCpp | ||
| target_link_libraries(dsf PUBLIC TBB::tbb SQLiteCpp $<BUILD_INTERFACE:Boost::headers> |
| ### Requirements | ||
| The project requires `C++20` or greater, `cmake`, `tbb` `simdjson`, `spdlog`, `csv-parser` and `SQLiteCpp`. | ||
| The project requires `C++20` or greater, `cmake`, `tbb`, `boost` (headers only, for Boost.Geometry), `simdjson`, `spdlog`, `csv-parser` and `SQLiteCpp`. | ||
| `tbb` and `boost` must be installed system-wide; the remaining dependencies are fetched automatically at configure time. |
| - **`geometry::Point`** — immutable `(x, y)`, structured-binding enabled, parses WKT | ||
| `POINT (...)`; free function `haversine_km(p1, p2)` treats coordinates as (lon, lat). | ||
| **`geometry::PolyLine`** — `std::vector<Point>` subclass that parses WKT `LINESTRING (...)`. |
| C++20 compiler, CMake >= 3.16, and **TBB installed system-wide** (`libtbb-dev` on Debian/ | ||
| Ubuntu, `brew install tbb` on macOS, `vcpkg install tbb:x64-windows` on Windows). | ||
| Everything else — csv-parser 5.3.0, spdlog 1.17.0, simdjson 4.6.8, SQLiteCpp 3.3.3, | ||
| doctest 2.5.3, nanobind 2.15.0 — is pulled by `FetchContent` at configure time, so the | ||
| first configure needs network access and takes a while. |
No description provided.