osgearth_conv fails to encode elevation

classic Classic list List threaded Threaded
6 messages Options
KingArthur10 KingArthur10
Reply | Threaded
Open this post in threaded view
|

osgearth_conv fails to encode elevation

I'm trying to encode elevation data into mbtiles.  I've tested this data in osgearth_viewer and it works normally.

I'm using the following command:

osgearth_conv --elevation --in driver gdal --in url earth-elevation-srtm-epsg3857.tif --out format png --out compress true --out driver mbtiles --out filename earth-elevation-srtm.mbtiles

When I run that, I get an error:
[osgEarth]* [MBTilesTileSource] Image encoding failed:
1/1398101 (0.0%, 0m0s projected, 0m0s remaining)        Time = 24.7 seconds.

osgearth_conv exits with no additional information.  Below, you can see that I tried running with osg and osgearth notify levels set to debug.

When I try running this without the "--elevation" flag, it successfully begins running.

Can you please help me?  It's getting frustrating.

osgearth_conv --elevation --in driver gdal --in url earth-elevation-srtm-epsg3857.tif --out format png --out compress true --out driver mbtiles --out filename earth-elevation-srtm.mbtiles
Duplicate enum value 10 with old string: GL_LINES_ADJACENCY_EXT and new string: GL_LINES_ADJACENCY
Duplicate enum value 11 with old string: GL_LINE_STRIP_ADJACENCY_EXT and new string: GL_LINE_STRIP_ADJACENCY
Duplicate enum value 12 with old string: GL_TRIANGLES_ADJACENCY_EXT and new string: GL_TRIANGLES_ADJACENCY
Duplicate enum value 13 with old string: GL_TRIANGLE_STRIP_ADJACENCY_EXT and new string: GL_TRIANGLE_STRIP_ADJACENCY
DatabasePager::addDatabaseThread() HANDLE_NON_HTTP
DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP
RegisterWindowingSystemInterfaceProxy()
X11WindowingSystemInterface()
GraphicsContext::setWindowingSystemInterface() 0x55a934034dd0   0x7f098c0c9fd8
ShaderComposer::ShaderComposer() 0x55a934118790
itr='/usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1'
FindFileInPath() : trying /usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/lib/'
FindFileInPath() : trying /usr/lib/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/lib64/'
FindFileInPath() : trying /usr/lib64/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/local/lib/'
FindFileInPath() : trying /usr/local/lib/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/local/lib64/'
FindFileInPath() : trying /usr/local/lib64/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1'
FindFileInPath() : trying /usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1/osgdb_zip.so ...
itr='/usr/lib/'
FindFileInPath() : trying /usr/lib/osgdb_zip.so ...
itr='/usr/lib64/'
FindFileInPath() : trying /usr/lib64/osgdb_zip.so ...
itr='/usr/local/lib/'
FindFileInPath() : trying /usr/local/lib/osgdb_zip.so ...
itr='/usr/local/lib64/'
FindFileInPath() : trying /usr/local/lib64/osgdb_zip.so ...
Warning: dynamic library 'osgPlugins-3.4.1/osgdb_zip.so' does not exist (or isn't readable):
osgPlugins-3.4.1/osgdb_zip.so: cannot open shared object file: No such file or directory
DynamicLibrary::failed loading "osgPlugins-3.4.1/osgdb_zip.so"
Font::Font() Fixed function pipeline
Font::Font() Setting up GL2 compatible shaders
   Font 0x55a93411c4f0, numberOfTexturesAllocated 1
itr='/usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1'
FindFileInPath() : trying /usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1/osgPlugins-3.4.1/osgdb_osgearth_gdal.so ...
itr='/usr/lib/'
FindFileInPath() : trying /usr/lib/osgPlugins-3.4.1/osgdb_osgearth_gdal.so ...
FindFileInPath() : USING /usr/lib/osgPlugins-3.4.1/osgdb_osgearth_gdal.so
Opened DynamicLibrary osgPlugins-3.4.1/osgdb_osgearth_gdal.so
[osgEarth]  [TileSourceFactory] Tile source Profile = NULL
[osgEarth]  [GDAL driver] Identified 1 files:
[osgEarth]  [GDAL driver] earth-elevation-srtm-epsg3857.tif
[osgEarth]  [GDAL driver] Get geotransform from warped dataset
[osgEarth]  [GDAL driver] Geo extents: -20037508, -8399747.4 -> 20037425, 8399737.9
[osgEarth]  [SpatialReference] allocating new OCT Transform
[osgEarth]  [GDAL driver] earth-elevation-srtm-epsg3857.tif is projected, SRS = PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]
[osgEarth]  [GDAL driver] Resolution= 95.425368x95.425596 max=95.425368
[osgEarth]  [GDAL driver] earth-elevation-srtm-epsg3857.tif max Data Level: 10
[osgEarth]  [GDAL driver] Set Profile to [srs=WGS 84 / Pseudo-Mercator, min=-20037508.34278925,-8399747.38074672 max=20037424.82445214,8399737.889818361 lod0=1,1 vdatum=geodetic]
[osgEarth]  [osgearth_conv] Converting heightfield tiles
itr='/usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1'
FindFileInPath() : trying /usr/lib/x86_64-linux-gnu/osgPlugins-3.4.1/osgPlugins-3.4.1/osgdb_osgearth_mbtiles.so ...
itr='/usr/lib/'
FindFileInPath() : trying /usr/lib/osgPlugins-3.4.1/osgdb_osgearth_mbtiles.so ...
FindFileInPath() : USING /usr/lib/osgPlugins-3.4.1/osgdb_osgearth_mbtiles.so
Opened DynamicLibrary osgPlugins-3.4.1/osgdb_osgearth_mbtiles.so
[osgEarth]  [TileSourceFactory] Tile source Profile = NULL
[osgEarth]  [SpatialReference] allocating new OCT Transform
[osgEarth]  [MBTilesTileSource] Min=0 Max=0
[osgEarth]  [MBTilesTileSource] Computing levels took 0.000132 s
[osgEarth]  [MBTilesTileSource] Data is compressed (zlib)
[osgEarth]  [MBTilesTileSource] Bounds = SW=-180,-60 NE=179.999,60, SRS=WGS 84
[osgEarth]  [osgearth_conv] FROM:
{
   "" : {
      "driver" : "gdal",
      "url" : "earth-elevation-srtm-epsg3857.tif"
   }
}

[osgEarth]  [osgearth_conv] TO:
{
   "" : {
      "compress" : "true",
      "driver" : "mbtiles",
      "filename" : "earth-elevation-srtm.mbtiles",
      "format" : "png",
      "profile" : {
         "num_tiles_high_at_lod_0" : "1",
         "num_tiles_wide_at_lod_0" : "1",
         "srs" : "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",
         "vdatum" : {},
         "xmax" : "20037424.824452139437",
         "xmin" : "-20037508.342789247632",
         "ymax" : "8399737.889818361029",
         "ymin" : "-8399747.3807467203587"
      }
   }
}

[osgEarth]  hashConfFinal = {
   "elevation" : {}
}

[osgEarth]  [TerrainLayer] Layer "" Override profile: [srs=WGS 84 / Pseudo-Mercator, min=-20037508.34278925,-8399747.38074672 max=20037424.82445214,8399737.889818361 lod0=1,1 vdatum=geodetic]
[osgEarth]  [TerrainLayer] Layer "" Get Profile from tile source
[osgEarth]  [TerrainLayer] Layer "" Profile=[srs=WGS 84 / Pseudo-Mercator, min=-20037508.34278925,-8399747.38074672 max=20037424.82445214,8399737.889818361 lod0=1,1 vdatum=geodetic]
[osgEarth]  [TerrainLayer] Layer "" cache=none; policy=read-write; bin=no
[osgEarth]  [osgearth_conv] Calculated max level = 10
Working...
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]  Replaced -3.4028235e+38 with NO_DATA_VALUE
[osgEarth]* [MBTilesTileSource] Image encoding failed: 
1/1398101 (0.0%, 0m0s projected, 0m0s remaining)        Time = 24.7 seconds.
[osgEarth]  [Layer] Layer "" ~Layer
[osgEarth]  [Registry] Registry shutting down...
[osgEarth]  [SpatialReference] Destroying WGS 84
[osgEarth]  [SpatialReference] Destroying WGS 84 / Pseudo-Mercator
[osgEarth]  [SpatialReference] Destroying WGS 84
[osgEarth]  [SpatialReference] Destroying Mercator CS
[osgEarth]  [SpatialReference] Destroying WGS 84
[osgEarth]  [Registry] Registry shutdown complete.
[osgEarth]  [StateSetCache] Pruned 0 attributes, 0 statesets
ShaderComposer::~ShaderComposer() 0x561a2a0e5790
~RegisterWindowingSystemInterfaceProxy()
GraphicsContext::setWindowingSystemInterface() 0        0x7f5cdbe28fd8
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
Closing DynamicLibrary osgPlugins-3.4.1/osgdb_osgearth_gdal.so
Closing DynamicLibrary osgPlugins-3.4.1/osgdb_osgearth_mbtiles.so
Closing DynamicLibrary osgPlugins-3.4.1/osgdb_png.so




-------------------------------------

The info for the dataset is:

Driver: GTiff/GeoTIFF
Files: earth-elevation-srtm-epsg3857.tif
       earth-elevation-srtm-epsg3857.tif.ovr
Size is 419961, 176048
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
    AUTHORITY["EPSG","3857"]]
Origin = (-20037508.342789247632027,8399737.889818361029029)
Pixel Size = (95.425368468122954,-95.425595693021677)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-20037508.343, 8399737.890) (180d 0' 0.00"W, 60d 0' 0.00"N)
Lower Left  (-20037508.343,-8399747.381) (180d 0' 0.00"W, 60d 0' 0.15"S)
Upper Right (20037424.824, 8399737.890) (179d59'57.30"E, 60d 0' 0.00"N)
Lower Right (20037424.824,-8399747.381) (179d59'57.30"E, 60d 0' 0.15"S)
Center      ( -41.7591686,  -4.7454642) (  0d 0' 1.35"W,  0d 0' 0.15"S)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
  NoData Value=-32768
  Overviews: 209981x88024, 104991x44012, 52496x22006, 26248x11003, 13124x5502, 6562x2751, 3281x1376, 1641x688, 821x344, 411x172, 206x86, 103x43
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_conv fails to encode elevation

You cannot encode elevation data as PNG. Remove "--out format png".
Glenn Waldron / Pelican Mapping
ADB ADB
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_conv fails to encode elevation

Removing that results in it giving the error:

[osgEarth]* [osgearth_conv] Error initializing output: Cannot create database; required format is missing

On Tue, Dec 11, 2018 at 10:00 AM gwaldron [via osgEarth] <[hidden email]> wrote:
You cannot encode elevation data as PNG. Remove "--out format png".
Glenn Waldron / Pelican Mapping



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/osgearth-conv-fails-to-encode-elevation-tp7592243p7592244.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_conv fails to encode elevation

Try:
--out format tif
Glenn Waldron / Pelican Mapping
ADB ADB
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_conv fails to encode elevation

Okay.  We're building now.  I assumed that since gdal's MBTile specification only supports PNG/PNG8/JPEG, that the same limitation would fall out for osgEarth.

Thanks, we'll see how well it builds.

I'm guessing that osgEarth will build it such that I don't need to add overviews to the mbtiles, yes?


gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_conv fails to encode elevation

Arthur,

Correct; you are generating a full set of pre-tiled data, so no overviews are necessary.
Glenn Waldron / Pelican Mapping