Create terrain server

4412 views
Skip to first unread message

s.se...@gmail.com

unread,
Mar 9, 2013, 4:23:20 AM3/9/13
to cesiu...@googlegroups.com
Hi folks. I have small home server and many srtm data in tiff format. How i can generate tiles which will be supported by CesiumTerrainProvider ? I read this topic:
http://cesium.agi.com/forum.html?place=msg%2Fcesium-dev%2F74a5XriE-eM%2Fjns0RsaWetYJ
May be already exists tools for generation tiles CesiumTerrainProvider format ?

s.se...@gmail.com

unread,
Mar 9, 2013, 5:21:53 AM3/9/13
to cesiu...@googlegroups.com, s.se...@gmail.com

Kevin Ring

unread,
Mar 11, 2013, 10:22:04 AM3/11/13
to cesiu...@googlegroups.com, s.se...@gmail.com
Hi,

I generated the current tile set using a simple tool I wrote.  The tool loads the source terrain data using GDAL (http://www.gdal.org/) and then interpolates heights and writes each tile.  Unfortunately, I can't release the tool, but if you choose to follow a similar path, the format of the Cesium terrain tiles is documented on the wiki (https://github.com/AnalyticalGraphicsInc/cesium/wiki/Cesium-Terrain-Server).  Please be aware that the format can and will change as time goes on, though if I hear of anyone generating their own data in this format I will make sure to maintain backward compatibility in Cesium.

Kevin

s.se...@gmail.com

unread,
Mar 11, 2013, 1:33:09 PM3/11/13
to cesiu...@googlegroups.com, s.se...@gmail.com
Thanks for reply.
May be You can help me with algorithm?
I modify gdal2tiles to generate GTiff in Int16 data type.
Now its generate 256x256 tiles. Them i need scale their to 65x65 ? or already gdal2tiles must generate 65x65 tiles ?
Thanks
PS. Sorry for my english
Message has been deleted

s.se...@gmail.com

unread,
Mar 12, 2013, 2:59:07 PM3/12/13
to cesiu...@googlegroups.com, s.se...@gmail.com
I modify gdal2tiles.py. Now this script generate terrain tiles in cesium format. If somebody needs generate this tile format write me.
Thanks for help.
PS. Cool project. Im very happy what find it =)

Kevin Ring

unread,
Mar 12, 2013, 7:31:30 PM3/12/13
to cesiu...@googlegroups.com, s.se...@gmail.com
Awesome, glad to hear you got it working.  I wouldn't mind taking a look at your modified script, if you don't mind sharing it.

s.se...@gmail.com

unread,
Mar 17, 2013, 4:44:03 AM3/17/13
to cesiu...@googlegroups.com, s.se...@gmail.com
Hi again. Script for generation terrain tiles for Cesium. Its beta, and in this time have many problems. But its worked.
Whats not realized:
1. Whater mask
2. Aprox height on tile borders
3. Split two and more SRTM files( example: srtm_15_08 and srtm_16_08 result at now looks as http://sergeserver.dyndns.org/images/cesium/heightfield3.png
Who knows russian may look this on my site: http://sergeserver.dyndns.org/index.php/programming/python/2-generator-landshafta-dlya-cesium
Script will be update on this site, changes will be posted in this topic.
Download script: http://sergeserver.dyndns.org/index.php/downloads/category/1-scripts?download=2:generator-landshafta-dlya-cesium

Kevin Ring

unread,
Mar 18, 2013, 11:23:36 AM3/18/13
to cesiu...@googlegroups.com, s.se...@gmail.com
Cool, thanks for sharing the script with us!

pim.res...@gmail.com

unread,
Jun 14, 2013, 9:33:06 AM6/14/13
to cesiu...@googlegroups.com, s.se...@gmail.com

the script link is unavailable now. Could you send me(pim.researcher#gmail.com) the script or post it online.

Thanks a lot

Shawn

Kevin Ring

unread,
Jun 14, 2013, 9:38:45 AM6/14/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
Attached.
gdal2srtmtiles.tar.gz

s.se...@gmail.com

unread,
Jun 14, 2013, 12:55:36 PM6/14/13
to cesiu...@googlegroups.com, s.se...@gmail.com
суббота, 9 марта 2013 г., 13:23:20 UTC+4 пользователь s.se...@gmail.com написал:
> Hi folks. I have small home server and many srtm data in tiff format. How i can generate tiles which will be supported by CesiumTerrainProvider ? I read this topic:
> http://cesium.agi.com/forum.html?place=msg%2Fcesium-dev%2F74a5XriE-eM%2Fjns0RsaWetYJ
> May be already exists tools for generation tiles CesiumTerrainProvider format ?

http://sergeserver.dyndns.org/index.php/downloads/category/1-scripts?download=1:gdal2tilessrtm
In near feature will be done new version of this file.

pim.res...@gmail.com

unread,
Jul 18, 2013, 10:24:22 AM7/18/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com

Could you provide an example of the command line?

Thanks,
Shawn

s.se...@gmail.com

unread,
Jul 18, 2013, 12:36:57 PM7/18/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
четверг, 18 июля 2013 г., 18:24:22 UTC+4 пользователь pim.res...@gmail.com написал:
Hi all again. I write new version of script. Download from http://sergeserver.dyndns.org/index.php/downloads/category/1-scripts?download=2:gdal2srtmtiles-with-join-option
Sorry for english, its translate by google )
Original in my native language(russian) and screens may be read on http://sergeserver.dyndns.org/index.php/programming/python/4-generator-landshafta-dlya-cesium-versiya-ii

Whats new:
1. Posted tiles overlap the edges to fit the specification Cesium Terrain Server.
2. Added flag to glue tiles (- join)
3. Laid basic support for water mask
On the second point in more detail. I work with treated SRTM data taken from the server GisLab, this data is based on CGIAR, the only difference is that the mosaic is 5x5 degrees, and the value of NODATA c 255 is replaced by -32678.

So, the flag - join means that the script will first check for the existence of the generated files, and if there are, they will simply supplemented. It used the same script gdal2tiles just overwrite the existing or missing tiles. By the way, this flag can be used to generate raster tiles.
Example, consider two files DEM - srtm_45_04(http://gis-lab.info/data/srtm-tif/srtm_45_04.zip) and srtm_45_05(http://gis-lab.info/data/srtm-tif/srtm_45_05.zip). This two adjacent tile vertically.
For first tile we do gdal2srtmtiles.py --cesium -p geodetic srtm_45_04.tif terrain -z 0-9
We have screen - http://sergeserver.dyndns.org/images/cesium/srtm_45_04.png
For second gdal2srtmtiles.py --cesium -p geodetic srtm_45_05.tif terrain -z 0-9 --join
We have screen - http://sergeserver.dyndns.org/images/cesium/srtm_45_05.png
If you look at what was successful bonding.

With regard to the third point. Now I test your script to process the water mask. For water mask I use lannye SRTM Water Body Data Files (SWBD) that are online HB http://dds.cr.usgs.gov/srtm/version2_1/SWBD/. The algorithm works as follows script as an input parameter the tile DEM (georeferenced), then calculates what the script tiles 1x1 degrees to download http://dds.cr.usgs.gov/srtm/version2_1/SWBD/. The script unpacks the downloaded zip file, rastrizuet them GTiff (input, these tiles have a 1x1 degree shape format), then there is cross-linking of these tiles in a tile 5x5 degrees. When we have the original tile SRTM and ready to grow aquatic mask I do the following I to the basic raster SRTM add another layer (Band) from raster SWBD and generating tiles Cesium Terrain Server when setting a flag - water-mask layer that I will consider the aqueous mask. Has turned out to generate the tile surface with a water mask only for the ground level of tiles, for thumbnail not yet obtained. By the way, SWBD is not only the seas and oceans, but also rivers and lakes.

http://sergeserver.dyndns.org/images/cesium/stm_45_04-sea.png
http://sergeserver.dyndns.org/images/cesium/sertm_45_04-lake.png

pim.res...@gmail.com

unread,
Jul 19, 2013, 8:41:19 AM7/19/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
Hi,
I am going to use ASTER data. refer to, http://gdem.ersdac.jspacesystems.or.jp/search.jsp . Resolution is 30 meters. Is that data compatible to your script?
DEM output format for this data is, GeoTIFF, signed 16 bits, 1m/DN, Referenced to the WSG84/EGM96 geoid, -9999 for void pixels, 0 for sea water body.

Thanks,
Shawn

pim.res...@gmail.com

unread,
Jul 20, 2013, 8:11:40 AM7/20/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
I donwload you test tif files and follow your command line. terrain file is created but terrain shapes were not rendered.

On Friday, July 19, 2013 12:36:57 AM UTC+8, s.se...@gmail.com wrote:

s.se...@gmail.com

unread,
Jul 20, 2013, 9:12:18 AM7/20/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
суббота, 20 июля 2013 г., 16:11:40 UTC+4 пользователь pim.res...@gmail.com написал:
try open script and replace NODATA value from -32768 to you value(-9999). May be ist help you. And how many bands in you raster ?

researcher pim

unread,
Jul 20, 2013, 9:33:30 AM7/20/13
to s.se...@gmail.com, cesiu...@googlegroups.com
I've tried your tiff http://gis-lab.info/data/srtm-tif/srtm_45_04.zip, and your command line, ./gdal2srtmtiles.py --cesium -p geodetic srtm_45_04.tif terrain -z 0-9.  The output terrain files seem not correct. I zipped my output as attachment . Would you check it? BTW, which distro and version of python-gdal are your use.

Thanks,
Shawn 
terrain.tar.gz

pim.res...@gmail.com

unread,
Jul 20, 2013, 10:53:00 AM7/20/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
I got what my problem is. How did you generate 0/0/0.terrain file? By your script, 0/0/0.terrain will not be created. If this file missing, whole global won't be rendered. When I use cesium team generated 0/0/0.terrain, there would be other issue. cesium team generated 0/0/0.terrain determines it have succeed terrain file in level 1, but I don't copy cesium team generated level 1 terrain file. Error pop up. Did your meet this issue before? What's the full steps to reach your screenshot show terrain?

Thanks,
Shawn

s.se...@gmail.com

unread,
Jul 20, 2013, 11:17:58 AM7/20/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
суббота, 20 июля 2013 г., 18:53:00 UTC+4 пользователь pim.res...@gmail.com написал:
I forgot to say, in my example srt_45_04 and srtm_45_05 placed in right from 0 degrees by longitude, and terrain in 0 level in left of 0 degrees by longitude not been generated. By specification in terrain place flags which tiles exists on server, in this time i fill this flags as exists. Try do second, generate terrain from tile srtm_45_04(this tile placed in right from 0 degrees by longitude) and second generate terrain from tile srtm_13_06( this tile placed in north america(Los angeles)(left from 0 degrees by longitude)
gdal2srtmtiles.py --cesium -z 0-9 -p geodetic srtm_45_04.tif terrain
gdal2srtmtiles.py --cesium -z 0-9 -p geodetic srtm_13_06.tif terrain --join
And globe will be rendered full
GDAL 1.8.1, released 2011/07/09
Python 2.7.2
Terrain generated by me from this tiles : http://sergeserver.dyndns.org/phocadownload/terrain.tar.gz
And tile <-> name in globe for google-earth - http://sergeserver.dyndns.org/phocadownload/srtm41.kmz

pim.res...@gmail.com

unread,
Jul 22, 2013, 11:30:28 AM7/22/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
Thanks a lot. Your script worked.
And another tiny issue. I don't find "-32768" in script. I cannot replace it with my value, -9999. How to do this modification?

Thanks,
Shawn

On Saturday, July 20, 2013 9:12:18 PM UTC+8, s.se...@gmail.com wrote:

researcher pim

unread,
Jul 27, 2013, 1:10:22 AM7/27/13
to s.se...@gmail.com, cesiu...@googlegroups.com
Hi,

I tried your script with other dem data. ASTER data, http://gdem.ersdac.jspacesystems.or.jp/search.jsp. I mentioned above. It almost works, can create .terrain files. I load these .terrain files in Cesium, I found some flow here. See screenshot blow. The terrains fall to other at the edge. Could you give any hint about the root cause of this issue?

Inline image 1

Thanks,
Shawn
20130727_125205_0178.png

Ashley Mort

unread,
Aug 7, 2013, 8:09:55 PM8/7/13
to cesiu...@googlegroups.com, s.se...@gmail.com
This script almost works.  When I run it, I keep getting spikes in my terrain which generally go away as I zoom/pan very close to them.  Any ideas on what to do here?
gdal2srtmtiles.py --cesium -z 0-9 -p geodetic srtm_53_07.tif terrain

Ashley Mort

unread,
Aug 9, 2013, 4:30:26 PM8/9/13
to cesiu...@googlegroups.com, s.se...@gmail.com
The spiked terrain is coming about from the lower generated levels (ex: levels 0-8).  In Serge's script to remove the spikes, I commented out the line in generate_overview_tiles: 
"dsquery.WriteRaster( tileposx, tileposy, self.tilesize, self.tilesize, dsquerytile.ReadRaster(0,0,self.tilesize,self.tilesize),band_list=list(range(1,tilebands+1)))".  

Of course this gives all the lower level tiles no value so I still need to find out why I'm getting bad values for the lower level/overview tiles.

s.se...@gmail.com

unread,
Aug 13, 2013, 1:02:37 AM8/13/13
to cesiu...@googlegroups.com, s.se...@gmail.com
суббота, 10 августа 2013 г., 0:30:26 UTC+4 пользователь Ashley Mort написал:
> The spiked terrain is coming about from the lower generated levels (ex: levels 0-8).  In Serge's script to remove the spikes, I commented out the line in generate_overview_tiles: 
> "dsquery.WriteRaster( tileposx, tileposy, self.tilesize, self.tilesize, dsquerytile.ReadRaster(0,0,self.tilesize,self.tilesize),band_list=list(range(1,tilebands+1)))".  
>
>
> Of course this gives all the lower level tiles no value so I still need to find out why I'm getting bad values for the lower level/overview tiles.
>
> On Wednesday, August 7, 2013 7:09:55 PM UTC-5, Ashley Mort wrote:This script almost works.  When I run it, I keep getting spikes in my terrain which generally go away as I zoom/pan very close to them.  Any ideas on what to do here?
> gdal2srtmtiles.py --cesium -z 0-9 -p geodetic srtm_53_07.tif terrain
>
>
>
> https://plus.google.com/photos/102422851817893481221/albums/5909532752528586129/5909532750633265218?banner=pwa&pid=5909532750633265218&oid=102422851817893481221
>
>
>
>
> On Saturday, March 9, 2013 3:23:20 AM UTC-6, s.se...@gmail.com wrote:Hi folks. I have small home server and many srtm data in tiff format. How i can generate tiles which will be supported by CesiumTerrainProvider ? I read this topic:
> http://cesium.agi.com/forum.html?place=msg%2Fcesium-dev%2F74a5XriE-eM%2Fjns0RsaWetYJ
> May be already exists tools for generation tiles CesiumTerrainProvider format ?

Hi all. I try fix this problem on second week. Many work and others problems now.

Martin Guttesen

unread,
Aug 19, 2013, 9:24:10 AM8/19/13
to cesiu...@googlegroups.com, s.se...@gmail.com
I cant get the script to work
if i run it on a srtm3 (.hgt) file i get an index out of range error 

 self.open_input()
  File "C:\OSM\Cesium\gdal2srtmtiles-join\gdal2srtmtiles.py", line 937, in open_
input
    self.out_ds.SetMetadataItem('NODATA_VALUES','%i %i %i' % (self.in_nodata[0],
self.in_nodata[1],self.in_nodata[2]))
IndexError: list index out of range

if i run it on a tif file i get an file exists error 
gdal2srtmtiles.py --cesium -p geodetic N61W008.tif c:\myterrain -z 12 

C:\OSM\Cesium\gdal2srtmtiles-join>gdal2srtmtiles.py --cesium -p geodetic N61W008
.tif c:\mterrain -z 12
Generating Base Tiles:
Traceback (most recent call last):
  File "C:\OSM\Cesium\gdal2srtmtiles-join\gdal2srtmtiles.py", line 2593, in <mod
ule>
    gdal2tiles.process()
  File "C:\OSM\Cesium\gdal2srtmtiles-join\gdal2srtmtiles.py", line 494, in proce
ss
    self.generate_base_tiles()
  File "C:\OSM\Cesium\gdal2srtmtiles-join\gdal2srtmtiles.py", line 1552, in gene
rate_base_tiles
    os.rename(tilefilename + '.new', tilefilename)
WindowsError: [Error 183] En fil, som allerede findes, kan ikke oprettes

deirdr...@magellium.co.uk

unread,
Dec 17, 2013, 7:07:50 AM12/17/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
Hi Kevin.

I'm just looking at getting this script up and running, and am getting some filename issues.

Looking at the code it seems we are creating a .terrain file, then creating .terrain.new file, (which we do stuff with), and then finally we try and rename the .terrain.new file back to the .terrain file, which, not surprisingly, fails for us ('Cannot create a file when that file already exists').

Any ideas? We're looking at the area between 1355 and 1385 (line numbers) in the code from the above script.

Also, there was mention of a new script, do you happen to have this?

Thanks

Deirdre.

Kevin Ring

unread,
Dec 18, 2013, 9:19:50 AM12/18/13
to cesiu...@googlegroups.com
Hi Deirdre,

I haven't used the script myself, so I can't offer much help.  Maybe some other folks that have used it can jump in.

Kevin



--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Arne Schilling

unread,
Dec 18, 2013, 11:19:25 AM12/18/13
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com, deirdr...@magellium.co.uk
I had the same issue on Windows.

Somewhere near the line numbers you mention I have this piece of code

                        # rename files
                        os.rename( tilefilename, tilefilename + '.old' )
                        os.rename( tilefilename + '.new', tilefilename )

It works at least if the directory has been emptied before.
There is also a os.remove operation in Python

Arne

Shengqi Song

unread,
Jan 7, 2014, 10:44:44 AM1/7/14
to cesiu...@googlegroups.com, s.se...@gmail.com
Hi,

Agree with Arne. The Script will work if you change line 1552 similar to "os.rename(tilefilename + '.new', tilefilename+'1')". From the screenshot I found the author use Mac, not Windows. Probably that's the reason of a Windows error  ('Cannot create a file when that file already exists'). I am new to Cesium. My question is how to be used by Cesium after generated the tiles? Kevin, could you give me some instruction? Thanks.

Kevin Ring

unread,
Jan 7, 2014, 10:51:40 AM1/7/14
to cesiu...@googlegroups.com
I haven't used the script, so I'm probably not the best person to answer... but I believe you can just use a CesiumTerrainProvider.  Something like:

viewer.centralBody.terrainProvider = new Cesium.CesiumTerrainProvider({
});

You'll need to make sure that the tile tree is either hosted by the same server that hosts the HTML page, or that the tile server includes CORS headers.

Kevin


On Tue, Jan 7, 2014 at 10:44 AM, Shengqi Song <sshe...@gmail.com> wrote:
Hi,

Agree with Arne. The Script will work if you change line 1552 similar to "os.rename(tilefilename + '.new', tilefilename+'1')". From the screenshot I found the author use Mac, not Windows. Probably that's the reason of a Windows error  ('Cannot create a file when that file already exists'). I am new to Cesium. My question is how to be used by Cesium after generated the tiles? Kevin, could you give me some instruction? Thanks.

--

s.se...@gmail.com

unread,
Jan 8, 2014, 1:12:13 AM1/8/14
to cesiu...@googlegroups.com
вторник, 7 января 2014 г., 19:51:40 UTC+4 пользователь Kevin Ring написал:
Yes, im write and test this script on *nix(MacOsx), on windows this script not tested

Ashley Mort

unread,
Jan 8, 2014, 12:09:48 PM1/8/14
to cesiu...@googlegroups.com, s.se...@gmail.com

Here is a brain dump in case someone wants to run with this.  I haven't touched it in months.

I will post what I did to get it to run in Windows and attach Serge's script which I modified to run in Windows.  It will at least give you some usable output.  It's been a while since I ran this so I don't know if the overview tiles below the highest level are generated to be blank or not.  If they're not blank, you will just get big spikes in terrain which I have not figured out yet.  If anyone can fix this it would be greatly appreciated.  Our current use is just to write level 8 for the world for example (which works) then we have custom javascript code to ignore all terrain levels lower than that (to avoid problems, blackness, etc).  

To run the script:
gdal2srtmtiles.py --cesium -z 0-8 -p geodetic SRTM_NE_250m.tif terrain

note1: this command needs to be run from the GDAL110 (MSVC 2010) command prompt
note2: some sample SRTM data is available here (http://srtm.csi.cgiar.org/).  Use the hc.box.net link.
note3: The gdal2srtmtiles script will generate real terrain files for the highest level of terrain(ex: 8) then try to calculate the terrain tiles for all lower levels as "overviews". This generate_overview_tiles part does not work properly (gives big spikes in terrain in certain areas) so currently I write all lower levels (0-7) to have zero elevation. This needs to be fixed at some point. A Windows Python debugger is available here (https://code.google.com/p/winpdb/wiki/DebuggingTutorial).

Dependencies to run the gdal2srtmtiles script in Windows:
ActivePython 2.7.2 32bit
GDAL 1.10 32bit MSVC2010
GDAL 1.10 Python 2.7.2 bindings
Numpy for Python
gdal2srtmtiles.py

homme.z...@gmail.com

unread,
Jun 19, 2014, 10:53:11 AM6/19/14
to cesiu...@googlegroups.com
Hi,

This may be of interest to folks in this thread: I've written a tool for generating heightmap terrain tiles from a gdal data source, very similar in concept to the modified gdal2tiles.py script discussed previously.

https://github.com/geo-data/cesium-terrain-builder

It has a number of known limitations (https://github.com/geo-data/cesium-terrain-builder#limitations-and-todo) and no doubt a lot of currently unknown issues: comments and contributions are very welcome!

Best regards,

Homme

On Wednesday, 8 January 2014 17:09:48 UTC, Ashley Mort wrote:
> Here is a brain dump in case someone wants to run with this.  I haven't touched it in months.
> I will post what I did to get it to run in Windows and attach Serge's script which I modified to run in Windows.  It will at least give you some usable output.  It's been a while since I ran this so I don't know if the overview tiles below the highest level are generated to be blank or not.  If they're not blank, you will just get big spikes in terrain which I have not figured out yet.  If anyone can fix this it would be greatly appreciated.  Our current use is just to write level 8 for the world for example (which works) then we have custom javascript code to ignore all terrain levels lower than that (to avoid problems, blackness, etc).  
> To run the script:
> gdal2srtmtiles.py --cesium -z 0-8 -p geodetic SRTM_NE_250m.tif terrain
> note1: this command needs to be run from the GDAL110 (MSVC 2010) command prompt
> note2: some sample SRTM data is available here (http://srtm.csi.cgiar.org/).  Use the hc.box.net link.
> note3: The gdal2srtmtiles script will generate real
> terrain files for the highest level of terrain(ex: 8) then try to calculate
> the terrain tiles for all lower levels as "overviews". This
> generate_overview_tiles part does not work properly (gives big spikes in
> terrain in certain areas) so currently I write all lower levels (0-7)
> to have zero elevation. This needs to be fixed at some point. A Windows
> Python debugger is available here (https://code.google.com/p/winpdb/wiki/DebuggingTutorial).Dependencies to run the gdal2srtmtiles script in Windows:

Guillaume Beraudo

unread,
Jun 20, 2014, 3:55:26 AM6/20/14
to cesiu...@googlegroups.com
Hi Homme,

Thanks for sharing your work.

I am also interested in terrain generation, and have been experimenting on
it on my free time. I barely scratched the surface of it.

A few questions:
- why using gdal2, which is not released and packaged yet?
- what about using standard c++11 shared_ptr for the podataset?

I will give you more feedback when it get compiled.

BR,

Guillaume
> For more options, visit https://groups.google.com/d/optout.

--
Guillaume Beraudo
Camptocamp Engineer

Homme Zwaagstra

unread,
Jun 20, 2014, 4:29:06 AM6/20/14
to cesiu...@googlegroups.com
Hi Gillaume,

On 20 June 2014 08:55, Guillaume Beraudo
<guillaum...@camptocamp.com> wrote:
> Hi Homme,
>
> Thanks for sharing your work.

It's a pleasure.

> I am also interested in terrain generation, and have been experimenting on
> it on my free time. I barely scratched the surface of it.
>
> A few questions:
> - why using gdal2, which is not released and packaged yet?

GDAL 2 includes the GDAL/OGR unification, which now provides the
`Dataset.Reference()` and `Dataset.Dereference()` methods to GDAL
datasets. This comes in handy when copying dataset handles. Also,
GDAL 2 is the future and I wanted the terrain generation code to work
with it.

I imagine terrain generation is a fairly niche activity and folks will
be able to go to the trouble to custom install GDAL 2 between now and
when it is released. The docker container provided with the package
provides an easy way of getting off the ground for others.

> - what about using standard c++11 shared_ptr for the podataset?

I did consider this but thought it better to use the underlying GDAL
dataset referencing functionality for this.

I'm sure, however, the code in general could benefit from migrating to
C++11. The reason I didn't use C++11 features is that g++ marks the
11 standard as experimental (https://gcc.gnu.org/projects/cxx0x.html)
and clang potentially requires patches on some systems
(http://clang.llvm.org/cxx_status.html#cxx11), so I decided sticking
to C++98/03 would be more portable, at least for the moment.

> I will give you more feedback when it get compiled.

Thanks, I look forward to it.

Best regards,

Homme
> You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/rBieaEBJHiU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

Guillaume Beraudo

unread,
Jun 20, 2014, 5:30:22 AM6/20/14
to cesiu...@googlegroups.com
Hi Homme,


> > - what about using standard c++11 shared_ptr for the podataset?
>
> I did consider this but thought it better to use the underlying GDAL
> dataset referencing functionality for this.

Usually, shared_ptr and unique_ptr greatly simplifies error handling by
taking care of releasing the resource automatically (including on
exception).

This is done using a deleter, which can call the unref method, for
example.


> I'm sure, however, the code in general could benefit from migrating to
> C++11. The reason I didn't use C++11 features is that g++ marks the
> 11 standard as experimental (https://gcc.gnu.org/projects/cxx0x.html)
> and clang potentially requires patches on some systems
> (http://clang.llvm.org/cxx_status.html#cxx11), so I decided sticking
> to C++98/03 would be more portable, at least for the moment.


I have used C++11 in a big project for 4 years.
We sticked with "basics" C++11 features like auto, shared_ptr, locks and threads.
It was working reliably on Debian squeeze and Redhat6 (g++4.4).

You may install an older g++ compiler and have cmake automatically
choose this one to avoid using advanced features by inattention.


Today, Debian, Redhat and Ubuntu all ships implementations with very
good C++11 support (g++ > 4.7). On Macos latest clang is also working great.


It would certainly be less work to use the robust subset of C++11 now
than to rewrite with C++11 later and change your library API.



Best Regards,

Guillaume

Homme Zwaagstra

unread,
Jun 20, 2014, 6:19:04 AM6/20/14
to cesiu...@googlegroups.com
Hi Guillaume,

Thanks for the insight: programming in C++ is generally peripheral to
my work :) It sounds like C++11 would work fine, although might need
some CMake finessing to get it working portably. Unfortunately at the
moment I haven't got too much more time to spend on the project.

Regarding the use of `shared_ptr`, as well as setting the deleter to
call Dataset.Dereference(), we'd still have to call
Dataset.Reference() before/during creating the shared pointer.

It would also be nice to standardise on using the C++ interface to
GDAL: at the moment it is a mix of the C and C++.

Best regards,

Homme

On 20 June 2014 10:30, Guillaume Beraudo

wenwu2...@gmail.com

unread,
Nov 1, 2014, 12:34:35 AM11/1/14
to cesiu...@googlegroups.com, s.se...@gmail.com, pim.res...@gmail.com
Excuse me ,I can't connect to "sergeserver.dyndns.org" ,so I hope you can send your file "gdal2srtmtiles.py" to my email wenwu2...@gmail.com,thank you very much!

First name Last name

unread,
Feb 7, 2017, 8:21:37 AM2/7/17
to cesium-dev, s.se...@gmail.com
For now I'm using cesium-terrain-builder for producing terrain tiles in .terrain format, but I wonder can Cesium work with float .tif tiles? or do we need to convert .tif tiles to .terrain format anyway?

I can't see any information about this in documentation.

Hannah Pinkos

unread,
Feb 7, 2017, 8:41:57 AM2/7/17
to cesium-dev, s.se...@gmail.com
Hello,

You can add terrain in either the quantized mesh or heightmap format.  We recommend converting your terrain data to quantized mesh because the performance is generally a lot better than heightmaps.
The Cesium team didn't create the cesium-terrain-builder, so I'm not very familiar with it's functionality.  However, we plan on including quantized mesh terrain processing support in our upcoming cesium.com application.  You can learn more about that here: https://www.cesium.com/

Best,

Hannah

nigamr...@gmail.com

unread,
May 18, 2017, 12:50:36 AM5/18/17
to cesium-dev, s.se...@gmail.com, pim.res...@gmail.com
I cant access http://sergeserver.dyndns.org/phocadownload/terrain.tar.gz . Can you please mail me the whole dump of this terrain.tar.gz. Thanks

s.se...@gmail.com

unread,
May 18, 2017, 3:17:14 AM5/18/17
to cesium-dev, s.se...@gmail.com, pim.res...@gmail.com
четверг, 18 мая 2017 г., 7:50:36 UTC+3 пользователь nigamr...@gmail.com написал:
> I cant access http://sergeserver.dyndns.org/phocadownload/terrain.tar.gz . Can you please mail me the whole dump of this terrain.tar.gz. Thanks
http://sergeserver.noip.me/phocadownload/terrain.tar.gz (Don't sure in correct archive)
http://sergeserver.noip.me/phocadownload/gdal2srtmtiles.tar.gz (Not more supported)
Why you not use GeoserverTerrainProvider ?

nigamr...@gmail.com

unread,
May 19, 2017, 12:18:26 AM5/19/17
to cesium-dev, s.se...@gmail.com, pim.res...@gmail.com
Thankyou so much for a prompt reply!
1) But is this whole globe elevation data ?
2) For using GeoserverTerrainProvider, i will need to host geoserver data right ? The geoserver data is of which format , .bil ?
Where do i get this data from ?

nigamr...@gmail.com

unread,
May 22, 2017, 4:19:47 AM5/22/17
to cesium-dev, s.se...@gmail.com, pim.res...@gmail.com
Hi,

Actually, for the below code:

    var terrainProvider = new Cesium.GeoserverTerrainProvider({ 
        url : "http://localhost:8080/geoserver/wcs/wms", 
        layerName: "wcs:clip11(reproject)", 
        waterMask:true 
    }); 
    globe.terrainProvider = terrainProvider; 

Where do i get the geoserver folder from?
[The geoserver folder to be hosted at 8080]

Thanks.

nigamr...@gmail.com

unread,
May 23, 2017, 8:21:57 AM5/23/17
to cesium-dev, s.se...@gmail.com, pim.res...@gmail.com
Hi,

I have got the geoserver setup done and started geoserver at 8080.

For offline elevations, i wrote the below code:

var globe = new Cesium.Globe(Cesium.Ellipsoid.WGS84);    
    var terrainProvider = new Cesium.GeoserverTerrainProvider({      
      //layerName: "SRTM90",
      //styleName: "grayToColor",
      waterMask: false
    });
    globe.terrainProvider = terrainProvider;

BUT, i cant see any elevations ! What am i missing?
Please guide.

giszh...@gmail.com

unread,
Sep 17, 2019, 9:08:06 PM9/17/19
to cesium-dev

Have you solved the water mask problem in cesium, can i get some sugestions about adding water mask data to generate the terrain tiles?
在 2017年5月18日星期四 UTC+8下午12:50:36,nigamr...@gmail.com写道:

Omar Shehata

unread,
Oct 27, 2019, 7:50:32 PM10/27/19
to cesium-dev
If you have raster data with water represented in it, can you describe whether it's represented as void, as mean sea level, or something else? We have an open feature request for this here: https://github.com/AnalyticalGraphicsInc/cesium-ion-community/issues/224
Reply all
Reply to author
Forward
0 new messages