earth_tile problem

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

earth_tile problem

Hello,

I am having a problem with the loading of map tiles.  I am integrating osgEarth into an OSG application using the TileBuilder::readNode function.  I've tried google and yahoo earth files so far, but it's the same behavior for both.  The globe appears, I get the most top level maps, then I see the error:

Error in reading file 1_0_0_0.earth_file : Warning: Could not find plugin to read objects from file "1_0_0_0.earth_file".

This occurs for a variety of numerical variations on the filename (1_2_0_0, 1_3_0_0, etc.).  From looking at the earth plugin in osgEarth (osgdb_earth.dll), it looks like it should handle the earth_tile extension, but it just doesn't seem to be getting called in my setup.  I actually tried copying the osgdb_earth.dll file to osgdb_earth_file.dll, which made it at least think it could read the .earth_file extension, but this (as expected) didn't work...I got the error:

Error:  Could not find TileBuilder with id=0.

Any thoughts here?  I thought my path might be messed up and I was using an older version, but I've tried to make sure that's not the case.  I'm using osgEarth 1.1 and osg 2.8.0.  Thanks for your help.
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: earth_tile problem

Hi jwilis,

Can you post a snippit of your code?  The readNode function should work, but isn't the typical usage of osgEarth so it's possible that something has fallen by the wayside.

In the near future, osgEarth should have much better support for dynamically creating maps at runtime.

Thanks!

Jason

On Tue, May 12, 2009 at 2:50 PM, jwils (via Nabble) <[hidden email]> wrote:
Hello,

I am having a problem with the loading of map tiles.  I am integrating osgEarth into an OSG application using the TileBuilder::readNode function.  I've tried google and yahoo earth files so far, but it's the same behavior for both.  The globe appears, I get the most top level maps, then I see the error:

Error in reading file 1_0_0_0.earth_file : Warning: Could not find plugin to read objects from file "1_0_0_0.earth_file".

This occurs for a variety of numerical variations on the filename (1_2_0_0, 1_3_0_0, etc.).  From looking at the earth plugin in osgEarth (osgdb_earth.dll), it looks like it should handle the earth_tile extension, but it just doesn't seem to be getting called in my setup.  I actually tried copying the osgdb_earth.dll file to osgdb_earth_file.dll, which made it at least think it could read the .earth_file extension, but this (as expected) didn't work...I got the error:

Error:  Could not find TileBuilder with id=0.

Any thoughts here?  I thought my path might be messed up and I was using an older version, but I've tried to make sure that's not the case.  I'm using osgEarth 1.1 and osg 2.8.0.  Thanks for your help.


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


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

Re: earth_tile problem

Sure thing:

   // make a viewer
   osgViewer::Viewer viewer;

   // make an osgEarth model
   osgEarth::MapConfig *conf = osgEarth::MapConfigReaderWriter::readXml("C:\\yahoo.earth");
   osg::Node *node = osgEarth::TileBuilder::readNode(conf);

   // run the viewer
   viewer.setSceneData (node);
   viewer.realize();
   viewer.run();

When I zoom in a bit, I start seeing the error scrolling in the console window...I'm sure this is some weird/obvious problem on my part, because it's pretty simple code, but any help you can offer is appreciated...thank you for your quick response!
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: earth_tile problem

Hi,

I guess one question would be is it possible in your app to just do this?
osg::Node* node = osgDB::readNodeFile("c:\\yahoo.earth");

That should definitely work.

Now, on to the why readNode wouldn't work....

I believe it has to the do with the change that was made prior to the 1.1 release to have two different exentions for the earth plugin .earth and .earth_tile.

The .earth extension is for actual files (yahoo.earth, google.earth, etc.) and .earth_tile extension tells the plugin to load a tile from an existing map.

See what happens if you pre-load the osgEarth plugin by passing in -l osgDB_earth.dll on the command line or calling:
osgDB::loadLibrary( "osgdb_earth.dll" ) in your code before you call readNode.

Thanks,

Jason

On Tue, May 12, 2009 at 4:01 PM, jwils (via Nabble) <[hidden email]> wrote:
Sure thing:

   // make a viewer
   osgViewer::Viewer viewer;

   // make an osgEarth model
   osgEarth::MapConfig *conf = osgEarth::MapConfigReaderWriter::readXml("C:\\yahoo.earth");
   osg::Node *node = osgEarth::TileBuilder::readNode(conf);

   // run the viewer
   viewer.setSceneData (node);
   viewer.realize();
   viewer.run();

When I zoom in a bit, I start seeing the error scrolling in the console window...I'm sure this is some weird/obvious problem on my part, because it's pretty simple code, but any help you can offer is appreciated...thank you for your quick response!



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


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

Re: earth_tile problem

Jason,

Thank you, it works!  Switching to readNodeFile fixed the problem.  Thank you very much for your prompt and excellent assistance, osgEarth is a fantastic project!
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: earth_tile problem

Great to hear, glad you like osgEarth, we do too ;)

As I mentioned previously, in the near future the Map::readNode function will probably go away.  It was meant to be a way where you could programatically create a MapConfig at runtime and then load it, but soon you should be able to create a map much more dynamically.

Thanks!

Jason

On Tue, May 12, 2009 at 5:15 PM, jwils (via Nabble) <[hidden email]> wrote:
Jason,

Thank you, it works!  Switching to readNodeFile fixed the problem.  Thank you very much for your prompt and excellent assistance, osgEarth is a fantastic project!


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