freegis / dem2terrain Goto Github PK
View Code? Open in Web Editor NEW根据dem数据生成地形切片的工具
License: BSD 3-Clause "New" or "Revised" License
根据dem数据生成地形切片的工具
License: BSD 3-Clause "New" or "Revised" License
npm install
出现以下错误是什么原因:
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code 2
npm ERR! path /dem2terrain/node_modules/gdal-async
npm ERR! command failed
npm ERR! command sh -c -- node-pre-gyp install --fallback-to-build -j max && echo 'If you are using gdal-async, please do not forget that I am living below the poverty line because of the extortion.
npm ERR! sh: 1: Syntax error: Unterminated quoted string
环境:Ubuntu 20.04 | Node 16 | GDAL 3.5.2
大佬你好,出现这个问题难道是我没有C++环境造成的么?
D:\>cd dem2terrain
D:\dem2terrain>cnpm install && cnpm link
√ Installed 6 packages on D:\dem2terrain
√ Linked 136 latest versions fallback to D:\dem2terrain\node_modules\.store\node_modules
[1/3] scripts.postinstall [email protected] › es5-ext@^0.10.61 run " node -e \"try{require('./_postinstall')}catch(e){}\" || exit 0", root: "D:\\dem2terrain\\node_modules\\.store\\[email protected]\\node_modules\\es5-ext"
[1/3] scripts.postinstall [email protected] › es5-ext@^0.10.61 finished in 317ms
[2/3] scripts.install @mapbox/[email protected] › sqlite3@^5.0.0 run "node-pre-gyp install --fallback-to-build", root: "D:\\dem2terrain\\node_modules\\.store\\[email protected]\\node_modules\\sqlite3"
node-pre-gyp http GET https://cdn.npmmirror.com/binaries/sqlite3/v5.1.4/napi-v6-win32-unknown-x64.tar.gz
[sqlite3] Success: "D:\dem2terrain\node_modules\.store\[email protected]\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node" is installed via remote
[2/3] scripts.install @mapbox/[email protected] › sqlite3@^5.0.0 finished in 722ms
[3/3] scripts.install gdal-async@^3.5.1 run "node-pre-gyp install --fallback-to-build -j max && echo 'I am currently unemployed and looking for work. Please, consider hiring me if you like and use gdal-async. Check https://github.com/mmomtchev to what I do and what is my current situation.'", root: "D:\\dem2terrain\\node_modules\\.store\\[email protected]\\node_modules\\gdal-async"
node-pre-gyp http GET https://cdn.npmmirror.com/binaries/node-gdal-async/v3.6.2/node-v93-win32-x64.tar.gz
[gdal-async] Success: "D:\dem2terrain\node_modules\.store\[email protected]\node_modules\gdal-async\lib\binding\node-v93-win32-x64\gdal.node" is installed via remote
'I am currently unemployed and looking for work. Please, consider hiring me if you like and use gdal-async. Check https://github.com/mmomtchev to what I do and what is my current situation.'
[3/3] scripts.install gdal-async@^3.5.1 finished in 2s
√ Run 3 scripts
deprecate @mapbox/[email protected] › [email protected] › [email protected] › [email protected] › [email protected] › @npmcli/move-file@^1.0.1 This functionality has been moved to @npmcli/fs
Recently updated (since 2023-01-29): 3 packages (detail see file D:\dem2terrain\node_modules\.recently_updates.txt)
Today:
→ [email protected] › [email protected] › @types/node@*(18.11.19) (07:02:40)
√ All packages installed (147 packages installed from npm registry, used 21s(network 19s), speed 2.22MB/s, json 87(821.23KB), tarball 40.74MB, manifests cache hit 49, etag hit 49 / miss 4)
added 1 package in 905ms
D:\dem2terrain>dem2terrain -f d://dem2terrain/config.json
>> 开始转换...
- 输入文件: D:\dem2terrain\广东省.tif
- 输出路径: D:\dem2terrain\data\tile
- Tile适用坐标系: EPSG:3857
- 瓦片编码: mapbox(raster-dem)
- 瓦片尺寸: 256 px
- 瓦片等级: 5 至 13 级
>> 步骤1: 清空输出文件夹 - 完成
D:\dem2terrain\node_modules\.store\[email protected]\node_modules\gdal-async\lib\gdal.js:712
return read.apply(this, mangleRead(arguments))
^
Error: Array length must be greater than or equal to -281759359
at RasterBandPixels.read (D:\dem2terrain\node_modules\.store\[email protected]\node_modules\gdal-async\lib\gdal.js:712:17)
at encodeDataset (D:\dem2terrain\src\index.js:111:24)
at main (D:\dem2terrain\src\index.js:275:19)
at Object.<anonymous> (D:\dem2terrain\bin\dem2terrain.js:70:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
config.json文件:
{
"zoom":"5-13",
"epsg": 3857,
"size": 256,
"encoding": "mapbox",
"input": "./广东省.tif",
"output": "./data/tile",
"clean": true
}
//terrain.config.js
module.exports={
input:'path/test.tiff',
clean:true,
epsg:3857,
size:256,
zooms:[0,13],
.......
}
such as :
dem2terrain -config ./terrain.config.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.