- Sites → Maps in the sidebar replaces the per-site Site map / Map 2 links. The Maps page shows each site's model as a plan preview (built sections solid) with % of road layerworks built and links to Site map and Map 2. - Double-clicking a road section opens its progress tick-boxes over the map (Site map saves to the server; Map 2 stays a local scenario). - Cedar Gate: 40 drawn cross-sections extracted from C3277-912-001 Rev A (extract_cedar_gate_xs.py), cut/fill limited to Cedar Gate Road, a Cut & fill workspace in Map 2 with a chainage chart, and pavement layers shown in their material colours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| alignment.py | ||
| dxf_reader.py | ||
| extract_bushveld.py | ||
| extract_cedar_gate.py | ||
| extract_cedar_gate_xs.py | ||
| extract_extras.py | ||
| extract_surface.py | ||
| extract_xs.py | ||
| model_keys.py | ||
| README.md | ||
| test_alignment.py | ||
| test_model_keys.py | ||
| test_upload.py | ||
| upload.py | ||
Site model pipeline (Phase 1, run by hand)
Turns a consultant's drawings into the five JSON files the Site map page loads
(bushveld.json, services.json, earthworks.json, schedules.json, surface.json).
Specific to Civil Concepts' layer names on Bushveld Joy Road (C3092); other drawing sets
need the layer maps at the top of each script adjusted.
Tools
- LibreDWG (
brew install libredwg) →dwg2dxf - poppler (
brew install poppler) →pdftotext,pdftocairo - Python 3 with numpy
Build (Bushveld Joy example)
- Convert DWGs:
dwg2dxf -y -o out.dxf in.dwg(road layout M910-001, signs & markings M910-002, studs M910-005, stormwater LS M921-001). - Run in this order, all writing into one output folder
OUT:
(python3 -I extract_bushveld.py <road-layout.dxf> "<SO DATA folder>" OUT/bushveld.json python3 -I extract_extras.py <drawings folder> <converted DXF folder> OUT python3 -I extract_surface.py <road-layout.dxf> OUT python3 -I extract_xs.py <cross-section.pdf> <road-layout.dxf> OUTextract_xs.pyvalidates againstsurface.json, so run it last.) - Upload:
python3 upload.py --site <site id> --label "<text>" [--dry-run] OUT.
Checks printed by the scripts
- extract_bushveld: areas per work type and the 20 m chainage sections.
- extract_surface: contour-only surface vs peg levels (median / 90th percentile).
- extract_xs: rebuilt alignment length vs the drawing (674.412 m for Bushveld Joy) and cross-section vs design-surface agreement.
- upload: progress keys recorded on the site that the new model no longer has.
Tests
python3 -m unittest discover -s scripts/site-model -p "test_*.py"
Cedar Gate (C3277 / Equestria Ext. 289)
The 2026-10-20 delivery contains two projects. Use the C3277 archive and
Cedar Gate Contours Chris.dwg; exclude the Nellmapius drawings.
- Convert the bound C3277-910-001 Rev A road layout, C3277-920to940 Rev B
services layout, and Chris ground-contour DWG to DXF with
dwg2dxf. - With Python packages
numpy scipy shapely>=2.1 ezdxfavailable, run:python3 scripts/site-model/extract_cedar_gate.py DXF_FOLDER OUTPUT_FOLDER - Check
validation.json, the source hashes insources.json, surface coverage, and the rendered model. The initial reviewed output is inreports/site-models/cedar-gate/2026-10-20. - Upload with the normal uploader using Cedar Gate site ID
u6n5fye4czinw6o.
The extractor checks all four alignment lengths against drawing labels, conserves hatch areas in disjoint 20 m planning sections, measures single kerb lines once, and keeps surveyed ground separate from the finished-level surface. Service routes are plan overlays without inferred inverts, pipe sizes or trench volumes. External lower pavement layers, earthwork volumes and setting-out pegs are deliberately unquantified pending reconciliation with the relevant source data.