feat: add native center line style overrides

This commit is contained in:
2026-08-17 13:29:54 +08:00
parent 8bfc02e66e
commit 47efb78f1e
15 changed files with 313 additions and 13 deletions

View File

@@ -200,7 +200,10 @@ MATERIALS = {
"traffic_signal_active_green": {"kind": "solid", "name": "Traffic Signal Active Green",
"color": (0.04, 0.82, 0.22), "roughness": 0.25,
"cesium": {"base_color": (0.04, 0.82, 0.22),
"emission": ((0.04, 0.82, 0.22), 1.0)}},
"emission": ((0.04, 0.82, 0.22), 1.0)}},
"native_center_line_white": {"kind": "solid", "name": "Native Center Line White",
"color": (0.95, 0.94, 0.82), "roughness": 0.52,
"cesium": {"base_color": (0.95, 0.94, 0.82)}},
}

View File

@@ -7,7 +7,8 @@ from osmassets.geom import clip_polygon, feature_in_bounds, geometry_rings
from osmassets.mesh import MeshBatch, add_polyline
def assemble_geojson_layer(path, layer_id, projector, collection, material, z):
def assemble_geojson_layer(path, layer_id, projector, collection, material, z,
property_filter=None):
if not os.path.exists(path):
return 0
with open(path, "r", encoding="utf-8") as handle:
@@ -18,6 +19,8 @@ def assemble_geojson_layer(path, layer_id, projector, collection, material, z):
xmax, ymax = projector.xy((b["max_lon"], b["max_lat"]))
count = 0
for feature in data.get("features", []):
if property_filter and not property_filter(feature.get("properties", {})):
continue
if not feature_in_bounds(feature, projector):
continue
for ring in geometry_rings(feature.get("geometry")):