feat: simplify range-daymark to concentric triangles; preserve land cache
map.js — _encRangeDaymarkCanvas: Remove tripod legs, hub ring and mast. Symbol is now two clean concentric triangles pointing up: outer WHITE + inner BLACK, matching the standard IALA dayboard. Optional light flare at apex if the feature has LITCHR. No extra structures. chart_manager.py — _build_cache: Don't overwrite existing land/hazard/zone GeoJSON files with an empty result when the .000 has no LNDARE/OBSTRN/ZONBND layer. Preserves hand-built or legacy cache data for custom charts (e.g. Barranquilla built from nav-aids-only CSV). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -805,18 +805,27 @@ def _build_cache(cell_id: str, enc_path: Path):
|
||||
log.info("ENC %s → %d depth features", cell_id, len(depths))
|
||||
|
||||
land = _parse_land(enc_path)
|
||||
with open(cell_dir / "land.geojson", "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": land}, f)
|
||||
log.info("ENC %s → %d land features", cell_id, len(land))
|
||||
land_path = cell_dir / "land.geojson"
|
||||
# Preserve existing land cache when the .000 has no LNDARE layer
|
||||
# (e.g. custom charts built from CSV that only contain nav aids)
|
||||
if land or not land_path.exists():
|
||||
with open(land_path, "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": land}, f)
|
||||
log.info("ENC %s → %d land features%s", cell_id, len(land),
|
||||
" (preserved existing)" if not land and land_path.exists() else "")
|
||||
|
||||
hazards = _parse_hazards(enc_path)
|
||||
with open(cell_dir / "hazards.geojson", "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": hazards}, f)
|
||||
hazards_path = cell_dir / "hazards.geojson"
|
||||
if hazards or not hazards_path.exists():
|
||||
with open(hazards_path, "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": hazards}, f)
|
||||
log.info("ENC %s → %d hazard features", cell_id, len(hazards))
|
||||
|
||||
zones = _parse_zones(enc_path)
|
||||
with open(cell_dir / "zones.geojson", "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": zones}, f)
|
||||
zones_path = cell_dir / "zones.geojson"
|
||||
if zones or not zones_path.exists():
|
||||
with open(zones_path, "w") as f:
|
||||
json.dump({"type": "FeatureCollection", "features": zones}, f)
|
||||
log.info("ENC %s → %d zone features", cell_id, len(zones))
|
||||
|
||||
# Cache count and bbox in meta.json so list_cells() doesn't need to read features.geojson
|
||||
|
||||
Reference in New Issue
Block a user