Features element

The features element defines a vector data source. Model layers that render vector feature data require a features source from which to read the data they are going to render.

Atttributes

name Readable name of the feature source. If you use global styles to set the appearance of the rendered feature data, this is the name that the styles will reference. required
driver Name of the driver plugin that will read the feature data. See feature drivers for a list. required

Configuration

This driver supports the following sub-elements:

<url> Location (URL or pathname) of the data source. required
<layer> Name of the data layer to read. This is only required for data sources that support more than one layer. optional
<buffer> Applies a geometric buffering operation to the incoming geometry (dialation or erosion of a shape). Buffering always converts the data into polygons. optional

Example

<map name="Feature Stencil Demo" type="geocentric">

    <image name="world" driver="gdal">
        <url>../data/world.tif</url>
    </image>
    
    <model name="countries" driver="feature_stencil">

        <!-- Configure the OGR feature driver to read the shapefile. -->
             
        <features name="world" driver="ogr">
            <url>../data/world.shp</url>
            <ogr_driver>ESRI Shapefile</ogr_driver>
            <buffer distance="0.02"/>
        </features>

        <geometry_type>line</geometry_type>

        <style>
            world {
                stroke: #ff7f00;
            }
        </style>

    </model>
  
</map>