uomtiles 0.1.0
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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/1d1PDhA4.js +1 -0
- package/.output/public/_nuxt/3B2XYGg4.js +1 -0
- package/.output/public/_nuxt/981KwFWf.js +1 -0
- package/.output/public/_nuxt/B30dSvM4.js +1 -0
- package/.output/public/_nuxt/BN1Gp4Dm.js +1 -0
- package/.output/public/_nuxt/BQlj8Xoe.js +6 -0
- package/.output/public/_nuxt/BRkljK8J.js +1 -0
- package/.output/public/_nuxt/BSdHYVlE2.js +1 -0
- package/.output/public/_nuxt/B_MqTg2k2.js +1 -0
- package/.output/public/_nuxt/BiWblTbb2.js +64 -0
- package/.output/public/_nuxt/BrPwntMr.js +1 -0
- package/.output/public/_nuxt/BskybydR.js +1 -0
- package/.output/public/_nuxt/ByRlKR9F.js +1 -0
- package/.output/public/_nuxt/C0Zdl2EE2.js +1 -0
- package/.output/public/_nuxt/C4qlzA4o.js +1 -0
- package/.output/public/_nuxt/C7HxHbxA.js +1 -0
- package/.output/public/_nuxt/C97TfNgP.js +3 -0
- package/.output/public/_nuxt/CNs_Ozdc.js +1 -0
- package/.output/public/_nuxt/CPuhwLY1.js +1 -0
- package/.output/public/_nuxt/CVE291Pi.js +1 -0
- package/.output/public/_nuxt/C_0VY3Cv2.js +4 -0
- package/.output/public/_nuxt/Ce26t8_Y.js +1 -0
- package/.output/public/_nuxt/CfW544W5.js +1 -0
- package/.output/public/_nuxt/CgMd2Y5s.js +2 -0
- package/.output/public/_nuxt/CgdzV712.js +1 -0
- package/.output/public/_nuxt/D1wVNWS0.js +1 -0
- package/.output/public/_nuxt/DC3bhq63.js +1 -0
- package/.output/public/_nuxt/DK3Fl9T5.js +1 -0
- package/.output/public/_nuxt/DL1MZZLI.js +1 -0
- package/.output/public/_nuxt/DXm-42Fi.js +1 -0
- package/.output/public/_nuxt/Djg3Kzfv.js +1 -0
- package/.output/public/_nuxt/DkcySee1.js +1 -0
- package/.output/public/_nuxt/DmN-PKW1.js +1 -0
- package/.output/public/_nuxt/DtFVCXI9.js +1 -0
- package/.output/public/_nuxt/Dz7VMlHR.js +1 -0
- package/.output/public/_nuxt/NL65vbjG2.js +1 -0
- package/.output/public/_nuxt/Oxy7pKSk.js +3 -0
- package/.output/public/_nuxt/Pik8or8N2.js +1 -0
- package/.output/public/_nuxt/XZ59tThl.js +1 -0
- package/.output/public/_nuxt/ZpWjFsgV.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/9f85104e-738d-4a74-8daa-40b136ce17d5.json +1 -0
- package/.output/public/_nuxt/dXz6dFgW2.js +1 -0
- package/.output/public/_nuxt/entry.P6tFNE31.css +1 -0
- package/.output/public/_nuxt/error-404.Biv0P6cJ.css +1 -0
- package/.output/public/_nuxt/error-500.8ok468rV.css +1 -0
- package/.output/public/_nuxt/j0MRD-c3.js +1 -0
- package/.output/public/_nuxt/local-pixel-diff.worker-C6RdZoCq.js +2 -0
- package/.output/public/_nuxt/maplibre-gl-worker.nfnkSQvL.mjs +6 -0
- package/.output/public/_nuxt/nearest-area.worker-iSLH0Y_s.js +2 -0
- package/.output/public/_nuxt/q7DkoVkj.js +828 -0
- package/.output/public/_nuxt/raster-tile.worker-BFlOgJig.js +2 -0
- package/.output/public/_nuxt/services._3nQizF8.css +1 -0
- package/.output/public/_nuxt/sql-wasm.DfANybxk.wasm +0 -0
- package/.output/public/_nuxt/tile-diff.worker-CvWWI_eu.js +1 -0
- package/.output/public/_nuxt/zZ1EGR7Y.js +1 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/favicon.svg +8 -0
- package/.output/public/icon-192.png +0 -0
- package/.output/public/icon-512.png +0 -0
- package/.output/public/site.webmanifest +11 -0
- package/.output/server/chunks/_/config.mjs +208 -0
- package/.output/server/chunks/_/config.mjs.map +1 -0
- package/.output/server/chunks/_/data-directory.mjs +24 -0
- package/.output/server/chunks/_/data-directory.mjs.map +1 -0
- package/.output/server/chunks/_/error-500.mjs +20 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/_/file-workspace.mjs +910 -0
- package/.output/server/chunks/_/file-workspace.mjs.map +1 -0
- package/.output/server/chunks/_/icons.mjs +6269 -0
- package/.output/server/chunks/_/icons.mjs.map +1 -0
- package/.output/server/chunks/_/map-service.mjs +233 -0
- package/.output/server/chunks/_/map-service.mjs.map +1 -0
- package/.output/server/chunks/_/missing-tile.mjs +104 -0
- package/.output/server/chunks/_/missing-tile.mjs.map +1 -0
- package/.output/server/chunks/_/pixel-diff.mjs +78 -0
- package/.output/server/chunks/_/pixel-diff.mjs.map +1 -0
- package/.output/server/chunks/_/uom-auth.mjs +334 -0
- package/.output/server/chunks/_/uom-auth.mjs.map +1 -0
- package/.output/server/chunks/_/uom-map.mjs +265 -0
- package/.output/server/chunks/_/uom-map.mjs.map +1 -0
- package/.output/server/chunks/build/Alert-0ngTJXxP.mjs +5076 -0
- package/.output/server/chunks/build/Alert-0ngTJXxP.mjs.map +1 -0
- package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs +569 -0
- package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs.map +1 -0
- package/.output/server/chunks/build/Empty-CkW3mADt.mjs +359 -0
- package/.output/server/chunks/build/Empty-CkW3mADt.mjs.map +1 -0
- package/.output/server/chunks/build/FocusScope-Cf0lg0zt.mjs +207 -0
- package/.output/server/chunks/build/FocusScope-Cf0lg0zt.mjs.map +1 -0
- package/.output/server/chunks/build/FormField-CEUZHcv7.mjs +278 -0
- package/.output/server/chunks/build/FormField-CEUZHcv7.mjs.map +1 -0
- package/.output/server/chunks/build/Input-BeNavYXb.mjs +592 -0
- package/.output/server/chunks/build/Input-BeNavYXb.mjs.map +1 -0
- package/.output/server/chunks/build/MapBaseLayerTabs-4445J6yh.mjs +2003 -0
- package/.output/server/chunks/build/MapBaseLayerTabs-4445J6yh.mjs.map +1 -0
- package/.output/server/chunks/build/Modal-DNZtVxca.mjs +1326 -0
- package/.output/server/chunks/build/Modal-DNZtVxca.mjs.map +1 -0
- package/.output/server/chunks/build/OnlineMap-CKwiuqUY.mjs +146 -0
- package/.output/server/chunks/build/OnlineMap-CKwiuqUY.mjs.map +1 -0
- package/.output/server/chunks/build/Pagination-CDHx4HTZ.mjs +1025 -0
- package/.output/server/chunks/build/Pagination-CDHx4HTZ.mjs.map +1 -0
- package/.output/server/chunks/build/PopperArrow-Bqfdf2Et.mjs +2066 -0
- package/.output/server/chunks/build/PopperArrow-Bqfdf2Et.mjs.map +1 -0
- package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs +379 -0
- package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs.map +1 -0
- package/.output/server/chunks/build/Slider-D-n8Y0CX.mjs +1087 -0
- package/.output/server/chunks/build/Slider-D-n8Y0CX.mjs.map +1 -0
- package/.output/server/chunks/build/Tooltip-CkpSktvJ.mjs +1345 -0
- package/.output/server/chunks/build/Tooltip-CkpSktvJ.mjs.map +1 -0
- package/.output/server/chunks/build/_virtual_public-CeOptKUP.mjs +7 -0
- package/.output/server/chunks/build/_virtual_public-CeOptKUP.mjs.map +1 -0
- package/.output/server/chunks/build/advanced-D1onodoF.mjs +1430 -0
- package/.output/server/chunks/build/advanced-D1onodoF.mjs.map +1 -0
- package/.output/server/chunks/build/compare-DmSAW8oA.mjs +1093 -0
- package/.output/server/chunks/build/compare-DmSAW8oA.mjs.map +1 -0
- package/.output/server/chunks/build/dashboard-BJxrZ19n.mjs +3217 -0
- package/.output/server/chunks/build/dashboard-BJxrZ19n.mjs.map +1 -0
- package/.output/server/chunks/build/details-CBMqXYyo.mjs +3714 -0
- package/.output/server/chunks/build/details-CBMqXYyo.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-D9aQjJRn.mjs +86 -0
- package/.output/server/chunks/build/error-404-D9aQjJRn.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DciiguV6.mjs +9 -0
- package/.output/server/chunks/build/error-404-styles.DciiguV6.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-BNyA3wrb.mjs +74 -0
- package/.output/server/chunks/build/error-500-BNyA3wrb.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.C562DYMR.mjs +9 -0
- package/.output/server/chunks/build/error-500-styles.C562DYMR.mjs.map +1 -0
- package/.output/server/chunks/build/esm-Dp2lJXbp.mjs +1121 -0
- package/.output/server/chunks/build/esm-Dp2lJXbp.mjs.map +1 -0
- package/.output/server/chunks/build/interval-BxUMpo78.mjs +411 -0
- package/.output/server/chunks/build/interval-BxUMpo78.mjs.map +1 -0
- package/.output/server/chunks/build/login-lbtjN0MV.mjs +642 -0
- package/.output/server/chunks/build/login-lbtjN0MV.mjs.map +1 -0
- package/.output/server/chunks/build/pages-Ba0Eixbd.mjs +220 -0
- package/.output/server/chunks/build/pages-Ba0Eixbd.mjs.map +1 -0
- package/.output/server/chunks/build/services-DuJwjAB8.mjs +3005 -0
- package/.output/server/chunks/build/services-DuJwjAB8.mjs.map +1 -0
- package/.output/server/chunks/build/services-styles.eoO16BY9.mjs +9 -0
- package/.output/server/chunks/build/services-styles.eoO16BY9.mjs.map +1 -0
- package/.output/server/chunks/build/tasks-CyN9x492.mjs +915 -0
- package/.output/server/chunks/build/tasks-CyN9x492.mjs.map +1 -0
- package/.output/server/chunks/build/tasks-D_Q5EDnn.mjs +87 -0
- package/.output/server/chunks/build/tasks-D_Q5EDnn.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6215 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/captcha.post.mjs +21 -0
- package/.output/server/chunks/routes/api/auth/captcha.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/login.post.mjs +27 -0
- package/.output/server/chunks/routes/api/auth/login.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/logout.post.mjs +22 -0
- package/.output/server/chunks/routes/api/auth/logout.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/map-token.post.mjs +22 -0
- package/.output/server/chunks/routes/api/auth/map-token.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/send-sms.post.mjs +31 -0
- package/.output/server/chunks/routes/api/auth/send-sms.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/status.get.mjs +21 -0
- package/.output/server/chunks/routes/api/auth/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs +44 -0
- package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/live/status.get.mjs +32 -0
- package/.output/server/chunks/routes/api/map/live/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs +48 -0
- package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs +46 -0
- package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/config.post.mjs +38 -0
- package/.output/server/chunks/routes/api/map-service/config.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/file.post.mjs +41 -0
- package/.output/server/chunks/routes/api/map-service/file.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/source.post.mjs +35 -0
- package/.output/server/chunks/routes/api/map-service/source.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/status.get.mjs +32 -0
- package/.output/server/chunks/routes/api/map-service/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs +47 -0
- package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs +42 -0
- package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs +48 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs +45 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs +32 -0
- package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/compare.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workspace/compare.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/fetch.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workspace/fetch.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/files.get.mjs +27 -0
- package/.output/server/chunks/routes/api/workspace/files.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/files.post.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/files.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/stop.post.mjs +32 -0
- package/.output/server/chunks/routes/api/workspace/stop.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/tasks.post.mjs +36 -0
- package/.output/server/chunks/routes/api/workspace/tasks.post.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +422 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/routes/services/wms.get.mjs +54 -0
- package/.output/server/chunks/routes/services/wms.get.mjs.map +1 -0
- package/.output/server/chunks/routes/services/wmts.get.mjs +54 -0
- package/.output/server/chunks/routes/services/wmts.get.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/chunks/virtual/entry.mjs +18545 -0
- package/.output/server/chunks/virtual/entry.mjs.map +1 -0
- package/.output/server/chunks/virtual/precomputed.mjs +4 -0
- package/.output/server/chunks/virtual/precomputed.mjs.map +1 -0
- package/.output/server/chunks/virtual/styles.mjs +10 -0
- package/.output/server/chunks/virtual/styles.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14611 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +295 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +701 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +75 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +39 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +128 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +17 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +100 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +203 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +132 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +165 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +79 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +66 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +45 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +103 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +36 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +62 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +25 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +57 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +12 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +25 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +36 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +91 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +46 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +123 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +113 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +41 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +67 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +7 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +8 -0
- package/.output/server/node_modules/@iconify/utils/package.json +119 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6801 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +692 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1420 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1903 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6976 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1841 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +904 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +53 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +609 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/devalue/index.js +17 -0
- package/.output/server/node_modules/devalue/package.json +39 -0
- package/.output/server/node_modules/devalue/src/base64.js +60 -0
- package/.output/server/node_modules/devalue/src/constants.js +12 -0
- package/.output/server/node_modules/devalue/src/operations.js +193 -0
- package/.output/server/node_modules/devalue/src/parse.js +270 -0
- package/.output/server/node_modules/devalue/src/stringify.js +428 -0
- package/.output/server/node_modules/devalue/src/uneval.js +582 -0
- package/.output/server/node_modules/devalue/src/utils.js +185 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/fflate/esm/index.mjs +2710 -0
- package/.output/server/node_modules/fflate/package.json +128 -0
- package/.output/server/node_modules/fnv1a-64/dist/index.mjs +95 -0
- package/.output/server/node_modules/fnv1a-64/package.json +75 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +257 -0
- package/.output/server/node_modules/hookable/package.json +53 -0
- package/.output/server/node_modules/nostics/dist/formatters/ansi.mjs +19 -0
- package/.output/server/node_modules/nostics/dist/index.mjs +187 -0
- package/.output/server/node_modules/nostics/package.json +125 -0
- package/.output/server/node_modules/object-identity/index.js +60 -0
- package/.output/server/node_modules/object-identity/package.json +40 -0
- package/.output/server/node_modules/p-limit/index.js +104 -0
- package/.output/server/node_modules/p-limit/package.json +58 -0
- package/.output/server/node_modules/pmtiles/dist/esm/index.js +2 -0
- package/.output/server/node_modules/pmtiles/package.json +50 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-DCG7AFIE.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/client.mjs +22 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +52 -0
- package/.output/server/node_modules/unhead/dist/legacy.mjs +33 -0
- package/.output/server/node_modules/unhead/dist/minify.mjs +183 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +518 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +631 -0
- package/.output/server/node_modules/unhead/dist/scripts.node.mjs +6 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +99 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BEmVMkeA.mjs +673 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BGFxPGPQ.mjs +47 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BQWSw36o.mjs +192 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bb4d5b9h.mjs +67 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BdK3SLPN.mjs +585 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bf_fPVYA.mjs +6 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bm4Y6XQI.mjs +17 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C3b2Ipoj.mjs +223 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CGPOfp5O.mjs +32 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CHEy9ana.mjs +7 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CTjuIdzk.mjs +27 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CfKy3Kuq.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D7HkBzZn.mjs +59 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DNKiVLV7.mjs +400 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.MC5RsXLj.mjs +19 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.jEy9BmRq.mjs +264 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.tQnRaXfX.mjs +240 -0
- package/.output/server/node_modules/unhead/dist/stream/client.mjs +28 -0
- package/.output/server/node_modules/unhead/dist/stream/iife.mjs +2 -0
- package/.output/server/node_modules/unhead/dist/stream/server.mjs +264 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +7 -0
- package/.output/server/node_modules/unhead/package.json +179 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +278 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +54 -0
- package/.output/server/node_modules/yocto-queue/index.js +90 -0
- package/.output/server/node_modules/yocto-queue/package.json +48 -0
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +135 -0
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
- package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
- package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
- package/.output/server/node_modules/zod/v4/classic/package.json +7 -0
- package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/.output/server/node_modules/zod/v4/core/api.js +1087 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
- package/.output/server/node_modules/zod/v4/core/core.js +78 -0
- package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
- package/.output/server/node_modules/zod/v4/core/errors.js +185 -0
- package/.output/server/node_modules/zod/v4/core/index.js +16 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
- package/.output/server/node_modules/zod/v4/core/package.json +7 -0
- package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +139 -0
- package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
- package/.output/server/node_modules/zod/v4/core/schemas.js +2239 -0
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/.output/server/node_modules/zod/v4/core/util.js +674 -0
- package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
- package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/el.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +113 -0
- package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +125 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
- package/.output/server/node_modules/zod/v4/locales/hr.js +122 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +52 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +7 -0
- package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ro.js +119 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/.output/server/package.json +37 -0
- package/LICENSE +3 -0
- package/README.md +125 -0
- package/dist/src/bbox.js +55 -0
- package/dist/src/cli.js +255 -0
- package/dist/src/config.js +56 -0
- package/dist/src/core/fetch-process.js +19 -0
- package/dist/src/core/grid-renderer.js +149 -0
- package/dist/src/core/lease.js +103 -0
- package/dist/src/core/paths.js +13 -0
- package/dist/src/core/png.js +192 -0
- package/dist/src/core/raster-style.js +33 -0
- package/dist/src/core/uomtiles.js +307 -0
- package/dist/src/fetcher.js +208 -0
- package/dist/src/geographic-grid.js +162 -0
- package/dist/src/grid-crawl.js +478 -0
- package/dist/src/mask-image.js +16 -0
- package/dist/src/official-grid.js +51 -0
- package/dist/src/quality.js +30 -0
- package/dist/src/token.js +206 -0
- package/package.json +68 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +8 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/site.webmanifest +11 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, unlinkSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import pLimit from 'p-limit';
|
|
6
|
+
import { CHINA_BBOX_LL, DEFAULTS } from "./config.js";
|
|
7
|
+
import { tileRangeForBBox, xyzYToTmsY } from "./bbox.js";
|
|
8
|
+
import { GEOGRAPHIC_GRID_LEVEL, geographicGridLines, renderGeographicGrid, vectorizeGeographicGrid } from "./geographic-grid.js";
|
|
9
|
+
import { fetchOfficialSupertileMask } from "./official-grid.js";
|
|
10
|
+
import { UomFetcher } from "./fetcher.js";
|
|
11
|
+
import { TokenStore } from "./token.js";
|
|
12
|
+
import { encodeMask, maskHasContent } from "./mask-image.js";
|
|
13
|
+
import { acquireSqliteLease } from "./core/lease.js";
|
|
14
|
+
import { initializeUomtiles, setTaskState } from "./core/uomtiles.js";
|
|
15
|
+
export const DEFAULT_GRID_CRAWL_OPTIONS = {
|
|
16
|
+
sourceZ: 12,
|
|
17
|
+
rootConcurrency: 2,
|
|
18
|
+
qps: 12,
|
|
19
|
+
resume: true,
|
|
20
|
+
root: null,
|
|
21
|
+
};
|
|
22
|
+
const rootZ = 9;
|
|
23
|
+
const materializedZMax = 12;
|
|
24
|
+
const sourceSize = 256 * 2 ** (materializedZMax - rootZ);
|
|
25
|
+
const rootDeadlineMs = 5 * 60_000;
|
|
26
|
+
const maxRootPasses = 3;
|
|
27
|
+
function validateOptions(args) {
|
|
28
|
+
if (args.sourceZ !== 12)
|
|
29
|
+
throw new RangeError('validated production source zoom is exactly z12');
|
|
30
|
+
if (!Number.isInteger(args.rootConcurrency) || args.rootConcurrency < 1 || args.rootConcurrency > 8) {
|
|
31
|
+
throw new RangeError('root concurrency must be an integer from 1 to 8');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function rootsForChina() {
|
|
35
|
+
const range = tileRangeForBBox(rootZ, CHINA_BBOX_LL.lonMin, CHINA_BBOX_LL.latMin, CHINA_BBOX_LL.lonMax, CHINA_BBOX_LL.latMax);
|
|
36
|
+
const roots = [];
|
|
37
|
+
for (let y = range.yMin; y <= range.yMax; y++) {
|
|
38
|
+
for (let x = range.xMin; x <= range.xMax; x++)
|
|
39
|
+
roots.push({ x, y });
|
|
40
|
+
}
|
|
41
|
+
return roots;
|
|
42
|
+
}
|
|
43
|
+
function encodeRectangles(rects) {
|
|
44
|
+
const buffer = Buffer.allocUnsafe(rects.length * 8);
|
|
45
|
+
for (let i = 0; i < rects.length; i++) {
|
|
46
|
+
const rect = rects[i];
|
|
47
|
+
buffer.writeUInt16LE(rect.col0, i * 8);
|
|
48
|
+
buffer.writeUInt16LE(rect.row0, i * 8 + 2);
|
|
49
|
+
buffer.writeUInt16LE(rect.col1, i * 8 + 4);
|
|
50
|
+
buffer.writeUInt16LE(rect.row1, i * 8 + 6);
|
|
51
|
+
}
|
|
52
|
+
return buffer;
|
|
53
|
+
}
|
|
54
|
+
function extractMask(canvas, size, tileX, tileY) {
|
|
55
|
+
const tile = new Uint8Array(256 * 256);
|
|
56
|
+
for (let y = 0; y < 256; y++) {
|
|
57
|
+
const sourceOffset = (tileY * 256 + y) * size + tileX * 256;
|
|
58
|
+
tile.set(canvas.subarray(sourceOffset, sourceOffset + 256), y * 256);
|
|
59
|
+
}
|
|
60
|
+
return tile;
|
|
61
|
+
}
|
|
62
|
+
function formatDuration(milliseconds) {
|
|
63
|
+
if (!Number.isFinite(milliseconds))
|
|
64
|
+
return 'unknown';
|
|
65
|
+
const seconds = Math.max(0, Math.floor(milliseconds / 1000));
|
|
66
|
+
return `${Math.floor(seconds / 3600)}h${String(Math.floor(seconds % 3600 / 60)).padStart(2, '0')}m${String(seconds % 60).padStart(2, '0')}s`;
|
|
67
|
+
}
|
|
68
|
+
function removeSqliteSidecars(path) {
|
|
69
|
+
for (const suffix of ['-wal', '-shm']) {
|
|
70
|
+
const sidecar = `${path}${suffix}`;
|
|
71
|
+
if (existsSync(sidecar))
|
|
72
|
+
unlinkSync(sidecar);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class GridDatabase {
|
|
76
|
+
db;
|
|
77
|
+
insertTile;
|
|
78
|
+
constructor(path) {
|
|
79
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
80
|
+
this.db = new DatabaseSync(path);
|
|
81
|
+
this.db.exec(`
|
|
82
|
+
PRAGMA journal_mode=WAL;
|
|
83
|
+
PRAGMA synchronous=NORMAL;
|
|
84
|
+
PRAGMA mmap_size=268435456;
|
|
85
|
+
PRAGMA page_size=8192;
|
|
86
|
+
PRAGMA temp_store=MEMORY;
|
|
87
|
+
CREATE TABLE IF NOT EXISTS metadata(name TEXT PRIMARY KEY, value TEXT NOT NULL);
|
|
88
|
+
CREATE TABLE IF NOT EXISTS tiles(
|
|
89
|
+
zoom_level INTEGER NOT NULL,
|
|
90
|
+
tile_column INTEGER NOT NULL,
|
|
91
|
+
tile_row INTEGER NOT NULL,
|
|
92
|
+
tile_data BLOB NOT NULL,
|
|
93
|
+
PRIMARY KEY(zoom_level, tile_column, tile_row));
|
|
94
|
+
CREATE TABLE IF NOT EXISTS tile_meta(
|
|
95
|
+
zoom_level INTEGER NOT NULL,
|
|
96
|
+
tile_column INTEGER NOT NULL,
|
|
97
|
+
tile_row INTEGER NOT NULL,
|
|
98
|
+
layer_mask INTEGER NOT NULL,
|
|
99
|
+
strat_summary TEXT NOT NULL,
|
|
100
|
+
fetched_at INTEGER NOT NULL,
|
|
101
|
+
source_kind TEXT NOT NULL,
|
|
102
|
+
derivation_source_z INTEGER,
|
|
103
|
+
PRIMARY KEY(zoom_level, tile_column, tile_row));
|
|
104
|
+
CREATE TABLE IF NOT EXISTS grid_roots(
|
|
105
|
+
root_z INTEGER NOT NULL,
|
|
106
|
+
root_x INTEGER NOT NULL,
|
|
107
|
+
root_y INTEGER NOT NULL,
|
|
108
|
+
source_z INTEGER NOT NULL,
|
|
109
|
+
state TEXT NOT NULL,
|
|
110
|
+
attempts INTEGER NOT NULL DEFAULT 0,
|
|
111
|
+
rect_count INTEGER NOT NULL DEFAULT 0,
|
|
112
|
+
rectangles BLOB,
|
|
113
|
+
rectangles_sha256 TEXT,
|
|
114
|
+
content_tiles INTEGER NOT NULL DEFAULT 0,
|
|
115
|
+
last_error TEXT,
|
|
116
|
+
started_at INTEGER,
|
|
117
|
+
finished_at INTEGER,
|
|
118
|
+
heartbeat_at INTEGER NOT NULL,
|
|
119
|
+
PRIMARY KEY(root_z, root_x, root_y));
|
|
120
|
+
CREATE INDEX IF NOT EXISTS grid_roots_state ON grid_roots(state);
|
|
121
|
+
`);
|
|
122
|
+
this.insertTile = this.db.prepare('INSERT OR REPLACE INTO tiles(zoom_level,tile_column,tile_row,tile_data) VALUES(?,?,?,?)');
|
|
123
|
+
}
|
|
124
|
+
setMetadata(values) {
|
|
125
|
+
const statement = this.db.prepare('INSERT OR REPLACE INTO metadata(name,value) VALUES(?,?)');
|
|
126
|
+
this.db.exec('BEGIN');
|
|
127
|
+
try {
|
|
128
|
+
for (const [name, value] of Object.entries(values))
|
|
129
|
+
statement.run(name, value);
|
|
130
|
+
this.db.exec('COMMIT');
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
this.db.exec('ROLLBACK');
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
initializeRoots(roots) {
|
|
138
|
+
const statement = this.db.prepare(`INSERT OR IGNORE INTO grid_roots(
|
|
139
|
+
root_z,root_x,root_y,source_z,state,heartbeat_at) VALUES(?,?,?,?, 'pending', ?)`);
|
|
140
|
+
const now = Date.now();
|
|
141
|
+
this.db.exec('BEGIN');
|
|
142
|
+
try {
|
|
143
|
+
for (const root of roots)
|
|
144
|
+
statement.run(rootZ, root.x, root.y, materializedZMax, now);
|
|
145
|
+
this.db.exec('COMMIT');
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
this.db.exec('ROLLBACK');
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
completed(root) {
|
|
153
|
+
const row = this.db.prepare('SELECT state FROM grid_roots WHERE root_z=? AND root_x=? AND root_y=?')
|
|
154
|
+
.get(rootZ, root.x, root.y);
|
|
155
|
+
return row?.state === 'completed';
|
|
156
|
+
}
|
|
157
|
+
start(root) {
|
|
158
|
+
const now = Date.now();
|
|
159
|
+
this.db.prepare(`UPDATE grid_roots SET state='running',attempts=attempts+1,last_error=NULL,
|
|
160
|
+
started_at=?,heartbeat_at=? WHERE root_z=? AND root_x=? AND root_y=?`).run(now, now, rootZ, root.x, root.y);
|
|
161
|
+
}
|
|
162
|
+
fail(root, error) {
|
|
163
|
+
const now = Date.now();
|
|
164
|
+
this.db.prepare(`UPDATE grid_roots SET state='failed',last_error=?,heartbeat_at=?
|
|
165
|
+
WHERE root_z=? AND root_x=? AND root_y=?`).run(error, now, rootZ, root.x, root.y);
|
|
166
|
+
}
|
|
167
|
+
commitRoot(root, rects, tiles) {
|
|
168
|
+
const now = Date.now();
|
|
169
|
+
const rectangles = encodeRectangles(rects);
|
|
170
|
+
const checksum = createHash('sha256').update(rectangles).digest('hex');
|
|
171
|
+
this.db.exec('BEGIN');
|
|
172
|
+
try {
|
|
173
|
+
for (let z = rootZ; z <= materializedZMax; z++) {
|
|
174
|
+
const scale = 2 ** (z - rootZ);
|
|
175
|
+
this.db.prepare(`DELETE FROM tiles WHERE zoom_level=? AND tile_column>=? AND tile_column<?
|
|
176
|
+
AND tile_row>=? AND tile_row<?`).run(z, root.x * scale, (root.x + 1) * scale, xyzYToTmsY(z, (root.y + 1) * scale - 1), xyzYToTmsY(z, root.y * scale) + 1);
|
|
177
|
+
this.db.prepare(`DELETE FROM tile_meta WHERE zoom_level=? AND tile_column>=? AND tile_column<?
|
|
178
|
+
AND tile_row>=? AND tile_row<?`).run(z, root.x * scale, (root.x + 1) * scale, xyzYToTmsY(z, (root.y + 1) * scale - 1), xyzYToTmsY(z, root.y * scale) + 1);
|
|
179
|
+
}
|
|
180
|
+
const insertMeta = this.db.prepare(`INSERT OR REPLACE INTO tile_meta(
|
|
181
|
+
zoom_level,tile_column,tile_row,layer_mask,strat_summary,fetched_at,source_kind,derivation_source_z)
|
|
182
|
+
VALUES(?,?,?,?,?,?,?,?)`);
|
|
183
|
+
for (const tile of tiles) {
|
|
184
|
+
const tmsY = xyzYToTmsY(tile.z, tile.y);
|
|
185
|
+
this.insertTile.run(tile.z, tile.x, tmsY, tile.png);
|
|
186
|
+
insertMeta.run(tile.z, tile.x, tmsY, 1, 'official-grid-z12', now, 'derived-grid', null);
|
|
187
|
+
}
|
|
188
|
+
this.db.prepare(`UPDATE grid_roots SET state='completed',rect_count=?,rectangles=?,rectangles_sha256=?,
|
|
189
|
+
content_tiles=?,last_error=NULL,finished_at=?,heartbeat_at=?
|
|
190
|
+
WHERE root_z=? AND root_x=? AND root_y=?`).run(rects.length, rectangles, checksum, tiles.length, now, now, rootZ, root.x, root.y);
|
|
191
|
+
this.db.exec('COMMIT');
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
this.db.exec('ROLLBACK');
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
summary() {
|
|
199
|
+
const rows = this.db.prepare(`SELECT state,COUNT(*) count,COALESCE(SUM(rect_count),0) rectangles,
|
|
200
|
+
COALESCE(SUM(content_tiles),0) content_tiles FROM grid_roots GROUP BY state`).all();
|
|
201
|
+
const result = { pending: 0, running: 0, completed: 0, failed: 0, rectangles: 0, contentTiles: 0 };
|
|
202
|
+
for (const row of rows) {
|
|
203
|
+
if (row.state === 'pending')
|
|
204
|
+
result.pending = row.count;
|
|
205
|
+
else if (row.state === 'running')
|
|
206
|
+
result.running = row.count;
|
|
207
|
+
else if (row.state === 'completed')
|
|
208
|
+
result.completed = row.count;
|
|
209
|
+
else if (row.state === 'failed')
|
|
210
|
+
result.failed = row.count;
|
|
211
|
+
result.rectangles += row.rectangles;
|
|
212
|
+
result.contentTiles += row.content_tiles;
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
failedRoots() {
|
|
217
|
+
return this.db.prepare(`SELECT root_x x,root_y y FROM grid_roots WHERE state IN ('failed','running') ORDER BY root_y,root_x`).all();
|
|
218
|
+
}
|
|
219
|
+
retainSourceZoom() {
|
|
220
|
+
this.db.exec('BEGIN');
|
|
221
|
+
try {
|
|
222
|
+
this.db.prepare('DELETE FROM tiles WHERE zoom_level<>?').run(materializedZMax);
|
|
223
|
+
this.db.prepare('DELETE FROM tile_meta WHERE zoom_level<>?').run(materializedZMax);
|
|
224
|
+
this.db.exec('COMMIT');
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
this.db.exec('ROLLBACK');
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
countsByZoom() {
|
|
232
|
+
return this.db.prepare('SELECT zoom_level z,COUNT(*) count FROM tiles GROUP BY zoom_level ORDER BY zoom_level').all();
|
|
233
|
+
}
|
|
234
|
+
optimize() {
|
|
235
|
+
this.db.exec('PRAGMA optimize');
|
|
236
|
+
}
|
|
237
|
+
close() {
|
|
238
|
+
this.db.close();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function fetchSourceMask(fetcher, token, root, signal) {
|
|
242
|
+
let lastError;
|
|
243
|
+
for (let attempt = 0; attempt < DEFAULTS.retryMax; attempt++) {
|
|
244
|
+
try {
|
|
245
|
+
return await fetchOfficialSupertileMask({ fetcher, token, z: rootZ, x: root.x, y: root.y, signal }, sourceSize);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
lastError = error;
|
|
249
|
+
if (signal.aborted)
|
|
250
|
+
throw signal.reason;
|
|
251
|
+
if (attempt + 1 < DEFAULTS.retryMax)
|
|
252
|
+
await new Promise(resolve => setTimeout(resolve, 1_000 * (attempt + 1)));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
throw lastError;
|
|
256
|
+
}
|
|
257
|
+
async function materializeRoot(rects, root) {
|
|
258
|
+
const sourceExtent = { sourceZ: materializedZMax, parentZ: rootZ, parentX: root.x, parentY: root.y, width: sourceSize };
|
|
259
|
+
const lines = geographicGridLines(sourceExtent);
|
|
260
|
+
const model = { rects, xLines: lines.xLines, yLines: lines.yLines };
|
|
261
|
+
const encodeLimit = pLimit(8);
|
|
262
|
+
const encoded = [];
|
|
263
|
+
for (const z of [materializedZMax]) {
|
|
264
|
+
const tilesPerSide = 2 ** (z - rootZ);
|
|
265
|
+
const size = tilesPerSide * 256;
|
|
266
|
+
const canvas = renderGeographicGrid(model, sourceSize, size);
|
|
267
|
+
const jobs = [];
|
|
268
|
+
for (let localY = 0; localY < tilesPerSide; localY++)
|
|
269
|
+
for (let localX = 0; localX < tilesPerSide; localX++) {
|
|
270
|
+
const mask = extractMask(canvas, size, localX, localY);
|
|
271
|
+
if (!maskHasContent(mask))
|
|
272
|
+
continue;
|
|
273
|
+
jobs.push(encodeLimit(async () => {
|
|
274
|
+
const png = await encodeMask(mask);
|
|
275
|
+
if (png)
|
|
276
|
+
encoded.push({
|
|
277
|
+
z,
|
|
278
|
+
x: root.x * tilesPerSide + localX,
|
|
279
|
+
y: root.y * tilesPerSide + localY,
|
|
280
|
+
png,
|
|
281
|
+
});
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
await Promise.all(jobs);
|
|
285
|
+
}
|
|
286
|
+
return encoded;
|
|
287
|
+
}
|
|
288
|
+
export async function runGridCrawl(args) {
|
|
289
|
+
validateOptions(args);
|
|
290
|
+
const auth = JSON.parse(readFileSync(args.auth, 'utf8'));
|
|
291
|
+
if (!auth.sessionToken)
|
|
292
|
+
throw new Error('persisted UOM session is unavailable');
|
|
293
|
+
const lock = acquireSqliteLease(args.db, 'writer');
|
|
294
|
+
try {
|
|
295
|
+
initializeUomtiles(args.db, auth.username || null);
|
|
296
|
+
setTaskState(args.db, 'incomplete', { publisher: auth.username || null, startedAt: new Date().toISOString() });
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
lock.release();
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
const database = new GridDatabase(args.db);
|
|
303
|
+
const token = new TokenStore({ sessionToken: auth.sessionToken, mapToken: auth.mapToken, mapTokenExpiresAt: auth.mapTokenExpiresAt });
|
|
304
|
+
const fetcher = new UomFetcher(args.qps);
|
|
305
|
+
const shutdown = new AbortController();
|
|
306
|
+
let stopping = false;
|
|
307
|
+
let leaseFailure = null;
|
|
308
|
+
const stop = (reason = new Error('grid crawl stopped')) => {
|
|
309
|
+
if (stopping)
|
|
310
|
+
return;
|
|
311
|
+
stopping = true;
|
|
312
|
+
shutdown.abort(reason);
|
|
313
|
+
console.error('[grid-crawl] graceful stop requested');
|
|
314
|
+
};
|
|
315
|
+
process.once('SIGINT', () => stop());
|
|
316
|
+
process.once('SIGTERM', () => stop());
|
|
317
|
+
const assertWriter = () => {
|
|
318
|
+
try {
|
|
319
|
+
lock.heartbeat();
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
if (!leaseFailure) {
|
|
323
|
+
leaseFailure = new Error('SQLite lease lost; refusing further task writes', { cause: error });
|
|
324
|
+
console.error(`[grid-crawl] ${leaseFailure.message}`);
|
|
325
|
+
stop(leaseFailure);
|
|
326
|
+
}
|
|
327
|
+
throw leaseFailure;
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
const roots = args.root ? [args.root] : rootsForChina();
|
|
331
|
+
database.initializeRoots(roots);
|
|
332
|
+
database.setMetadata({
|
|
333
|
+
name: 'UOM-shifei-geographic-grid',
|
|
334
|
+
type: 'overlay',
|
|
335
|
+
version: new Date().toISOString().slice(0, 10),
|
|
336
|
+
format: 'png',
|
|
337
|
+
minzoom: '0',
|
|
338
|
+
maxzoom: '18',
|
|
339
|
+
bounds: `${CHINA_BBOX_LL.lonMin},${CHINA_BBOX_LL.latMin},${CHINA_BBOX_LL.lonMax},${CHINA_BBOX_LL.latMax}`,
|
|
340
|
+
attribution: 'CAAC UOM',
|
|
341
|
+
source_zoom: String(args.sourceZ),
|
|
342
|
+
stored_zoom: String(materializedZMax),
|
|
343
|
+
publish_maxzoom: '14',
|
|
344
|
+
source_method: 'official-z9-bbox-z12-supertile-2048',
|
|
345
|
+
geographic_grid_level: String(GEOGRAPHIC_GRID_LEVEL),
|
|
346
|
+
canonical_geometry: 'global-equal-lat-lon-grid-orthogonal-rectangles',
|
|
347
|
+
canonical_maxzoom: 'unbounded-by-source-raster',
|
|
348
|
+
validation_report: '/tmp/uom-grid-regions-20260820/report.json',
|
|
349
|
+
crawl_started_at: new Date().toISOString(),
|
|
350
|
+
});
|
|
351
|
+
const startedAt = Date.now();
|
|
352
|
+
const completedAtStart = database.summary().completed;
|
|
353
|
+
let lastProgressAt = 0;
|
|
354
|
+
const progress = (force = false) => {
|
|
355
|
+
const now = Date.now();
|
|
356
|
+
if (!force && now - lastProgressAt < 1_000)
|
|
357
|
+
return;
|
|
358
|
+
lastProgressAt = now;
|
|
359
|
+
const summary = database.summary();
|
|
360
|
+
const done = summary.completed;
|
|
361
|
+
const rate = Math.max(0, done - completedAtStart) / Math.max(1, (now - startedAt) / 1000);
|
|
362
|
+
const eta = (roots.length - done) / Math.max(rate, 0.001) * 1000;
|
|
363
|
+
console.log(`[grid-crawl-progress] ${JSON.stringify({
|
|
364
|
+
phase: 'fetch-z12', done, total: roots.length, percent: Math.floor(done / roots.length * 100),
|
|
365
|
+
pending: summary.pending, running: summary.running, failed: summary.failed,
|
|
366
|
+
rectangles: summary.rectangles, contentTiles: summary.contentTiles,
|
|
367
|
+
qps: fetcher.ctl.currentQps, inflight: fetcher.ctl.currentInflight,
|
|
368
|
+
rate: Number(rate.toFixed(2)), eta: formatDuration(eta), heartbeatAt: now,
|
|
369
|
+
})}`);
|
|
370
|
+
};
|
|
371
|
+
const heartbeat = setInterval(() => progress(true), 10_000);
|
|
372
|
+
const leaseHeartbeat = setInterval(() => {
|
|
373
|
+
try {
|
|
374
|
+
assertWriter();
|
|
375
|
+
}
|
|
376
|
+
catch {
|
|
377
|
+
// assertWriter records the failure and aborts in-flight work.
|
|
378
|
+
}
|
|
379
|
+
}, 10_000);
|
|
380
|
+
heartbeat.unref();
|
|
381
|
+
leaseHeartbeat.unref();
|
|
382
|
+
async function processRoot(root) {
|
|
383
|
+
database.start(root);
|
|
384
|
+
const signal = AbortSignal.any([shutdown.signal, AbortSignal.timeout(rootDeadlineMs)]);
|
|
385
|
+
try {
|
|
386
|
+
const source = await fetchSourceMask(fetcher, token, root, signal);
|
|
387
|
+
const model = vectorizeGeographicGrid(source, {
|
|
388
|
+
sourceZ: args.sourceZ,
|
|
389
|
+
parentZ: rootZ,
|
|
390
|
+
parentX: root.x,
|
|
391
|
+
parentY: root.y,
|
|
392
|
+
width: sourceSize,
|
|
393
|
+
});
|
|
394
|
+
const tiles = await materializeRoot(model.rects, root);
|
|
395
|
+
assertWriter();
|
|
396
|
+
database.commitRoot(root, model.rects, tiles);
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
400
|
+
if (!leaseFailure)
|
|
401
|
+
database.fail(root, message);
|
|
402
|
+
if (!stopping)
|
|
403
|
+
console.error(`[grid-crawl] failed z9/${root.x}/${root.y}: ${message}`);
|
|
404
|
+
}
|
|
405
|
+
finally {
|
|
406
|
+
progress();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
let completed = false;
|
|
410
|
+
try {
|
|
411
|
+
await token.getMapToken(shutdown.signal);
|
|
412
|
+
let queue = roots.filter(root => !args.resume || !database.completed(root));
|
|
413
|
+
let pass = 0;
|
|
414
|
+
while (!stopping && queue.length > 0 && pass < maxRootPasses) {
|
|
415
|
+
pass++;
|
|
416
|
+
console.log(`[grid-crawl] pass=${pass} roots=${queue.length} db=${args.db}`);
|
|
417
|
+
let cursor = 0;
|
|
418
|
+
await Promise.all(Array.from({ length: Math.min(args.rootConcurrency, queue.length) }, async () => {
|
|
419
|
+
while (!stopping) {
|
|
420
|
+
const root = queue[cursor++];
|
|
421
|
+
if (!root)
|
|
422
|
+
return;
|
|
423
|
+
await processRoot(root);
|
|
424
|
+
}
|
|
425
|
+
}));
|
|
426
|
+
if (stopping)
|
|
427
|
+
break;
|
|
428
|
+
queue = database.failedRoots();
|
|
429
|
+
if (queue.length > 0) {
|
|
430
|
+
if (pass >= maxRootPasses)
|
|
431
|
+
break;
|
|
432
|
+
const retryDelay = Math.min(30_000, pass * 5_000);
|
|
433
|
+
console.error(`[grid-crawl] ${queue.length} roots will be retried after ${retryDelay}ms (pass ${pass}/${maxRootPasses})`);
|
|
434
|
+
await new Promise(resolve => setTimeout(resolve, retryDelay));
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (!stopping && queue.length > 0)
|
|
438
|
+
throw new Error(`抓取在 ${maxRootPasses} 轮后仍有 ${queue.length} 个网格失败;请稍后手动继续`);
|
|
439
|
+
progress(true);
|
|
440
|
+
if (leaseFailure)
|
|
441
|
+
throw leaseFailure;
|
|
442
|
+
if (!stopping) {
|
|
443
|
+
database.retainSourceZoom();
|
|
444
|
+
assertWriter();
|
|
445
|
+
database.setMetadata({
|
|
446
|
+
crawl_finished_at: new Date().toISOString(),
|
|
447
|
+
grid_root_count: String(roots.length),
|
|
448
|
+
grid_root_completed: String(database.summary().completed),
|
|
449
|
+
});
|
|
450
|
+
database.optimize();
|
|
451
|
+
completed = true;
|
|
452
|
+
console.log(`[grid-crawl] COMPLETE ${JSON.stringify({ db: args.db, roots: database.summary(), tiles: database.countsByZoom() })}`);
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
process.exitCode = 130;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
finally {
|
|
459
|
+
clearInterval(heartbeat);
|
|
460
|
+
clearInterval(leaseHeartbeat);
|
|
461
|
+
database.close();
|
|
462
|
+
await fetcher.close();
|
|
463
|
+
token.close();
|
|
464
|
+
try {
|
|
465
|
+
if (!leaseFailure) {
|
|
466
|
+
setTaskState(args.db, completed ? 'completed' : 'incomplete', completed ? { finishedAt: new Date().toISOString() } : {});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
finally {
|
|
470
|
+
try {
|
|
471
|
+
lock.release();
|
|
472
|
+
}
|
|
473
|
+
finally {
|
|
474
|
+
removeSqliteSidecars(args.db);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { decodeCanonicalAlphaMask, encodeCanonicalMask } from "./core/png.js";
|
|
2
|
+
export async function decodeMask(png) {
|
|
3
|
+
if (!png)
|
|
4
|
+
return new Uint8Array(256 * 256);
|
|
5
|
+
return decodeCanonicalAlphaMask(png, 256);
|
|
6
|
+
}
|
|
7
|
+
export function maskHasContent(mask) {
|
|
8
|
+
return mask.some(value => value !== 0);
|
|
9
|
+
}
|
|
10
|
+
export async function encodeMask(mask) {
|
|
11
|
+
if (mask.length !== 256 * 256)
|
|
12
|
+
throw new RangeError('mask must be 256x256');
|
|
13
|
+
if (!maskHasContent(mask))
|
|
14
|
+
return null;
|
|
15
|
+
return encodeCanonicalMask(mask);
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DEFAULTS, OFFICIAL_WMS_LAYER_GROUPS, STYLE_NAME, WMS_PATH } from "./config.js";
|
|
2
|
+
import { tileToMercBBox } from "./bbox.js";
|
|
3
|
+
import { decodeUomAlphaMask } from "./core/png.js";
|
|
4
|
+
function officialGroupPath(codes, z, x, y, token, size) {
|
|
5
|
+
const bbox = tileToMercBBox(z, x, y);
|
|
6
|
+
const layers = codes.map(code => `QGSFKYFW:sf${code}`);
|
|
7
|
+
const query = new URLSearchParams({
|
|
8
|
+
token, service: 'WMS', request: 'GetMap', layers: layers.join(','), styles: layers.map(() => STYLE_NAME).join(','),
|
|
9
|
+
format: 'image/png8', transparent: 'true', version: '1.1.0', srs: 'EPSG:3857', width: String(size), height: String(size),
|
|
10
|
+
bbox: `${bbox.minx},${bbox.miny},${bbox.maxx},${bbox.maxy}`,
|
|
11
|
+
});
|
|
12
|
+
return `${WMS_PATH}?${query}`;
|
|
13
|
+
}
|
|
14
|
+
async function fetchGroup(options, codes, size) {
|
|
15
|
+
let token = await options.token.getMapToken(options.signal);
|
|
16
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
17
|
+
const response = await options.fetcher.get(officialGroupPath(codes, options.z, options.x, options.y, token, size), {
|
|
18
|
+
timeoutMs: Math.max(DEFAULTS.perLayerTimeoutMs, size / 256 * 5_000), signal: options.signal,
|
|
19
|
+
headers: { Accept: 'image/png,image/*;q=0.8,*/*;q=0.5', Referer: 'https://uom.caac.gov.cn/web_pub/spaceIndex' },
|
|
20
|
+
});
|
|
21
|
+
if (response.status === 200 && response.contentType?.startsWith('image/png'))
|
|
22
|
+
return decodeUomAlphaMask(response.body, size);
|
|
23
|
+
let rejected = response.status === 401 || response.status === 403;
|
|
24
|
+
if (response.status === 200 && response.contentType?.startsWith('application/json')) {
|
|
25
|
+
try {
|
|
26
|
+
rejected = JSON.parse(response.body.toString('utf8')).code === 401;
|
|
27
|
+
}
|
|
28
|
+
catch { }
|
|
29
|
+
}
|
|
30
|
+
if (rejected && attempt === 0) {
|
|
31
|
+
options.token.invalidate();
|
|
32
|
+
token = await options.token.getMapToken(options.signal);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`UOM official WMS failed status=${response.status} type=${response.contentType ?? 'none'} bytes=${response.body.length}`);
|
|
36
|
+
}
|
|
37
|
+
throw new Error('UOM official WMS token refresh failed');
|
|
38
|
+
}
|
|
39
|
+
export async function fetchOfficialSupertileMask(options, size) {
|
|
40
|
+
if (options.z !== 9)
|
|
41
|
+
throw new RangeError('production supertile roots must be z9');
|
|
42
|
+
if (![256, 512, 1024, 2048, 4096].includes(size))
|
|
43
|
+
throw new RangeError('unsupported official supertile size');
|
|
44
|
+
const groups = await Promise.all(OFFICIAL_WMS_LAYER_GROUPS.map(codes => fetchGroup(options, codes, size)));
|
|
45
|
+
const mask = new Uint8Array(size * size);
|
|
46
|
+
for (const group of groups)
|
|
47
|
+
for (let i = 0; i < mask.length; i++)
|
|
48
|
+
if (group[i])
|
|
49
|
+
mask[i] = 1;
|
|
50
|
+
return mask;
|
|
51
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Reconstruct one 256px parent from four 256px XYZ children. */
|
|
2
|
+
export function deriveParentMask(children) {
|
|
3
|
+
if (children.length !== 4)
|
|
4
|
+
throw new RangeError('exactly four children are required');
|
|
5
|
+
const big = new Uint8Array(512 * 512);
|
|
6
|
+
const offsets = [[0, 0], [256, 0], [0, 256], [256, 256]];
|
|
7
|
+
for (let index = 0; index < children.length; index++) {
|
|
8
|
+
const child = children[index];
|
|
9
|
+
if (!child)
|
|
10
|
+
continue;
|
|
11
|
+
if (child.length !== 256 * 256)
|
|
12
|
+
throw new RangeError('child mask must be 256x256');
|
|
13
|
+
const [offsetX, offsetY] = offsets[index];
|
|
14
|
+
for (let y = 0; y < 256; y++) {
|
|
15
|
+
big.set(child.subarray(y * 256, y * 256 + 256), (offsetY + y) * 512 + offsetX);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const parent = new Uint8Array(256 * 256);
|
|
19
|
+
for (let y = 0; y < 256; y++) {
|
|
20
|
+
for (let x = 0; x < 256; x++) {
|
|
21
|
+
const sx = x * 2;
|
|
22
|
+
const sy = y * 2;
|
|
23
|
+
parent[y * 256 + x] = big[sy * 512 + sx]
|
|
24
|
+
| big[sy * 512 + sx + 1]
|
|
25
|
+
| big[(sy + 1) * 512 + sx]
|
|
26
|
+
| big[(sy + 1) * 512 + sx + 1];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return parent;
|
|
30
|
+
}
|