[AZ-375] [AZ-377] HashSet tile lookup + consolidate Earth constants
ci/woodpecker/push/01-test Pipeline was successful
ci/woodpecker/push/02-build-push Pipeline was successful

Batch 24 of 03-code-quality-refactoring run; closes the run.

AZ-375 (C22): GoogleMapsDownloaderV2.DownloadTilesGridAsync now
builds a HashSet<(int X, int Y, int Z)> once from existingTiles
and tests Contains((x, y, zoomLevel)) per cell. Removes the per-cell
FirstOrDefault tolerance scan and the unused _processingConfig
.LatLonTolerance reference at this site.

AZ-377 (C24): promote Earth + tile-pixel constants to a single
home. GeoUtils now exposes EarthRadiusMeters, EarthEquatorial
CircumferenceMeters, MetersPerDegreeLatitude as public const.
MapConfig adds DefaultTileSizePixels (const) wired as the
TileSizePixels property default. TileRepository and Google
MapsDownloaderV2 read those constants instead of duplicating
the literals 6378137, 40075016.686, 111000.0, and 256.

Tests: +6 new (DownloaderRefactorTests, extended GeoUtils
RefactorTests). 200/200 unit tests pass.

Cumulative K=3 review (batches 22-24): PASS_WITH_WARNINGS,
4 Low findings only — see
_docs/03_implementation/reviews/cumulative_review_22-24.md.

Tooling fix: scripts/run-tests.sh --unit-only path now restores
before testing (was failing on SixLabors resolution in clean
container). Stripped stray BOM from MapConfig.cs to satisfy the
.editorconfig charset gate.

Updates _dependencies_table.md to reflect all 27 03-code-quality-
refactoring tasks done; updates _autodev_state.md to refactor
phase 5 (test-sync).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 05:14:51 +03:00
parent 6099d1c86b
commit 9a53bff92e
13 changed files with 456 additions and 48 deletions
+17 -17
View File
@@ -38,24 +38,24 @@ Roadmap: `_docs/04_refactoring/03-code-quality-refactoring/analysis/refactoring_
| AZ-353 | C03 | Sanitize 5xx responses via IExceptionHandler | 1 | — | 3 | Done (In Testing) |
| AZ-359 | C07 | Consolidate RegionService catch ladder | 2 | — | 3 | Done (In Testing) |
| AZ-357 | C06 | Drop tile Version concept; new migration | 2 | — | 5 | Done (In Testing) |
| AZ-362 | C09 | Idempotent POST contract | 2 | AZ-353 | 3 | To Do |
| AZ-366 | C13 | Consolidate Haversine + filename parser | 3 | — | 2 | To Do |
| AZ-377 | C24 | Consolidate Earth constants + 111000 | 3 | AZ-371 | 2 | To Do |
| AZ-368 | C15 | Shared TileCsvWriter | 3 | — | 2 | To Do |
| AZ-367 | C14 | Shared TileGridStitcher | 3 | AZ-364 | 3 | To Do |
| AZ-362 | C09 | Idempotent POST contract | 2 | AZ-353 | 3 | Done (In Testing) |
| AZ-366 | C13 | Consolidate Haversine + filename parser | 3 | — | 2 | Done (In Testing) |
| AZ-377 | C24 | Consolidate Earth constants + 111000 | 3 | AZ-371 | 2 | Done (In Testing) |
| AZ-368 | C15 | Shared TileCsvWriter | 3 | — | 2 | Done (In Testing) |
| AZ-367 | C14 | Shared TileGridStitcher | 3 | AZ-364 | 3 | Done (In Testing) |
| AZ-369 | C16 | Move inline DTOs out of Program.cs | 3 | — | 2 | Done (In Testing) |
| AZ-365 | C12 | Decompose RouteService.CreateRouteAsync | 3 | — | 5 | To Do |
| AZ-364 | C11 | Decompose RouteProcessingService god-class | 3 | AZ-366, AZ-367 (folds in AZ-360) | 5 | To Do |
| AZ-360 | C08 | Replace IServiceProvider in RouteProcessingService | 3 | AZ-364 (folded) | 2 | To Do |
| AZ-371 | C18 | Magic numbers → ProcessingConfig/MapConfig | 4 | — | 3 | To Do |
| AZ-370 | C17 | Status / point-type enums + AC RT2 update | 4 | — | 3 | To Do |
| AZ-373 | C20 | Clarify / drop MapsVersion | 4 | AZ-357 | 2 | To Do |
| AZ-374 | C21 | Typed HttpClient for Google Maps | 4 | — | 2 | To Do |
| AZ-375 | C22 | O(N) existing-tile lookup (HashSet) | 4 | AZ-371 | 2 | To Do |
| AZ-376 | C23 | Delete unused FindExistingTileAsync | 4 | — | 1 | To Do |
| AZ-378 | C25 | Repo `_logger` fields: delete or use | 4 | — | 1 | To Do |
| AZ-379 | C26 | Extract repo SELECT column-list constants | 4 | — | 2 | To Do |
| AZ-380 | C27 | Delete CalculatePolygonDiagonalDistance | 4 | — | 1 | To Do |
| AZ-365 | C12 | Decompose RouteService.CreateRouteAsync | 3 | — | 5 | Done (In Testing) |
| AZ-364 | C11 | Decompose RouteProcessingService god-class | 3 | AZ-366, AZ-367 (folds in AZ-360) | 5 | Done (In Testing) |
| AZ-360 | C08 | Replace IServiceProvider in RouteProcessingService | 3 | AZ-364 (folded) | 2 | Done (In Testing) |
| AZ-371 | C18 | Magic numbers → ProcessingConfig/MapConfig | 4 | — | 3 | Done (In Testing) |
| AZ-370 | C17 | Status / point-type enums + AC RT2 update | 4 | — | 3 | Done (In Testing) |
| AZ-373 | C20 | Clarify / drop MapsVersion | 4 | AZ-357 | 2 | Done (In Testing) |
| AZ-374 | C21 | Typed HttpClient for Google Maps | 4 | — | 2 | Done (In Testing) |
| AZ-375 | C22 | O(N) existing-tile lookup (HashSet) | 4 | AZ-371 | 2 | Done (In Testing) |
| AZ-376 | C23 | Delete unused FindExistingTileAsync | 4 | — | 1 | Done (In Testing) |
| AZ-378 | C25 | Repo `_logger` fields: delete or use | 4 | — | 1 | Done (In Testing) |
| AZ-379 | C26 | Extract repo SELECT column-list constants | 4 | — | 2 | Done (In Testing) |
| AZ-380 | C27 | Delete CalculatePolygonDiagonalDistance | 4 | — | 1 | Done (In Testing) |
| AZ-372 | C19 | dotnet format + NetAnalyzers + Coverlet | 4 | — | 3 | Done (In Testing) |
## Execution Order