[osg-users] [forum] [osgEarth] several problems and questions

Djoé Denne djoe.denne at astrium.eads.net
Mon Nov 28 00:56:29 PST 2016


Thank you for your answer Chris. In fact, I have something like that :


    foreach(QString modelPath, *modelsPath) {
            options.url() = modelPath.toStdString();

            // Make the new layer and add it to the map.
            ModelLayerOptions layerOptions(modelPath.toStdString()+".10000.scale", options);
            ModelLayer *layer = new ModelLayer(layerOptions);

            std::cerr << layer->open().message() << std::endl;


    SpatialReference* srs =  SpatialReference::create("GEOGCS[\"WGS 84\",\n"
                                                              "    DATUM[\"WGS_1984\",\n"
                                                              "        SPHEROID[\"WGS 84\",6378137,298.257223563,\n"
                                                              "            AUTHORITY[\"EPSG\",\"7030\"]],\n"
                                                              "        AUTHORITY[\"EPSG\",\"6326\"]],\n"
                                                              "    PRIMEM[\"Greenwich\",0,\n"
                                                              "        AUTHORITY[\"EPSG\",\"8901\"]],\n"
                                                              "    UNIT[\"degree\",0.01745329251994328,\n"
                                                              "        AUTHORITY[\"EPSG\",\"9122\"]],\n"
                                                              "    AUTHORITY[\"EPSG\",\"4326\"]]");

    osgEarth::MapNode* mapNode = new osgEarth::MapNode(map);

    GeoTransform* xform = new GeoTransform();

    xform->setTerrain( mapNode->getTerrain() );

    GeoPoint point(srs, 43.583467, 1.428050 );
    delete modelsPath;

    return mapNode;

this SRS  in the geographic system and this coordinate is toulouse coordinate (Conseil général). And  nothing appear, but when i try with a earth file, my osgb model appear in right coordinates.

I really don't understand the logic of osgEarth API. Is it really possible to do all we can do with earth file, but programmatically ?

Thank again for your answer.


Read this topic online here:

More information about the osg-users mailing list