{"_id":"@csi-foxbyte/mesh-dem-to-terrain","_rev":"9-9b6f06ddc92b9e8928763cac754b2afc","name":"@csi-foxbyte/mesh-dem-to-terrain","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@csi-foxbyte/mesh-dem-to-terrain","version":"0.0.1","keywords":["dem","terrain-tiles","cesium","quantized-mesh","heightmap","mesh","dxf","geojson","nodejs","converter","projection","proj4","multithreading","gis","geospatial"],"author":{"name":"Tobias Ganzhorn @Foxbyte"},"license":"LGPL-3.0-or-later","_id":"@csi-foxbyte/mesh-dem-to-terrain@0.0.1","maintainers":[{"name":"foxbyte-nklinke","email":"niklas.klinke@csi-online.de"},{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},{"name":"sherrmann","email":"stefan.herrmann@csi-online.de"}],"homepage":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain","bugs":{"url":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain/issues"},"dist":{"shasum":"8444270f1fc0d4c1a0ff090d4ab78dcc8a97f3b2","tarball":"https://registry.npmjs.org/@csi-foxbyte/mesh-dem-to-terrain/-/mesh-dem-to-terrain-0.0.1.tgz","fileCount":30,"integrity":"sha512-mcNOvQKcwGJipuOwk0TJw8U/n/WXMat6+XgqBjRMHgkUn4VilYaGT1DcBhy6Qd5xB2tQj0R/GzV0QKquqLFwLQ==","signatures":[{"sig":"MEUCIHMqCEIkhcDz5pAip2TdaNh6iXxJ8WlL2A+4pYsZUlEKAiEA1EzUZ9DNpydgLWnGPjBxVNFhAGnjySRkk7/WqgiR6kA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209495},"main":"dist/index.js","type":"module","_from":"file:csi-foxbyte-mesh-dem-to-terrain-0.0.1.tgz","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup","prepublish":"tsup"},"_npmUser":{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},"_resolved":"C:\\Users\\tga\\AppData\\Local\\Temp\\4b678e3bccd59ba559d49a5be0d8efac\\csi-foxbyte-mesh-dem-to-terrain-0.0.1.tgz","_integrity":"sha512-mcNOvQKcwGJipuOwk0TJw8U/n/WXMat6+XgqBjRMHgkUn4VilYaGT1DcBhy6Qd5xB2tQj0R/GzV0QKquqLFwLQ==","repository":{"url":"git+https://github.com/csi-FOXBYTE/mesh-dem-to-terrain.git","type":"git"},"_npmVersion":"10.7.0","description":"A Node.js library that converts DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap) with flexible zoom-level control and multi-threading support.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"tsx":"^4.20.3","glob":"^11.0.3","proj4":"^2.19.5","rbush":"^4.0.1","three":"^0.178.0","yauzl":"^3.2.0","cesium":"^1.131.0","earcut":"^3.0.1","lodash":"^4.17.21","esbuild":"^0.25.5","flatbush":"^4.4.1","delaunator":"^5.0.1","gdal-async":"^3.11.0","proj4-list":"^1.0.4","typescript":"^5.8.3","@types/node":"^24.0.10","slippy-grid":"^2.3.0","@types/rbush":"^4.0.0","@types/three":"^0.178.0","@types/yauzl":"^2.10.3","cli-progress":"^3.12.0","@types/earcut":"^3.0.0","@types/lodash":"^4.17.20","meshoptimizer":"^0.24.0","@types/delaunator":"^5.0.3","@types/cli-progress":"^3.11.6","@gltf-transform/core":"^4.2.0","@gltf-transform/functions":"^4.2.0","@supercharge/promise-pool":"^3.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mesh-dem-to-terrain_0.0.1_1752229596424_0.7255887020523639","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@csi-foxbyte/mesh-dem-to-terrain","version":"0.0.2","keywords":["dem","terrain-tiles","cesium","quantized-mesh","heightmap","mesh","dxf","geojson","nodejs","converter","projection","proj4","multithreading","gis","geospatial"],"author":{"name":"Tobias Ganzhorn @Foxbyte"},"license":"LGPL-3.0-or-later","_id":"@csi-foxbyte/mesh-dem-to-terrain@0.0.2","maintainers":[{"name":"foxbyte-nklinke","email":"niklas.klinke@csi-online.de"},{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},{"name":"sherrmann","email":"stefan.herrmann@csi-online.de"}],"homepage":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain","bugs":{"url":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain/issues"},"dist":{"shasum":"26dd0fb87fcf72adeaa4dfd0aa308182901a6b66","tarball":"https://registry.npmjs.org/@csi-foxbyte/mesh-dem-to-terrain/-/mesh-dem-to-terrain-0.0.2.tgz","fileCount":30,"integrity":"sha512-6FyVRc8nfG3MLA9VAhi9mAi0/J2TXO/g/AbcQ2M1WnafKhHResOuTCgj8hii9M79TZV+TQV+x2uErC+jsDsmvQ==","signatures":[{"sig":"MEYCIQDpw2keH/Q6Ep8YO6JTrJV4xXSHtAJbQ+zH2z0gpehE1gIhAKwEvV1WEOAN1+iPsauf3on84Tfy/phKMyXmLfpPjoeB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":210093},"main":"dist/index.js","type":"module","_from":"file:csi-foxbyte-mesh-dem-to-terrain-0.0.2.tgz","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup","prepublish":"tsup"},"_npmUser":{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},"_resolved":"C:\\Users\\tga\\AppData\\Local\\Temp\\15f0f2bb7c3a4099519b76284d78fc05\\csi-foxbyte-mesh-dem-to-terrain-0.0.2.tgz","_integrity":"sha512-6FyVRc8nfG3MLA9VAhi9mAi0/J2TXO/g/AbcQ2M1WnafKhHResOuTCgj8hii9M79TZV+TQV+x2uErC+jsDsmvQ==","repository":{"url":"git+https://github.com/csi-FOXBYTE/mesh-dem-to-terrain.git","type":"git"},"_npmVersion":"10.7.0","description":"A Node.js library that converts DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap) with flexible zoom-level control and multi-threading support.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"tsx":"^4.20.3","glob":"^11.0.3","proj4":"^2.19.5","rbush":"^4.0.1","three":"^0.178.0","yauzl":"^3.2.0","cesium":"^1.131.0","earcut":"^3.0.1","lodash":"^4.17.21","esbuild":"^0.25.5","flatbush":"^4.4.1","delaunator":"^5.0.1","gdal-async":"^3.11.0","proj4-list":"^1.0.4","typescript":"^5.8.3","@types/node":"^24.0.10","slippy-grid":"^2.3.0","@types/rbush":"^4.0.0","@types/three":"^0.178.0","@types/yauzl":"^2.10.3","cli-progress":"^3.12.0","@types/earcut":"^3.0.0","@types/lodash":"^4.17.20","meshoptimizer":"^0.24.0","@types/delaunator":"^5.0.3","@types/cli-progress":"^3.11.6","@gltf-transform/core":"^4.2.0","@gltf-transform/functions":"^4.2.0","@supercharge/promise-pool":"^3.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mesh-dem-to-terrain_0.0.2_1758090672916_0.43243878239496625","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@csi-foxbyte/mesh-dem-to-terrain","version":"0.0.3","keywords":["dem","terrain-tiles","cesium","quantized-mesh","heightmap","mesh","dxf","geojson","nodejs","converter","projection","proj4","multithreading","gis","geospatial"],"author":{"name":"Tobias Ganzhorn @Foxbyte"},"license":"LGPL-3.0-or-later","_id":"@csi-foxbyte/mesh-dem-to-terrain@0.0.3","maintainers":[{"name":"foxbyte-nklinke","email":"niklas.klinke@csi-online.de"},{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},{"name":"sherrmann","email":"stefan.herrmann@csi-online.de"},{"name":"minnumurali","email":"minnu.murali@csi-online.de"}],"homepage":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain","bugs":{"url":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain/issues"},"dist":{"shasum":"b487a5e7b895fa2a613a784e79af221c84da7658","tarball":"https://registry.npmjs.org/@csi-foxbyte/mesh-dem-to-terrain/-/mesh-dem-to-terrain-0.0.3.tgz","fileCount":30,"integrity":"sha512-l0L1k+AaoRqV1zDCsvTnkt4x4TZlM/I8PGk6l2ZnXEbTEnGBt7IZfAdW8dqCM19612mOP31BCEZTFgATSNfBKQ==","signatures":[{"sig":"MEUCIQD8bxwSJ+4ljkDc0Q1SgVnZv9UBG4jo3FmKFuymggDjAwIgIRGZ4t7lgoIuLIAQx3ZHZx7nHuTZmfqk6kNJz8NlBMU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":210397},"main":"dist/index.js","type":"module","_from":"file:csi-foxbyte-mesh-dem-to-terrain-0.0.3.tgz","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup","prepublish":"tsup"},"_npmUser":{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},"_resolved":"C:\\Users\\tga\\AppData\\Local\\Temp\\766c458335942fa69deb4bfd25d140c6\\csi-foxbyte-mesh-dem-to-terrain-0.0.3.tgz","_integrity":"sha512-l0L1k+AaoRqV1zDCsvTnkt4x4TZlM/I8PGk6l2ZnXEbTEnGBt7IZfAdW8dqCM19612mOP31BCEZTFgATSNfBKQ==","repository":{"url":"git+https://github.com/csi-FOXBYTE/mesh-dem-to-terrain.git","type":"git"},"_npmVersion":"10.7.0","description":"A Node.js library that converts DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap) with flexible zoom-level control and multi-threading support.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"tsx":"^4.20.3","glob":"^11.0.3","proj4":"^2.19.5","rbush":"^4.0.1","three":"^0.178.0","yauzl":"^3.2.0","cesium":"^1.131.0","earcut":"^3.0.1","lodash":"^4.17.21","esbuild":"^0.25.5","flatbush":"^4.4.1","delaunator":"^5.0.1","gdal-async":"^3.11.0","proj4-list":"^1.0.4","typescript":"^5.8.3","@types/node":"^24.0.10","slippy-grid":"^2.3.0","@types/rbush":"^4.0.0","@types/three":"^0.178.0","@types/yauzl":"^2.10.3","cli-progress":"^3.12.0","@types/earcut":"^3.0.0","@types/lodash":"^4.17.20","meshoptimizer":"^0.24.0","@types/delaunator":"^5.0.3","@types/cli-progress":"^3.11.6","@gltf-transform/core":"^4.2.0","@gltf-transform/functions":"^4.2.0","@supercharge/promise-pool":"^3.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mesh-dem-to-terrain_0.0.3_1760363866750_0.9904720530515982","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@csi-foxbyte/mesh-dem-to-terrain","version":"0.0.4","keywords":["dem","terrain-tiles","cesium","quantized-mesh","heightmap","mesh","dxf","geojson","nodejs","converter","projection","proj4","multithreading","gis","geospatial"],"author":{"name":"Tobias Ganzhorn @Foxbyte"},"license":"LGPL-3.0-or-later","_id":"@csi-foxbyte/mesh-dem-to-terrain@0.0.4","maintainers":[{"name":"foxbyte-nklinke","email":"niklas.klinke@csi-online.de"},{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},{"name":"sherrmann","email":"stefan.herrmann@csi-online.de"},{"name":"minnumurali","email":"minnu.murali@csi-online.de"}],"homepage":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain","bugs":{"url":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain/issues"},"dist":{"shasum":"b04ac991982b4b35b8542c0b20f1e42501a5ebe0","tarball":"https://registry.npmjs.org/@csi-foxbyte/mesh-dem-to-terrain/-/mesh-dem-to-terrain-0.0.4.tgz","fileCount":32,"integrity":"sha512-yTxVfGS0Beg947gRXKw1BULOamFiwT828+clAduy9WnFLNGutltg5cpl2FbCv5UAQFwWBv5nEnBRJcnZSCjnXA==","signatures":[{"sig":"MEUCIQC0anY8B4w3j5BW87uAKhR8WoHxX2G3bvsPgb0t8nYnkAIgdXRp+oxl/6iNupEfekUt0L1OVCvhweSH36BUeyewLVY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":213063},"main":"dist/index.js","type":"module","_from":"file:csi-foxbyte-mesh-dem-to-terrain-0.0.4.tgz","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup","prepublish":"tsup"},"_npmUser":{"name":"tobias.ganzhorn.foxbyte","email":"tobias.ganzhorn@csi-online.de"},"_resolved":"C:\\Users\\tga\\AppData\\Local\\Temp\\eeeec4760b6f1a0b70b4ea86621582e8\\csi-foxbyte-mesh-dem-to-terrain-0.0.4.tgz","_integrity":"sha512-yTxVfGS0Beg947gRXKw1BULOamFiwT828+clAduy9WnFLNGutltg5cpl2FbCv5UAQFwWBv5nEnBRJcnZSCjnXA==","repository":{"url":"git+https://github.com/csi-FOXBYTE/mesh-dem-to-terrain.git","type":"git"},"_npmVersion":"10.7.0","description":"A Node.js library that converts DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap) with flexible zoom-level control and multi-threading support.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"tsx":"^4.20.3","glob":"^11.0.3","proj4":"^2.19.5","rbush":"^4.0.1","three":"^0.178.0","yauzl":"^3.2.0","cesium":"^1.131.0","earcut":"^3.0.1","lodash":"^4.17.21","esbuild":"^0.25.5","flatbush":"^4.4.1","delaunator":"^5.0.1","gdal-async":"^3.11.0","proj4-list":"^1.0.4","typescript":"^5.8.3","@types/node":"^24.0.10","slippy-grid":"^2.3.0","@types/rbush":"^4.0.0","@types/three":"^0.178.0","@types/yauzl":"^2.10.3","cli-progress":"^3.12.0","@types/earcut":"^3.0.0","@types/lodash":"^4.17.20","meshoptimizer":"^0.24.0","@types/delaunator":"^5.0.3","@types/cli-progress":"^3.11.6","@gltf-transform/core":"^4.2.0","@gltf-transform/functions":"^4.2.0","@supercharge/promise-pool":"^3.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mesh-dem-to-terrain_0.0.4_1761561553075_0.20279392685634123","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-07-11T10:26:36.318Z","modified":"2026-07-31T07:53:54.423Z","0.0.1":"2025-07-11T10:26:36.621Z","0.0.2":"2025-09-17T06:31:13.131Z","0.0.3":"2025-10-13T13:57:46.971Z","0.0.4":"2025-10-27T10:39:13.274Z"},"bugs":{"url":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain/issues"},"author":{"name":"Tobias Ganzhorn @Foxbyte"},"license":"LGPL-3.0-or-later","homepage":"https://github.com/csi-FOXBYTE/mesh-dem-to-terrain","keywords":["dem","terrain-tiles","cesium","quantized-mesh","heightmap","mesh","dxf","geojson","nodejs","converter","projection","proj4","multithreading","gis","geospatial"],"repository":{"url":"git+https://github.com/csi-FOXBYTE/mesh-dem-to-terrain.git","type":"git"},"description":"A Node.js library that converts DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap) with flexible zoom-level control and multi-threading support.","maintainers":[{"email":"nico.vogel@csi-online.de","name":"foxbyte-nvogel"},{"email":"stefan.herrmann@csi-online.de","name":"sherrmann"}],"readme":"# mesh-dem-to-terrain 🚀🥾\r\n\r\nA Node.js library for converting DEM meshes (DXF, GeoJSON, etc.) into Cesium Terrain Tiles (quantized-mesh or heightmap), with flexible zoom-level control.\r\n\r\n## Table of Contents\r\n\r\n* [Features](#features)\r\n* [Installation](#installation)\r\n* [Usage](#usage)\r\n* [API](#api)\r\n* [Options Overview](#options-overview)\r\n* [CLI Wrapper Example](#cli-wrapper-example)\r\n* [Contributing](#contributing)\r\n\r\n## 🎉 Features\r\n\r\n* **🔄 Preprocess Mesh Archive**: Unpacks and prepares DXF/GeoJSON mesh archives into a working directory, reprojects coordinates using Proj4 strings. 🗺️\r\n* **🗻 Terrain Tile Generation**: Generates Cesium-compatible terrain tiles (quantized-mesh or heightmap) across specified zoom levels. 📈\r\n* **📐 Projection Support**: Accept any Proj4-formatted CRS string for flexible coordinate transformations. ✨\r\n* **📊 Progress Callbacks**: Receive real-time progress updates (percentage or log messages). 📢\r\n* **🧵 Multi-threading**: Customize worker threads for CPU-bound tasks. ⚙️\r\n\r\n## 📥 Installation\r\n\r\n```bash\r\nnpm install mesh-dem-to-terrain\r\n```\r\n\r\n## 💻 Usage\r\n\r\n```js\r\nimport { preprocess, generate } from \"mesh-dem-to-terrain/index.js\";\r\n\r\n(async () => {\r\n  // Step 1: Unpack and reproject your mesh archive 🛠️\r\n  await preprocess(\r\n    \"D:\\\\dxf.zip\",                      // Path to DXF/GeoJSON archive\r\n    \"D:\\\\dxf_test\",                    // Working directory for intermediate files\r\n    console.log,                       // Progress callback (log messages)\r\n    \"+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs\"  // Proj4 CRS string\r\n  );\r\n\r\n  // Step 2: Generate Cesium Terrain Tiles 🌄\r\n  await generate(\r\n    \"D:\\\\dxf_test\",                    // Working directory from preprocess\r\n    (progress) => console.log((progress * 100).toFixed(2), \"%\"),  // Progress callback (percentage)\r\n    { endZoom: 16, startZoom: 0, threadCount: 2 }  // Options: zoom range & threads\r\n  );\r\n})();\r\n```\r\n\r\n## ⚙️ API\r\n\r\n### `preprocess(inputArchive, workDir, progressCallback, proj4String)`\r\n\r\n* **inputArchive** `(string)` – Path to a ZIP archive containing DXF, GeoJSON, or other mesh files. 📂\r\n* **workDir** `(string)` – Directory to extract and preprocess mesh data. 📁\r\n* **progressCallback** `(function)` – Called with log messages or progress updates. 📢\r\n* **proj4String** `(string)` – Proj4-formatted CRS string for coordinate transformation. 🌍\r\n\r\n**Returns:** A promise that resolves when preprocessing is complete. ✅\r\n\r\n### `generate(workDir, progressCallback, options)`\r\n\r\n* **workDir** `(string)` – Directory prepared by `preprocess()`. 📂\r\n* **progressCallback** `(function)` – Called with a number in \\[0,1] indicating progress. 📈\r\n* **options** `(object)`:\r\n\r\n  * `startZoom` `(number)` – Minimum zoom level to generate (default: 0). ↗️\r\n  * `endZoom` `(number)` – Maximum zoom level to generate (required). ↘️\r\n  * `threadCount` `(number)` – Number of worker threads (default: number of CPU cores). 🧵\r\n\r\n**Returns:** A promise that resolves when terrain tile generation is complete. ✅\r\n\r\n## 🛠️ Options Overview\r\n\r\n| Option        | Default            | Description                                |\r\n| ------------- | ------------------ | ------------------------------------------ |\r\n| `startZoom`   | `0`                | Minimum zoom level for generated tiles. ↗️ |\r\n| `endZoom`     | *required*         | Maximum zoom level for generated tiles. ↘️ |\r\n| `threadCount` | `os.cpus().length` | Number of parallel worker threads. 🧵      |\r\n\r\n## 📜 CLI Wrapper Example\r\n\r\nWrap the library in a convenient CLI script:\r\n\r\n```js\r\n#!/usr/bin/env node\r\nimport path from \"path\";\r\nimport { preprocess, generate } from \"mesh-dem-to-terrain/index.js\";\r\n\r\nconst [,, archive, outDir, proj, startZ, endZ, threads] = process.argv;\r\n\r\n(async () => {\r\n  // Preprocess mesh archive 🛠️\r\n  await preprocess(\r\n    path.resolve(archive),\r\n    path.resolve(outDir),\r\n    console.log,\r\n    proj\r\n  );\r\n\r\n  // Generate terrain tiles 🌄\r\n  await generate(\r\n    path.resolve(outDir),\r\n    (p) => console.log(`${(p*100).toFixed(2)} %`),\r\n    {\r\n      startZoom: Number(startZ) || 0,\r\n      endZoom:   Number(endZ) || 16,\r\n      threadCount: Number(threads) || 4\r\n    }\r\n  );\r\n})();\r\n```\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Please open issues or pull requests on the GitHub repository. 🙌\r\n","readmeFilename":"README.md"}