Access and modify features generated from earth file

classic Classic list List threaded Threaded
3 messages Options
Reanu Reanu
Reply | Threaded
Open this post in threaded view
|

Access and modify features generated from earth file

Hi all,

I have this feature in my earth file :

<model name="LFMN_AM_TaxiwayHoldingPosition" driver="feature_geom">
        <features driver="ogr">
            <url>..\DB\AirportData\AMDB\LFMN\AM_TaxiwayHoldingPositionMulti.shp</url>
        </features>
       
        <styles>
            <style type="text/css"> default { altitude-clamping: relative; altitude-technique: map; altitude-offset: 2m; stroke: #FFFFFF; stroke-width: 5m; stroke-linecap: round; stroke-rounding-ratio: 0.5; } </style>            </styles>
</model>


AM_TaxiwayHoldingPositionMulti.shp contains several lines :


The file is correctly loaded and the lines are displaying well on my map.

However I would like to access the properties of these lines in my code such as positions and styles to modify them dynamically after they have been loaded by the earth file.

Is there a way to do this ?

My osgEarth version is 2.10.1 and my osg version is 3.6.4
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Access and modify features generated from earth file

Reanu,
No, you generally cannot go in and modify feature geometry created in a FeatureModel layer.

You might consider reading the feature data yourself and create a FeatureNode object for each Feature instead. Then you can change the geometry or style for each one.

Hope this helps.
Glenn Waldron / Pelican Mapping
Reanu Reanu
Reply | Threaded
Open this post in threaded view
|

Re: Access and modify features generated from earth file

Hello gwaldron,

Thanks a lot for your answer.

gwaldron wrote
You might consider reading the feature data yourself and create a FeatureNode object for each Feature instead. Then you can change the geometry or style for each one.
Yes, this is what I started to do in case my request was not possible, it will do the trick.

Best,