jimmyangel / sampleterrain Goto Github PK
View Code? Open in Web Editor NEWUpdate coordinates of a GeoJSON file with sampled elevation data from Cesium Terrain Provider
License: MIT License
Update coordinates of a GeoJSON file with sampled elevation data from Cesium Terrain Provider
License: MIT License
Hi @jimmyangel,
When I was running the example command node sampleterrain.js -f ./sampledata/test1.json > sampled.json
, I got the following error:
Sample terrain error RequestErrorEvent {
statusCode: 401,
response: IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: [Object], tail: [Object], length: 1 },
length: 62,
pipes: null,
pipesCount: 0,
flowing: null,
ended: true,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: true,
decoder: null,
encoding: null,
[Symbol(kPaused)]: null
},
......
}
How can I fix it? Thanks a lot
Oliver
Hi @jimmyangel,
I got the following error:
node sampleterrain.js -f data.json -t 'my Cesium Ion token' > sampled.json
Sample terrain error TypeError: Cannot read property 'toFixed' of undefined
at /home/geostud/oliverProjects/sampleterrain-master/lib/index.js:39:119
at Array.forEach (<anonymous>)
at /home/geostud/oliverProjects/sampleterrain-master/lib/index.js:37:19
at Promise$1.then (/home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12630:36)
at /home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12731:15
at processQueue (/home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:13081:6)
at _resolve (/home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12767:6)
at promiseResolve (/home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12793:13)
at Promise$1.then (/home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12630:36)
at /home/geostud/oliverProjects/sampleterrain-master/node_modules/cesium/Build/CesiumUnminified/Cesium.js:12731:15
This is because the some height values are undefined.
If I take a smaller data.json as input, the code can be executed successfully and smoothly. Hence, I guess this might be relative to my data size? Cesium.sampleTerrain
can not process such an amount of data at the same time?
Oliver
Hi there,
I've used this tool and it works great for me. However, in my clone I have replaced (sampleTerrain) with this new function sampleTerrainMostDetailed. It is better since sometimes the level (default 11) is not available/known for every area.
again, thanks for the nice tool :)
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.