Comments (5)
@Brilliant-orange I faced the same problem. Unzipping generated tiles solved the issue for me.
from cesium-terrain-builder.
@Brilliant-orange I faced the same problem. Unzipping generated tiles solved the issue for me.
@bingo-soft
Would you mind tell us how did you do that?
I have this problem and i don't know how to unzip terrain files.
thanks.
from cesium-terrain-builder.
写.terrain时,不能用gzwrite,那样写不出正确的.terrain,而是用fwrite方式.
修正如下:在terraintile.cpp中改写
void Terrain::writeFile(const char fileName) const
{
FILE terrainFile = fopen(fileName, "wb");
if (terrainFile == NULL) {
throw CTBException("Failed to open file");
}
// Write the height data,float应该是4 * TILE_CELL_SIZE
//if (gzwrite(terrainFile, mHeights.data(), TILE_CELL_SIZE * 2) == 0)
if (fwrite( mHeights.data(), sizeof(i_terrain_height),TILE_CELL_SIZE, terrainFile) == 0)
{
fclose(terrainFile);
throw CTBException("Failed to write height data");
}
// Write the child flags
if (fputc(mChildren,terrainFile ) == -1) {
fclose(terrainFile);
throw CTBException("Failed to write child flags");
}
// Write the water mask
if (fwrite(mMask,sizeof(char), mMaskLength,terrainFile ) == 0) {
fclose(terrainFile);
throw CTBException("Failed to write water mask");
}
fclose(terrainFile);
}
/*
void Terrain::writeFile(const char *fileName) const
{
gzFile terrainFile = gzopen(fileName, "wb");
if (terrainFile == NULL) {
throw CTBException("Failed to open file");
}
// Write the height data,float应该是4 * TILE_CELL_SIZE
//if (gzwrite(terrainFile, mHeights.data(), TILE_CELL_SIZE * 2) == 0)
if (gzwrite(terrainFile, mHeights.data(), TILE_CELL_SIZE * sizeof(i_terrain_height)) == 0)
{
gzclose(terrainFile);
throw CTBException("Failed to write height data");
}
// Write the child flags
if (gzputc(terrainFile, mChildren) == -1) {
gzclose(terrainFile);
throw CTBException("Failed to write child flags");
}
// Write the water mask
if (gzwrite(terrainFile, mMask, mMaskLength) == 0) {
gzclose(terrainFile);
throw CTBException("Failed to write water mask");
}
// Try and close the file
switch (gzclose(terrainFile)) {
case Z_OK:
break;
case Z_STREAM_ERROR:
case Z_ERRNO:
case Z_MEM_ERROR:
case Z_BUF_ERROR:
default:
throw CTBException("Failed to close file");
}
}
from cesium-terrain-builder.
@Brilliant-orange I faced the same problem. Unzipping generated tiles solved the issue for me.
hello?how to unzip the .terrain file?
from cesium-terrain-builder.
@Brilliant-orange I faced the same problem. Unzipping generated tiles solved the issue for me.
hello?how to unzip the .terrain file?
from cesium-terrain-builder.
Related Issues (20)
- Error tiling with output format set to Leveller
- Can't change terrain tile size from 65x65 to 256x256
- GDALOpenEx - not found Windows build HOT 1
- ctb.dll not found Windows HOT 2
- Trouble building with CMAKE: GDAL not found
- ERROR 1: PROJ: webmerc: Invalid latitude HOT 1
- Resume is not a valid parameter anymore
- quantized-mesh tiles has no “metadata” extension HOT 5
- empty tiles
- undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)' HOT 10
- Terrain pyramid getting created outside of dataset bounds HOT 1
- The command line ran successfully, but was not generated file "layer.json"? HOT 1
- Error while running make install HOT 4
- Cesium Terrain generated using DSM is way higher than the base map
- Cesium is not rendered after reaching level 4 terrain HOT 1
- Can not add the terrain data in cesium HOT 17
- Possibility to merge several regions with different resolutions? HOT 1
- Tile coordinates are not consistent with Google or TMS standard
- @alienatorZ , @aberenyi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium-terrain-builder.