code wiki / _hdl_build / nx_maps_render.nx

nx_maps_render.nx

buildroot/runtime/_hdl_build/nx_maps_render.nx

27286 B329 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_maps_render.nx -- GEO-024 NISHI MAPS test output (v: render+interactive+basemap+search+route+polish): a sovereign, Google-Maps-like map VIEW rendered entirely by Nishi's own geo organs. It projects seeded geographic features (land, roads/route, geofence, place markers) through the sovereign WEB-MERCATOR projection (GEO-019b math: fx.nx CORDIC + log2, Q16.16) onto a pixel viewport, and EMITS a self-contained HTML+SVG document. The browser is only the sink -- NO Google, Mapbox, Leaflet, or proj4 in the path (ecosystem-only; HTML/SVG = last mile). Output -> web_assets/_maps_build/maps.html (serve at nishifamily.com/maps). Self-gating: the viewport CENTER must project to the pixel centre (W/2,H/2); verdict -> geo_map.log. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

fx.nx nx_syscalls.nx nx_maps_render.nx

imports: fx.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pow2 pxx mnx pxy mny fx_sin fx_sin_cos fx_normalize_angle fx_cordic_atan fx_cos fx_sin_cos ↻ fx_mul fx_log2 fx_mul ↻ sys_openat_wr mw sys_write mwn sys_mmap sys_write ↻ sys_mmap ↻ tosx pxx ↻ tosy pxy ↻ mpt mwn ↻ mw ↻ mmark mw ↻ mwn ↻ mmark_l mw ↻ mwn ↻ mplace mw ↻ mwn ↻ sys_close sys_openat_append

structs

none

consts

12const MAP_MAGIC_180000000: i64 = 180000000
13const MAP_MAGIC_360000000: i64 = 360000000
14const MAP_MAGIC_65536: i64 = 65536
15const MAP_MAGIC_1200: i64 = 1200
16const MAP_MAGIC_40600000: i64 = 40600000
17const MAP_MAGIC_74000000: i64 = 74000000
18const MAP_MAGIC_77000000: i64 = 77000000
19const MAP_MAGIC_71000000: i64 = 71000000
20const MAP_MAGIC_42000000: i64 = 42000000
21const MAP_MAGIC_39000000: i64 = 39000000
22const MAP_MAGIC_43500000: i64 = 43500000
23const MAP_MAGIC_78500000: i64 = 78500000
24const MAP_MAGIC_43600000: i64 = 43600000
25const MAP_MAGIC_70000000: i64 = 70000000
26const MAP_MAGIC_41700000: i64 = 41700000
27const MAP_MAGIC_69900000: i64 = 69900000
28const MAP_MAGIC_40500000: i64 = 40500000
29const MAP_MAGIC_73900000: i64 = 73900000
30const MAP_MAGIC_74900000: i64 = 74900000
31const MAP_MAGIC_37800000: i64 = 37800000
32const MAP_MAGIC_75900000: i64 = 75900000
33const MAP_MAGIC_37700000: i64 = 37700000
34const MAP_MAGIC_41000000: i64 = 41000000
35const MAP_MAGIC_79000000: i64 = 79000000
36const MAP_MAGIC_42360000: i64 = 42360000
37const MAP_MAGIC_71060000: i64 = 71060000
38const MAP_MAGIC_41824000: i64 = 41824000
39const MAP_MAGIC_71412000: i64 = 71412000
40const MAP_MAGIC_40712800: i64 = 40712800
41const MAP_MAGIC_74006000: i64 = 74006000
42const MAP_MAGIC_40735700: i64 = 40735700
43const MAP_MAGIC_74172400: i64 = 74172400
44const MAP_MAGIC_40217000: i64 = 40217000
45const MAP_MAGIC_74763000: i64 = 74763000
46const MAP_MAGIC_39952600: i64 = 39952600
47const MAP_MAGIC_75165200: i64 = 75165200
48const MAP_MAGIC_39290400: i64 = 39290400
49const MAP_MAGIC_76612200: i64 = 76612200
50const MAP_MAGIC_38900000: i64 = 38900000
51const MAP_MAGIC_77036000: i64 = 77036000
52const MAP_MAGIC_41763000: i64 = 41763000
53const MAP_MAGIC_72685000: i64 = 72685000
54const MAP_MAGIC_70255000: i64 = 70255000
55const MAP_MAGIC_43661000: i64 = 43661000
56const MAP_MAGIC_73757000: i64 = 73757000
57const MAP_MAGIC_42652000: i64 = 42652000
58const MAP_MAGIC_78878000: i64 = 78878000
59const MAP_MAGIC_42886000: i64 = 42886000
60const MAP_MAGIC_76884000: i64 = 76884000
61const MAP_MAGIC_40273000: i64 = 40273000
62const MAP_MAGIC_79995900: i64 = 79995900
63const MAP_MAGIC_40440600: i64 = 40440600
64const MAP_MAGIC_75546600: i64 = 75546600
65const MAP_MAGIC_39745800: i64 = 39745800
66const MAP_MAGIC_77436000: i64 = 77436000
67const MAP_MAGIC_37540700: i64 = 37540700
68const MAP_MAGIC_76285900: i64 = 76285900
69const MAP_MAGIC_36850800: i64 = 36850800
71const OUT: *u8 = "web_assets/_maps_build/maps.html"
72const MAP_LOG: *u8 = "knowledge/status/geo_map.log"
73const FXLN2: i64 = 45426 // ln(2) in Q16.16 (log2 -> ln)

functions

75func mw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 5: mptmmarkmmark_lmplacemain calls 1: sys_write
76func mwn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
78func pow2(z: i64) -> i64 { var n: i64 = 1; var t: i64 = 0; while t < z { n = n * 2; t = t + 1 } return n }
called by 1: main
81func mnx(lon: i64) -> i64 { return (lon + MAP_MAGIC_180000000) * FX_ONE / MAP_MAGIC_360000000 }
called by 1: pxx
82func mny(lat: i64) -> i64
called by 1: pxy calls 4: fx_sinfx_cosfx_mulfx_log2
94func pxx(lon: i64, worldpx: i64) -> i64 { return mnx(lon) * worldpx / MAP_MAGIC_65536 }
called by 2: tosxmain calls 1: mnx
95func pxy(lat: i64, worldpx: i64) -> i64 { return mny(lat) * worldpx / MAP_MAGIC_65536 }
called by 2: tosymain calls 1: mny
96func tosx(lon: i64, cnxpx: i64, worldpx: i64, w: i64) -> i64 { return pxx(lon, worldpx) - cnxpx + w / 2 }
called by 1: main calls 1: pxx
97func tosy(lat: i64, cnypx: i64, worldpx: i64, h: i64) -> i64 { return pxy(lat, worldpx) - cnypx + h / 2 }
called by 1: main calls 1: pxy
100func mpt(fd: i64, sx: i64, sy: i64) -> i64 { mwn(fd, sx); mw(fd, "," as *u8); mwn(fd, sy); mw(fd, " " as *u8); return 0 }
called by 1: main calls 2: mwnmw
103func mmark(fd: i64, sx: i64, sy: i64, label: *u8) -> i64
called by 1: main calls 2: mwmwn
110func mmark_l(fd: i64, sx: i64, sy: i64, label: *u8) -> i64
called by 1: main calls 2: mwmwn
118func mplace(fd: i64, label: *u8, sx: i64, sy: i64) -> i64
called by 1: main calls 2: mwmwn
123func main() -> i64