@tileflow/maps 0.1.0-alpha.18 → 0.1.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,17 +84,17 @@ are `dawn`, `dusk`, `faded`, `monochrome`, `dawn-faded`, `dawn-monochrome`, `dus
84
84
  `dusk-monochrome`, `dark-faded`, and `dark-monochrome`. All twelve appearances share roads, label placement, fonts and icon artwork.
85
85
  Colors and lighting vary; flat-map colors are authored independently.
86
86
 
87
- Scene lighting is calibrated against Mapbox Standard. Streets owns its cartography: slate-blue
88
- roads with stronger regional outlines, neutral urban surfaces, pale warm rural ground, green
89
- parks and subtle cream buildings. Its palette is not a fixed copy of the provider's reference
90
- colors. All appearances use the daylight map's category-colored POI discs and pictograms.
91
- Maki pictograms distinguish transport modes and POI types. Scene-sun lighting preserves
92
- unshadowed roof paint while allowing light color to affect walls.
93
-
94
- The regional climate underlay is temporarily disabled while shared URL delivery is prepared;
95
- compiled styles omit its image source and raster layer. Themes use their authored land-cover
96
- palettes. Urban and education areas use neutral surfaces; farmland stays pale, while mapped orchards and nurseries remain
97
- green. Underground footprints flagged `hide_3d` are omitted from the flat building layers. Streets
87
+ Scene lighting is calibrated against Mapbox Standard while retaining Streets' slate-blue roads,
88
+ neutral urban surfaces, pale warm rural ground, green parks and cream buildings. All appearances
89
+ share category-colored POI discs and Maki pictograms. Lighting preserves sunlit roof paint and
90
+ tints walls. Daylight uses neutral direct light (0.2) and ambient fill (0.8); buildings and
91
+ map-shaded models keep ambient fill at night, with local occlusion at contacts and recesses.
92
+
93
+ Below zoom 11, daylight draws a climate image separating humid and dry regions; it is
94
+ loaded only there and is broad context, not surveyed vegetation. Other appearances keep it clear.
95
+ Urban and education areas use neutral surfaces; farmland stays pale, mapped orchards and nurseries
96
+ green. Activity areas tint the ground by activity until buildings take over. Footprints drawn
97
+ by building parts (`extrude: false`) are omitted from the flat building layers. Streets
98
98
  suspends duplicate flat building footprints in 3D so roads remain visible under open landmarks;
99
99
  2D mode restores ordinary footprints. Normal 3D buildings keep a small neutral/active tone difference. Authored models use
100
100
  the neutral building color and independently configurable window shading.
@@ -204,7 +204,7 @@ export default defineMap({
204
204
 
205
205
  POIs follow World ranks and category density, with extra detail for parks and transport.
206
206
  Generic airport POIs are limited to rank 0 to reduce misplaced business listings; the dedicated
207
- aerodrome layer continues to label mapped airports. This display policy does not repair source data.
207
+ airport label layer continues to label mapped airports. This display policy does not repair source data.
208
208
  Road-reference repetition is reduced at z11–13 and retains its detail interval from z14.
209
209
  Gardens stay at ranks 0–1 at every zoom, keeping principal destinations while omitting botanical
210
210
  collections and some small independent gardens. Other park and landmark types retain their usual
@@ -331,7 +331,7 @@ When the 3D view is active, available buildings and models appear at full height
331
331
  without zoom entrance animations.
332
332
  Pitch is capped at 38° through zoom 15; closer views use the application's maximum.
333
333
  Daylight combines warm limestone buildings, ivory model surfaces, smoked-blue glazing and warm
334
- roof tones under warm sunlight and cool skylight. Models share ordinary-building shading, with
334
+ roof tones under neutral sunlight and skylight. Models share ordinary-building shading, with
335
335
  soft contact shadows and ambient occlusion in recesses. Monochrome materials stay neutral.
336
336
  Glass parts can be recoloured independently through `modelColors.glass`; window roles retain
337
337
  that glass tint even on a shared stone part, with `modelLighting.window.colorScale: 0.96`.
@@ -1,7 +1,11 @@
1
- """Rebuild the embedded, historical climate colour image (requires Pillow and NumPy)."""
1
+ """Rebuild the shared climate colour image, streets-climate-v1.png (requires Pillow and NumPy).
2
+
3
+ Tileflow serves the PNG unchanged at an immutable URL named by its SHA-256; recipe.json records
4
+ that digest, and Streets reads the URL from src/official/streets-climate.ts.
5
+ """
2
6
  from pathlib import Path
3
7
  from PIL import Image, ImageFilter
4
- import hashlib, json, base64, io
8
+ import hashlib, json, io
5
9
  import numpy as np
6
10
  ROOT = Path(__file__).resolve().parent
7
11
  SOURCE = ROOT / 'koppen-geiger-1991-2020.tif'
@@ -37,11 +41,13 @@ projected = np.uint8(np.round(colour[low] * (1 - fraction[:, None, None]) +
37
41
  world = Image.fromarray(projected).resize((size, size), Image.Resampling.BILINEAR)
38
42
  buffer = io.BytesIO()
39
43
  world.save(buffer, format='PNG', optimize=True)
40
- uri = 'data:image/png;base64,' + base64.b64encode(buffer.getvalue()).decode()
41
- output = ROOT / '../../../src/official/streets-climate-image.ts'
42
- output.write_text('// Generated by assets/streets/climate/build.py. See its NOTICE.txt.\nexport const streetsClimateImage = ' + json.dumps(uri) + ';\n')
44
+ image = buffer.getvalue()
45
+ (ROOT / 'streets-climate-v1.png').write_bytes(image)
46
+ recipe.update(image='streets-climate-v1.png', imageBytes=len(image),
47
+ imageSha256=hashlib.sha256(image).hexdigest())
43
48
  (ROOT / 'recipe.json').write_text(json.dumps(recipe, indent=2)+'\n')
44
49
  # Keep generated sources reproducible under the package formatter.
45
50
  import subprocess
46
- subprocess.run(['pnpm', 'exec', 'prettier', '--write', str(output.resolve()), str(ROOT / 'recipe.json')], cwd=ROOT.parents[4], check=True)
47
- print(json.dumps({'imageBytes':len(buffer.getvalue()), 'sourceSha256':recipe['sourceSha256']}))
51
+ subprocess.run(['pnpm', 'exec', 'prettier', '--write', str(ROOT / 'recipe.json')], cwd=ROOT.parents[4], check=True)
52
+ print(json.dumps({'imageBytes': len(image), 'imageSha256': recipe['imageSha256'],
53
+ 'sourceSha256': recipe['sourceSha256']}))
@@ -9,5 +9,8 @@
9
9
  "blurDegrees": 0.25,
10
10
  "maxzoom": 4,
11
11
  "tileSize": 256,
12
- "period": "1991\u20132020"
12
+ "period": "1991\u20132020",
13
+ "image": "streets-climate-v1.png",
14
+ "imageBytes": 820873,
15
+ "imageSha256": "bede2213b0ba74d77111fe182458ee30d219b989a9c11fe5ce121de1c549dfc4"
13
16
  }