Quantcast

Regarding Lod problem

classic Classic list List threaded Threaded
5 messages Options
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Regarding Lod problem

Hi,Iam loading buildings,roads,bridges etc on the terrain using osgearth,But my problem is  using lod iam loading buildings,roads etc upon launching the application the buildings,roads etc loading slowly,how to load the buildings,roads etc instantly using lod when application launches ,my code is mentioned below

        OGRFeatureOptions feature_opt;
        feature_opt.name() = "buildings";
        feature_opt.url()  = BUILDINGS_URL;
       feature_opt.buildSpatialIndex() = true;

        Style buildingStyle;
        buildingStyle.setName("buildings");

       ExtrusionSymbol* extrusion = buildingStyle.getOrCreate<ExtrusionSymbol>();
       extrusion->heightExpression() = NumericExpression("10 + (Math.random() * 21)");
       extrusion->flatten() = true;
       extrusion->wallStyleName() = "building-wall";
       extrusion->roofStyleName() = "building-roof";

      AltitudeSymbol* alt = buildingStyle.getOrCreate<AltitudeSymbol>();
      alt->clamping()     = alt->CLAMP_TO_TERRAIN;
      alt->binding()      = alt->BINDING_VERTEX;

        Style wallStyle;
        wallStyle.setName("building-wall");
        SkinSymbol* wallSkin = wallStyle.getOrCreate<SkinSymbol>();
        wallSkin->library() = "us_resources";
        wallSkin->addTag("building");
        wallSkin->randomSeed() = 1;

       Style roofStyle;
        roofStyle.setName("building-roof");
        SkinSymbol* roofSkin   = roofStyle.getOrCreate<SkinSymbol>();
        roofSkin->library()    = "us_resources";
        roofSkin->addTag("rooftop");
        roofSkin->randomSeed() = 1;
        roofSkin->isTiled()    = true;
       
       StyleSheet* styleSheet = new StyleSheet();
        styleSheet->addStyle(buildingStyle);
        styleSheet->addStyle(wallStyle);
        styleSheet->addStyle(roofStyle);
       
       ResourceLibrary* reslib = new ResourceLibrary("us_resources", RESOURCE_LIB_URL);
        styleSheet->addResourceLibrary(reslib);


       FeatureDisplayLayout layout;
        layout.tileSizeFactor() = 52.0;
       layout.addLevel(FeatureLevel(0.0f, 20000.0f, "buildings"));
        layout.chooseLOD(FeatureLevel(0.0f, 20000.0f, "buildings"), 20000.0f);
   
        FeatureGeomModelOptions fgm_opt;
        fgm_opt.featureOptions() =  feature_opt;
        fgm_opt.styles()         =  styleSheet;
        fgm_opt.layout()         =  layout;//Rambabu
        map->addModelLayer(new ModelLayer("buildings", fgm_opt));

Any Help is appreciated.

Thanks,
R.Rambabu
       
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding Lod problem

Rambabu,

The presence of the FeatureDisplayLayout causes data to page in and out as needed. If you want everything to load at startup, remove the FeatureDisplayLayout.
Glenn Waldron / Pelican Mapping
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding Lod problem

Hi Glenn thanks for the reply ,I want also the buildings,roads,bridges etc to be load on run time (using lod)i.e using featuredisplaylayout,But iam facing Problem by using this featuredisplaylayout is delay in loading of buildings,roads etc upon launching and upon moving from one position to another position in terrain ,How to eliminate that delay using featuredisplaylayout and lod or any other method to load the buildings,roads etc on run time.

Any Help is appreciated.


Thanks,
R.Rambabu
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding Lod problem

The tiles will not load until they come into the view frustum, and it takes some amount of time for them to load. The only way to make them appear faster would be to speed up the loading process somehow.
Glenn Waldron / Pelican Mapping
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding Lod problem

Hi Glenn Thanks for the reply,How to Speed up the loading process of buildings,roads etc in the terrain using osgearth in runtime i.e(using Featuredisplaylayout and lod setting)?

Any Help is appreciated.

Thanks,
R.Rambabu
Loading...