OGR Feature Driver

This feature driver uses the  GDAL/OGR vector library to read features (attributes vector data).

Usage

    <features name="world" driver="ogr">
        <url>../data/world.shp</url>
        <ogr_driver>ESRI Shapefile</ogr_driver>
    </features>

Configuration

<url> Location of the file or data source from which to read features optional
<ogr_driver> OGR  driver code specifying which OGR driver to use (default="ESRI Shapefile") optional
<geometry> Instead of a URL, you can specifiy inline geometry in WKT format here optional

Please refer to <features> for additional configuration elements that are common to all feature drivers.

Vector data formats

The OGR driver supports, at least in theory,  any format supported by OGR. Some formats are inherently "one-layer" (like an ESRI shapefile) and therefore do not require the use of a <layer> element. Others do require the <layer> element to call out one layer from the data source.

Use the Code string in  this table in the <ogr_driver> element to specify which driver to use.

Query support

The OGR driver support SQL queries in feature classes for styling by category. For most OGR formats, you can use the  the OGR SQL syntax. If the underlying OGR driver has its own native query dialect (e.g. Oracle, PostgreSQL, etc.), the SQL will be passed through and processed in that dialect.

See the <query> element? for more information.

Inline WKT Geometry

You can optionally specify your geometry right in the .earth file, like this:

  <features name="data" driver="ogr">
    <geometry>
      POLYGON((-71.096 42.332, -71.096 42.386, -70.988 42.386, -70.988 42.332))
    </geometry>
  </features>

The inline WKT string must conform to the  Well-Known Text format for Geometric Objects.