multiple imagery layers problem!!

classic Classic list List threaded Threaded
7 messages Options
Calvert Calvert
Reply | Threaded
Open this post in threaded view
|

multiple imagery layers problem!!

This post was updated on .
Hi,
as shown on the drawing,
A:basic image(lower resolution),
B,C : higher resolution.
1、B and C cannot dispaly at the same time?? how to resolve this??
2、relative path dosen't work......
{
  Properties conf;
  //conf["url"] = "..\\data\\A\\tms.xml";
  conf["url"] = "E:\\data\\A\\tms.xml";
  osgEarth::MapLayer* layer = new osgEarth::MapLayer( "A", MapLayer::TYPE_IMAGE, "tms", conf );
  _map->addMapLayer( layer );
}

{
  Properties conf;
  //conf["url"] = "..\\data\\B\\tms.xml";
  conf["url"] = "E:\\data\\B\\tms.xml";
  osgEarth::MapLayer* layer = new osgEarth::MapLayer( "B", MapLayer::TYPE_IMAGE, "tms", conf );
  _map->addMapLayer( layer );
}

{
  Properties conf;
  //conf["url"] = "..\\data\\C\\tms.xml";
  conf["url"] = "E:\\data\\C\\tms.xml";
  osgEarth::MapLayer* layer = new osgEarth::MapLayer( "C", MapLayer::TYPE_IMAGE, "tms", conf );
  _map->addMapLayer( layer );
}


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

Re: multiple imagery layers problem!!

What exactly are you seeing?

If that is the actual code snippet you're using, then you have all 3 layers pointing at the same path (E:/data/A/tms.xml).

I've updated the "hires-inset.earth" sample to demonstrate the use of multiple hi-res insets.

Glenn
Glenn Waldron / Pelican Mapping
Calvert Calvert
Reply | Threaded
Open this post in threaded view
|

Re: multiple imagery layers problem!!

not the same path..   sorry for my mistake..
1、in the .earth file,(cmd--osgviewer *.earth)i can see all the images.. but in the project, B and C cannot display at the same time.
2、use the menu option to open image, preload A..
  1>open B, display right,
  2>then open C,D..., noting.
and vice versa. it seems only can open the first selected image..

function openimage()
{
  Properties conf;
  conf["url"] = sFileName;
  osgEarth::MapLayer* layer = new osgEarth::MapLayer(sFileName, MapLayer::TYPE_IMAGE, "gdal", conf );
  _map->addMapLayer( layer );
}

thanks..
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: multiple imagery layers problem!!

Hi Calvert,

Are you saying that things work fine if you make a .earth file with all the images and run it via osgviewer but it does not work correctly in your application? 

Does the osgearth_toc example work properly for you?  It does essentially the same thing you are trying to do.

Thanks,

Jason

On Tue, Sep 15, 2009 at 8:44 AM, Calvert (via Nabble) <[hidden email]> wrote:
not the same path..   sorry for my mistake..
1、in the .earth file,(cmd--osgviewer *.earth)i can see all the images.. but in the project, B and C cannot display at the same time.
2、use the menu option to open image, preload A..
  1>open B, display right,
  2>then open C,D..., noting.
and vice versa. it seems only can open the first selected image..

function openimage()
{
  Properties conf;
  conf["url"] = sFileName;
  osgEarth::MapLayer* layer = new osgEarth::MapLayer(sFileName, MapLayer::TYPE_IMAGE, "gdal", conf );
  _map->addMapLayer( layer );
}

thanks..


View message @ http://n2.nabble.com/multiple-imagery-layers-problem-tp3641195p3648838.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.


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

Re: multiple imagery layers problem!!

thanks for your replies!!!
still the problem .....
  data(A.tif,B.tif,C.tif,D.tif,E.tif)
1、osgviewer test.earth
<image name="globe" driver="gdal">
     <url>data</url>
     <extensions>tif</extensions>
</image>

can display all tifs;

2、use the following method can only display 4 tifs(A,B,C,D),  and the same as osgearth_toc ..
<image name="A" driver="gdal">
     <url>te\A.tif</url>
   </image>
   
   <image name="B" driver="gdal">
     <url>te\B.tif</url>
   </image>
   
   <image name="C" driver="gdal">
     <url>te\C.tif</url>
   </image>
   
   <image name="D" driver="gdal">
     <url>te\D.tif</url>
   </image>
   
   <image name="E" driver="gdal">
     <url>te\E.tif</url>
   </image>

in osgearth_toc:

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\A.tif";
        MapLayer* layer = new MapLayer( "A", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\B.tif";
        MapLayer* layer = new MapLayer( "B", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\C.tif";
        MapLayer* layer = new MapLayer( "C", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\D.tif";
        MapLayer* layer = new MapLayer( "D", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\E.tif";
        MapLayer* layer = new MapLayer( "E", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

thanks...
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: multiple imagery layers problem!!

Calvert,

osgEarth uses a multitexturing approach to combine image layers.  The reason you cannot display more than 4 layers is probably b/c your graphics card only has 4 texture units.  If you are using the SVN version of osgEarth there is a multipass option that you can use that can help you get around this limitation.  See the osgearth_toc --multipass argument. 

If you want all of the insets to act as as single layer, then using a directory of images with the GDAL dataset could make more sense than using individual layers.

Thanks,

Jason

On Wed, Sep 16, 2009 at 4:14 AM, Calvert (via Nabble) <[hidden email]> wrote:

data(A.tif,B.tif,C.tif,D.tif,E.tif)
1、osgviewer test.earth
<image name="globe" driver="gdal">
     <url>data</url>
     <extensions>tif</extensions>
</image>

can display all tifs;

2、use the following method can only display 4 tifs(A,B,C,D),  and the same as osgearth_toc ..
<image name="A" driver="gdal">
     <url>te\A.tif</url>
   </image>
   
   <image name="B" driver="gdal">
     <url>te\B.tif</url>
   </image>
   
   <image name="C" driver="gdal">
     <url>te\C.tif</url>
   </image>
   
   <image name="D" driver="gdal">
     <url>te\D.tif</url>
   </image>
   
   <image name="E" driver="gdal">
     <url>te\E.tif</url>
   </image>

in osgearth_toc:

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\A.tif";
        MapLayer* layer = new MapLayer( "A", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\B.tif";
        MapLayer* layer = new MapLayer( "B", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\C.tif";
        MapLayer* layer = new MapLayer( "C", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\D.tif";
        MapLayer* layer = new MapLayer( "D", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}

{
        osgEarth::Properties conf;
        conf["url"] = "c:\\data\\E.tif";
        MapLayer* layer = new MapLayer( "E", MapLayer::TYPE_IMAGE, "gdal", conf );
        addLayersBox->addWidget( new AddLayerButton(map, view, layer) );
}



View message @ http://n2.nabble.com/multiple-imagery-layers-problem-tp3641195p3654788.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.


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

Re: multiple imagery layers problem!!

In reply to this post by Calvert
it works ....
thanks very much!!!!!