feat: add native center line style overrides

This commit is contained in:
que01 committed 2026-08-17 13:29:54 +08:00
1 parent 8bfc02e66e
commit 47efb78f1e
15 files changed
+313 -13

No files matched your search

+4 -1
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")):