clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

feat/atlas-next-horizon
atlas / analysis / testdata / cells / containment.json
containment.json 14.8K
1{2 "family": "containment",3 "about": "Containment is boundary-INCLUSIVE, and descent agrees with it: the child under a point is a cell that contains the point. locate() is the same question asked for the pin card, in the system's own address.",4 "cases": [5 {6 "name": "geohash-contains-top-right-corner",7 "ground": "test/square-1024",8 "system": "geohash",9 "call": "contains",10 "args": [11 "m6",12 [13 704,14 -67215 ]16 ],17 "expect": true,18 "note": "The maximum corner is inside: boundaries are inclusive on both sides.",19 "handDerived": true20 },21 {22 "name": "geohash-contains-bottom-left-corner",23 "ground": "test/square-1024",24 "system": "geohash",25 "call": "contains",26 "args": [27 "m6",28 [29 672,30 -70431 ]32 ],33 "expect": true,34 "handDerived": true35 },36 {37 "name": "geohash-excludes-just-past-the-edge",38 "ground": "test/square-1024",39 "system": "geohash",40 "call": "contains",41 "args": [42 "m6",43 [44 704.0001,45 -67246 ]47 ],48 "expect": false,49 "handDerived": true50 },51 {52 "name": "geohash-descend-root",53 "ground": "test/square-1024",54 "system": "geohash",55 "call": "descendTarget",56 "args": [57 "",58 [59 688,60 -68861 ]62 ],63 "expect": "m",64 "handDerived": true65 },66 {67 "name": "geohash-descend-m",68 "ground": "test/square-1024",69 "system": "geohash",70 "call": "descendTarget",71 "args": [72 "m",73 [74 688,75 -68876 ]77 ],78 "expect": "m6",79 "handDerived": true80 },81 {82 "name": "geohash-cell-at-depth-3",83 "ground": "test/square-1024",84 "call": "geohashCellAt",85 "args": [86 [87 688,88 -68889 ],90 391 ],92 "expect": "m6s",93 "handDerived": true94 },95 {96 "name": "geohash-cell-at-off-the-surface",97 "ground": "test/square-1024",98 "call": "geohashCellAt",99 "args": [100 [101 -1,102 -1103 ],104 3105 ],106 "expect": "",107 "note": "Off the surface names nothing.",108 "handDerived": true109 },110 {111 "name": "geohash-locate",112 "ground": "test/square-1024",113 "system": "geohash",114 "call": "locate",115 "args": [116 [117 688,118 -688119 ]120 ],121 "expect": {122 "label": "Geohash",123 "value": "m6s"124 },125 "handDerived": true126 },127 {128 "name": "geohash-locate-off-the-surface",129 "ground": "test/square-1024",130 "system": "geohash",131 "call": "locate",132 "args": [133 [134 -1,135 -1136 ]137 ],138 "expect": null,139 "handDerived": true140 },141 {142 "name": "s2-locate",143 "ground": "test/sphere-8192x4096",144 "system": "s2",145 "call": "locate",146 "args": [147 [148 4363.848398961777,149 -916.9692745045334150 ]151 ],152 "expect": {153 "label": "S2",154 "value": "47a1cb"155 },156 "note": "The library's own vector: (49.703498679, 11.770681595) is leaf 0x47a1cbd595522b39, whose level-10 parent is 47a1cb. The point arrives in world pixels through the declared mapping.",157 "handDerived": true158 },159 {160 "name": "s2-descend-hop-0",161 "ground": "test/sphere-8192x4096",162 "system": "s2",163 "call": "descendTarget",164 "args": [165 "",166 [167 4363.848398961777,168 -916.9692745045334169 ]170 ],171 "expect": "5"172 },173 {174 "name": "s2-contains-hop-0",175 "ground": "test/sphere-8192x4096",176 "system": "s2",177 "call": "contains",178 "args": [179 "5",180 [181 4363.848398961777,182 -916.9692745045334183 ]184 ],185 "expect": true,186 "handDerived": true187 },188 {189 "name": "s2-descend-hop-1",190 "ground": "test/sphere-8192x4096",191 "system": "s2",192 "call": "descendTarget",193 "args": [194 "5",195 [196 4363.848398961777,197 -916.9692745045334198 ]199 ],200 "expect": "44"201 },202 {203 "name": "s2-contains-hop-1",204 "ground": "test/sphere-8192x4096",205 "system": "s2",206 "call": "contains",207 "args": [208 "44",209 [210 4363.848398961777,211 -916.9692745045334212 ]213 ],214 "expect": true,215 "handDerived": true216 },217 {218 "name": "s2-descend-hop-2",219 "ground": "test/sphere-8192x4096",220 "system": "s2",221 "call": "descendTarget",222 "args": [223 "44",224 [225 4363.848398961777,226 -916.9692745045334227 ]228 ],229 "expect": "47"230 },231 {232 "name": "s2-contains-hop-2",233 "ground": "test/sphere-8192x4096",234 "system": "s2",235 "call": "contains",236 "args": [237 "47",238 [239 4363.848398961777,240 -916.9692745045334241 ]242 ],243 "expect": true,244 "handDerived": true245 },246 {247 "name": "s2-descend-hop-3",248 "ground": "test/sphere-8192x4096",249 "system": "s2",250 "call": "descendTarget",251 "args": [252 "47",253 [254 4363.848398961777,255 -916.9692745045334256 ]257 ],258 "expect": "47c"259 },260 {261 "name": "s2-contains-hop-3",262 "ground": "test/sphere-8192x4096",263 "system": "s2",264 "call": "contains",265 "args": [266 "47c",267 [268 4363.848398961777,269 -916.9692745045334270 ]271 ],272 "expect": true,273 "handDerived": true274 },275 {276 "name": "s2-descend-hop-4",277 "ground": "test/sphere-8192x4096",278 "system": "s2",279 "call": "descendTarget",280 "args": [281 "47c",282 [283 4363.848398961777,284 -916.9692745045334285 ]286 ],287 "expect": "47b"288 },289 {290 "name": "s2-contains-hop-4",291 "ground": "test/sphere-8192x4096",292 "system": "s2",293 "call": "contains",294 "args": [295 "47b",296 [297 4363.848398961777,298 -916.9692745045334299 ]300 ],301 "expect": true,302 "handDerived": true303 },304 {305 "name": "s2-descend-hop-5",306 "ground": "test/sphere-8192x4096",307 "system": "s2",308 "call": "descendTarget",309 "args": [310 "47b",311 [312 4363.848398961777,313 -916.9692745045334314 ]315 ],316 "expect": "47a4"317 },318 {319 "name": "s2-contains-hop-5",320 "ground": "test/sphere-8192x4096",321 "system": "s2",322 "call": "contains",323 "args": [324 "47a4",325 [326 4363.848398961777,327 -916.9692745045334328 ]329 ],330 "expect": true,331 "handDerived": true332 },333 {334 "name": "s2-descend-hop-6",335 "ground": "test/sphere-8192x4096",336 "system": "s2",337 "call": "descendTarget",338 "args": [339 "47a4",340 [341 4363.848398961777,342 -916.9692745045334343 ]344 ],345 "expect": "47a1"346 },347 {348 "name": "s2-contains-hop-6",349 "ground": "test/sphere-8192x4096",350 "system": "s2",351 "call": "contains",352 "args": [353 "47a1",354 [355 4363.848398961777,356 -916.9692745045334357 ]358 ],359 "expect": true,360 "handDerived": true361 },362 {363 "name": "s2-descend-hop-7",364 "ground": "test/sphere-8192x4096",365 "system": "s2",366 "call": "descendTarget",367 "args": [368 "47a1",369 [370 4363.848398961777,371 -916.9692745045334372 ]373 ],374 "expect": "47a1c"375 },376 {377 "name": "s2-contains-hop-7",378 "ground": "test/sphere-8192x4096",379 "system": "s2",380 "call": "contains",381 "args": [382 "47a1c",383 [384 4363.848398961777,385 -916.9692745045334386 ]387 ],388 "expect": true,389 "handDerived": true390 },391 {392 "name": "s2-descend-hop-8",393 "ground": "test/sphere-8192x4096",394 "system": "s2",395 "call": "descendTarget",396 "args": [397 "47a1c",398 [399 4363.848398961777,400 -916.9692745045334401 ]402 ],403 "expect": "47a1d"404 },405 {406 "name": "s2-contains-hop-8",407 "ground": "test/sphere-8192x4096",408 "system": "s2",409 "call": "contains",410 "args": [411 "47a1d",412 [413 4363.848398961777,414 -916.9692745045334415 ]416 ],417 "expect": true,418 "handDerived": true419 },420 {421 "name": "s2-descend-hop-9",422 "ground": "test/sphere-8192x4096",423 "system": "s2",424 "call": "descendTarget",425 "args": [426 "47a1d",427 [428 4363.848398961777,429 -916.9692745045334430 ]431 ],432 "expect": "47a1cc"433 },434 {435 "name": "s2-contains-hop-9",436 "ground": "test/sphere-8192x4096",437 "system": "s2",438 "call": "contains",439 "args": [440 "47a1cc",441 [442 4363.848398961777,443 -916.9692745045334444 ]445 ],446 "expect": true,447 "handDerived": true448 },449 {450 "name": "s2-descend-hop-10",451 "ground": "test/sphere-8192x4096",452 "system": "s2",453 "call": "descendTarget",454 "args": [455 "47a1cc",456 [457 4363.848398961777,458 -916.9692745045334459 ]460 ],461 "expect": "47a1cb"462 },463 {464 "name": "s2-contains-hop-10",465 "ground": "test/sphere-8192x4096",466 "system": "s2",467 "call": "contains",468 "args": [469 "47a1cb",470 [471 4363.848398961777,472 -916.9692745045334473 ]474 ],475 "expect": true,476 "handDerived": true477 },478 {479 "name": "s2-descent-has-a-floor",480 "ground": "test/sphere-8192x4096",481 "system": "s2",482 "call": "descendTarget",483 "args": [484 "47a1cb",485 [486 4363.848398961777,487 -916.9692745045334488 ]489 ],490 "expect": "",491 "note": "The telescope stops at S2 level 10.",492 "handDerived": true493 },494 {495 "name": "geohash-cellat-ignores-the-lens-window",496 "ground": "test/square-1024-bounds",497 "call": "geohashCellAt",498 "args": [499 [500 688,501 -688502 ],503 3504 ],505 "expect": "m6s",506 "note": "Part 1: a plane's grid divides the WORLD SQUARE whatever window the lens fills, so this is the same m6s the whole-surface ground answers and a lens switch moves no hash.",507 "handDerived": true508 },509 {510 "name": "geohash-contains-on-the-world-square",511 "ground": "test/square-1024-bounds",512 "system": "geohash",513 "call": "contains",514 "args": [515 "m6",516 [517 672,518 -704519 ]520 ],521 "expect": true,522 "note": "m6 on the full 1024 square — [672,-704]..[704,-672], corner inclusive — not a halving of the 512x256 window.",523 "handDerived": true524 },525 {526 "name": "geohash-outside-the-window-still-on-the-square",527 "ground": "test/square-1024-bounds",528 "system": "geohash",529 "call": "contains",530 "args": [531 "0",532 [533 8,534 -1016535 ]536 ],537 "expect": true,538 "note": "A point outside the lens window but on the world square is in the square's own cell 0 (bottom-left 128x256 of the 1024 square).",539 "handDerived": true540 },541 {542 "name": "real-cellat-raster-centre",543 "ground": "bend-or/2026-08-02/0",544 "call": "geohashCellAt",545 "args": [546 [547 4096,548 -4096549 ],550 6551 ],552 "expect": "9rcdxk",553 "note": "(4096,4096 y-down) inverts to lat 44.05759758..., lng -121.3175; textbook geohash at 6 characters is 9rcdxk.",554 "handDerived": true555 },556 {557 "name": "real-cellat-north-west",558 "ground": "bend-or/2026-08-02/0",559 "call": "geohashCellAt",560 "args": [561 [562 1024,563 -2048564 ],565 6566 ],567 "expect": "9rcdux",568 "note": "(1024,2048 y-down) is lat 44.11669306..., lng -121.44091000...; 9rcdux.",569 "handDerived": true570 },571 {572 "name": "real-cellat-outside-the-window",573 "ground": "bend-or/2026-08-02/0",574 "call": "geohashCellAt",575 "args": [576 [577 9000,578 -4096579 ],580 6581 ],582 "expect": "9rcfeu",583 "note": "East of the declared window, and still a real address: lat 44.05759758..., lng -121.12049392... is 9rcfeu. The ground is real earth; no point is refused.",584 "handDerived": true585 },586 {587 "name": "real-cellat-base-depth",588 "ground": "bend-or/2026-08-02/0",589 "call": "geohashCellAt",590 "args": [591 [592 4096,593 -4096594 ],595 4596 ],597 "expect": "9rcd",598 "handDerived": true599 },600 {601 "name": "real-contains-own-cell",602 "ground": "bend-or/2026-08-02/0",603 "system": "geohash",604 "call": "contains",605 "args": [606 "9rcd",607 [608 4096,609 -4096610 ]611 ],612 "expect": true,613 "handDerived": true614 },615 {616 "name": "real-contains-not-the-neighbour",617 "ground": "bend-or/2026-08-02/0",618 "system": "geohash",619 "call": "contains",620 "args": [621 "9rcf",622 [623 4096,624 -4096625 ]626 ],627 "expect": false,628 "handDerived": true629 },630 {631 "name": "real-contains-outside-the-window",632 "ground": "bend-or/2026-08-02/0",633 "system": "geohash",634 "call": "contains",635 "args": [636 "9rcf",637 [638 9000,639 -4096640 ]641 ],642 "expect": true,643 "note": "9rcf overhangs the window's east edge; the point east of the raster is inside its real degree rectangle.",644 "handDerived": true645 },646 {647 "name": "real-root-holds-everything",648 "ground": "bend-or/2026-08-02/0",649 "system": "geohash",650 "call": "contains",651 "args": [652 "",653 [654 9000,655 -4096656 ]657 ],658 "expect": true,659 "note": "The root is the whole earth: every point of the picture's plane is somewhere on it.",660 "handDerived": true661 },662 {663 "name": "real-descend-from-the-root-lands-on-base-depth",664 "ground": "bend-or/2026-08-02/0",665 "system": "geohash",666 "call": "descendTarget",667 "args": [668 "",669 [670 4096,671 -4096672 ]673 ],674 "expect": "9rcd",675 "note": "The root's children are the depth-4 cells, so the first descent is four characters, not one.",676 "handDerived": true677 },678 {679 "name": "real-descend-one-layer",680 "ground": "bend-or/2026-08-02/0",681 "system": "geohash",682 "call": "descendTarget",683 "args": [684 "9rcd",685 [686 4096,687 -4096688 ]689 ],690 "expect": "9rcdx",691 "handDerived": true692 }693 ]694}