Local DTED heightfield

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

Local DTED heightfield

Hello, I have written a virtual earth plugin that just works fine for imagery. I would like to add heightfields. I recompiled osg and osgearth with gdal. gdal looks to work fine, but when I use the following earth file, I don't see any heightfield. I have no error message. I played with the verticale scale and I have nothing. The only indication I have is sometimes a white tile with a camera on it (like when there is no source data).
Would it be possible to provide in svn, an earth file and dted data to check that it works ? (with osgViewer) ?


<map name="VirtualEarth" type="geocentric">
   

        <cache>
                <path>F:\cvs\FedStealthViewer\cache_dds</path>
                <format>dds</format>
        </cache>
       
        <image name="Virtual Earth maps satellite imagery" driver="virtual_earth">
       <dataset>aerial</dataset>
                <tile_size>32</tile_size>.
        </image>

        <heightfield name="elevation" driver="gdal">
                <url>F:\Lscn\code\data\maps\DTED\France\dted\e009\n46.dt0</url>
                <tile_size>32</tile_size>.
        </heightfield>       
       
        <vertical_scale>1</vertical_scale>

       
    <north_cap_color>21 22 68 255</north_cap_color>
    <south_cap_color>220 220 220 255</south_cap_color>

   
    <proxy_host>proxy.onera</proxy_host> 
    <proxy_port>80</proxy_port> 

   


</map>
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: Local DTED heightfield

Hi Raphael,

Try forcing the profile of the map to be global-mercator using a profile tag.

<map name="VirtualEarth" type="geocentric">
  <!--Add this line-->
  <profile>global-mercator</profile>
  
  ...everything else you have
</map>

Doing this should force the GDAL plugin to reproject the DTED data (which is geodetic) to mercator.  If you don't specify the profile, osgEarth just sees two mismatched coordinate systems (MSVE is probably in spherical mercator and the DTED data is geodetic) and assumes they are incompatible.

Good luck!

Jason

On Wed, Mar 18, 2009 at 12:56 PM, Raphael (via Nabble) - No Reply <[hidden email]> wrote:
Hello, I have written a virtual earth plugin that just works fine for imagery. I would like to add heightfields. I recompiled osg and osgearth with gdal. gdal looks to work fine, but when I use the following earth file, I don't see any heightfield. I have no error message. I played with the verticale scale and I have nothing. The only indication I have is sometimes a white tile with a camera on it (like when there is no source data).
Would it be possible to provide in svn, an earth file and dted data to check that it works ? (with osgViewer) ?


<map name="VirtualEarth" type="geocentric">
   <!-- <min_tile_range_factor>6.0</min_tile_range_factor>-->

        <cache>
                <path>F:\cvs\FedStealthViewer\cache_dds</path>
                <format>dds</format>
        </cache>
       
        <image name="Virtual Earth maps satellite imagery" driver="virtual_earth">
       <dataset>aerial</dataset>
                <tile_size>32</tile_size>.
        </image>

        <heightfield name="elevation" driver="gdal">
                <url>F:\Lscn\code\data\maps\DTED\France\dted\e009\n46.dt0</url>
                <tile_size>32</tile_size>.
        </heightfield>
       
        <vertical_scale>1</vertical_scale>

        <!-- Matching cap colors -->
    <north_cap_color>21 22 68 255</north_cap_color>
    <south_cap_color>220 220 220 255</south_cap_color>

    <!-- <cache_only>offline</cache_only> -->
    <proxy_host>proxy.onera</proxy_host>
    <proxy_port>80</proxy_port>  

    <!-- <min_tile_range_factor>12.0</min_tile_range_factor> -->


</map>


View message @ http://n2.nabble.com/Local-DTED-heightfield-tp2498282p2498282.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.


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

Re: Local DTED heightfield

In reply to this post by Raphael
It works, thanks !
Nevertheless, it slows down the application. Do you think it comes from the reprojection of dted data to mercator ? Is there a workaround (like doing it offline) ?
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: Local DTED heightfield

Hi Raphael,

Glad to hear you got it working!  To make it faster, you can pre-warp your DTED data to spherical mercator so that no reprojection needs to occur at runtime.

For example, you could use:

gdalwarp -t_srs EPSG:900913 -co "TILED=YES" n32.dt2 n32_merc.tif

This will warp your DTED to spherical mercator.  The -co "TILED=YES" option tells GDAL to create a tiled GeoTiff, which is generally more effecient in osgEarth than the typical scanline based GeoTiffs.

You might need to add EPSG:900913 to your EPSG database if it isn't already there.  I believe FWTools already has it in there though.

Thanks!

Jason

On Thu, Mar 19, 2009 at 4:31 AM, Raphael (via Nabble) - No Reply <[hidden email]> wrote:
It works, thanks !
Nevertheless, it slows down the application. Do you think it comes from the reprojection of dted data to mercator ? Is there a workaround (like doing it offline) ?


View message @ http://n2.nabble.com/Local-DTED-heightfield-tp2498282p2501724.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.