Feature Geometry

This plugin renders vector feature data into OSG geometry using style sheets.

Example usage:

<model driver="feature_geom">
    <features driver="ogr">
        <url>world.shp</url>
    </features>
    <styles>
        <style type="text/css">
            default {
                stroke:       #ffff00;
                stroke-width: 2;
            }
        </style>
    </styles>
    <fading duration="1.0"/>
</model>

Properties:

geo_interpolation:
 How to interpolate geographic lines; options are great_circle or rhumb_line
instancing:For point model substitution, whether to use GL draw-instanced (default is false)

Shared properties:

All the feature-rendering drivers share the following properties (in addition to those above):

styles:Stylesheet to use to render features (see: Symbology Reference)
layout:Paged data layout (see: Features & Symbology)
cache_policy:Caching policy (see: Caching)
fading:Fading behavior (see: Fading)
feature_name:Expression evaluating to the attribute name containing the feature name
feature_indexing:
 Whether to index features for query (default is false)
lighting:Whether to override and set the lighting mode on this layer (t/f)
max_granularity:
 Angular threshold at which to subdivide lines on a globe (degrees)
shader_policy:Options for shader generation (see: Shader Policy)
use_texture_arrays:
 Whether to use texture arrays for wall and roof skins if your card supports them. (default is true)

Also see:

feature_rasterize.earth sample in the repo

Fading

When fading is supported on a model layer, you can control it like so:

<model ...
    <fading duration  = "1.0"
            max_range = "6000"
            attenuation_distance = "1000" />

Properties:

duration:Time over which to fade in (seconds)
max_range:Distance at which to start the fade-in
attenuation_distance:
 Distance over which to fade in

Shader Policy

Some drivers support a shader policy that lets you control how (or whether) to generate shaders for external geometry. For example, if you want to load an external model via a stylesheet, but do NOT want osgEarth to generate shaders for it:

<model ...
    <shader_policy>disable</shader_policy>