Elevation using BIL file on a projected map

classic Classic list List threaded Threaded
4 messages Options
Xtof Xtof
Reply | Threaded
Open this post in threaded view
|

Elevation using BIL file on a projected map

Hi all,

I’m currently developing a MFC application using osgEarth library (latest master version on GitHub).
The goal of the application is to display an elevation layer (based on a BIL file), an imagery layer (based on OpenStreetMap) and a feature model layer (based on a SHP file) for buildings.

I’m able to display correctly all these layers using a none projected map.


But when I’m trying to display those layers on a projected map, the elevations don’t seem to be taken into account.
Here is the output of gdalinfo command on the BIL file:
Driver: EHdr/ESRI .hdr Labelled
Files: Chicago_DTM.bil
       Chicago_DTM.hdr
       Chicago_DTM.prj
Size is 11216, 14936
Coordinate System is:
PROJCS["NAD_1983_UTM_Zone_16N",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-87],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
Origin = (331782.000000000000000,4762779.000000000000000)
Pixel Size = (15.000000000000000,-15.000000000000000)
Corner Coordinates:
Upper Left  (  331782.000, 4762779.000)
Lower Left  (  331782.000, 4538739.000)
Upper Right (  500022.000, 4762779.000)
Lower Right (  500022.000, 4538739.000)
Center      (  415902.000, 4650759.000)
Band 1 Block=11216x1 Type=UInt16, ColorInterp=Undefined

Any idea why elevations cannot be seen?
The strange thing is that I don’t have the problem with Boston data “boston-inset.tif” even when converted to “boston-inset.bil” using Global Mapper.

Thanks,
Christophe
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Elevation using BIL file on a projected map

Christophe,

Are you able to make the bil file available so someone can try it? Thanks
Glenn Waldron / Pelican Mapping
Xtof Xtof
Reply | Threaded
Open this post in threaded view
|

Re: Elevation using BIL file on a projected map

Hi Glenn,

Sure, the file can be found at:
https://we.tl/SbAfF3Bcq8

For more information, elevations are taken into account on a projected map in version 2.8.0 of osgEarth, but only if the GDAL option tileSize (no longer available in master version) is specified:
osgEarth::Drivers::GDALOptions driverOptions;
driverOptions.url() = "Chicago_DTM.bil";
driverOptions.tileSize() = 16; // Or whatever value
osg::ref_ptr<osgEarth::Drivers::ElevationLayer> elevationLayer = new osgEarth::Drivers::ElevationLayer("Terrain", driverOptions);

Thanks,
Christophe
Xtof Xtof
Reply | Threaded
Open this post in threaded view
|

Re: Elevation using BIL file on a projected map

No update on this topic?

I've tried with both MP and Rex terrain engines, but result is the same, the BIL file doesn't seem to be taken into account on a projected map.