fix: match Cesium intersection asphalt

This commit is contained in:
2026-08-05 11:54:26 +08:00
parent 15a8429af9
commit 400525dd07
2 changed files with 12 additions and 1 deletions

View File

@@ -30,12 +30,23 @@ from osmassets.geom import (
sample_tree_row,
signed_polygon_area,
)
from osmassets.catalog import ROAD_LAYERS
from osmassets.osm import Projector, parse_height, parse_osm, tags
SQUARE = [(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)]
class RoadLayerCatalogTest(unittest.TestCase):
def test_intersection_and_road_asphalt_share_the_same_colour(self):
layers = {layer["id"]: layer for layer in ROAD_LAYERS}
self.assertEqual(layers["road_surface"]["color"],
layers["intersection_surface"]["color"])
# They remain distinct meshes so the intersection stays above the road.
self.assertNotEqual(layers["road_surface"]["z"],
layers["intersection_surface"]["z"])
class GeometryRingsTest(unittest.TestCase):
def test_polygon_keeps_only_the_exterior_ring(self):
geometry = {"type": "Polygon", "coordinates": [["outer"], ["hole"]]}