No translation for an empty SRS to PROJ.4 format is known.

classic Classic list List threaded Threaded
5 messages Options
Jovi_Lee Jovi_Lee
Reply | Threaded
Open this post in threaded view
|

No translation for an empty SRS to PROJ.4 format is known.

Hi, friends:  
     I add the file "world.shp" as a feature model layer into the earth scene. Then I got the following errors in the console. Is there something wrong with my gdal library or proj.4 library? Or did I miss some resources?
     I compiled the gdal dynamic library (version 230) and  integrated the proj dynamic library (version 5.2.0) by myself.   The version of osg is 3.6.2. The version of osgEarth is 2.10.0. Image and terrain are loaded successfully, but vector data is failed. Anyone knows what went wrong? thx.

        OGRFeatureOptions featureData;
        featureData.url() = "E:/MyOSG/osgEarth2.10/data/world.shp";

        // Make a feature source layer and add it to the Map:
        FeatureSourceLayerOptions ogrLayer;
        ogrLayer.name() = "vector-data";
        ogrLayer.featureSource() = featureData;
        m_pMapNode->getMap()->addLayer(new FeatureSourceLayer(ogrLayer));

        // Define a style for the feature data. Since we are going to render the
        // vectors as lines, configure the line symbolizer:
        Style style;

        LineSymbol* ls = style.getOrCreateSymbol<LineSymbol>();
        ls->stroke()->color() = Color::Yellow;
        ls->stroke()->width() = 2.0f;
        ls->tessellationSize()->set(100, Units::KILOMETERS);

        AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
        alt->clamping() = alt->CLAMP_TO_TERRAIN;
        alt->technique() = alt->TECHNIQUE_GPU;

        RenderSymbol* render = style.getOrCreate<RenderSymbol>();
        render->depthOffset()->enabled() = true;

        FeatureModelLayerOptions fml;
        fml.name() = "My Features";
        fml.featureSourceLayer() = "vector-data";
        fml.styles() = new StyleSheet();
        fml.styles()->addStyle(style);
        fml.enableLighting() = false;

        m_pMapNode->getMap()->addLayer(new FeatureModelLayer(fml));

     Jovi



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

Re: No translation for an empty SRS to PROJ.4 format is known.

Did you build the osgearth with proj support? If you did so, is the proj.dll in your path (environment variable) or your executing directory?

As far as I know, if for some reason osgearth can not find proj.dll, those kind of console output is observed.
Iskender Yigitel
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: No translation for an empty SRS to PROJ.4 format is known.

In reply to this post by Jovi_Lee
Jovi,
Check the advice here on setting your GDAL_DATA location.

http://forum.osgearth.org/osgearth-city-example-projection-problem-td7592264.html#a7592267
Glenn Waldron / Pelican Mapping
Jovi_Lee Jovi_Lee
Reply | Threaded
Open this post in threaded view
|

Re: No translation for an empty SRS to PROJ.4 format is known.

Glenn´╝î
    Thank you so much. It works.
Jovi
Jovi_Lee Jovi_Lee
Reply | Threaded
Open this post in threaded view
|

Re: No translation for an empty SRS to PROJ.4 format is known.

In reply to this post by iyigitel
The reason is just as Glenn said. Thank you all the same, Iskender.