[osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth
Chris Hanson
xenon at alphapixel.com
Tue Jan 8 00:56:27 PST 2019
How big is the TIFF and the PNG? They use similar compression methods (PNG
is ZIP/Deflate and compressed TIFF is usually LZW and can also use
ZIP/Deflate) so you ought to be able to get them fairly close in size. What
are the total pixel dimensions of the image? Your best result might not be
from using a single large, untiled image. Most of the time you will have
better performance (but larger file size) by pre-tiling the image into a
TileMap Set like a MapBox Tile set (stored as an SQLite database file,
usually).
There probably is a trick to apply georeferencing (like a World File) to a
PNG file through GDAL, but it's just not usually done or a good idea. This
may be a case where you're asking the wrong question. Tell us what you're
trying to accomplish in the larger sense so we can make sure you're
attacking the correct problem.
As far as Elevation -- have you added an elevation data source layer? The
code you referenced adds elevation data from a local file but yours does
not. It would look something like this:
// Add an elevationlayer (SRTM from a local GeoTiff file){
GDALOptions gdal;
gdal.url() = "c:/data/srtm.tif";
ElevationLayer* layer = new ElevationLayer( "SRTM", gdal );
map->addElevationLayer( layer );}
You can also use TileMap Sets hosted either as a file on your local disk,
or served up over the Internet from an HTTP Tile Map Server. Pelican
Mapping operates the ReadyMap server for this purpose and you can use it at
no charge for low-traffic testing and development purposes but it needs to
be licensed for production use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190108/1cf02507/attachment-0001.html>
More information about the osg-users
mailing list