GML - Geography Markup Language

OGR has limited support for GML reading and writing. Update of existing files is not currently supported. OGR is based on GML 2.0. The reading only works if OGR is built with Xerces linked in. XML validation is disabled by default. GML writing is always supported, even without Xerces.

Currently the GML driver has no coordinate system support at this time.

Creation Issues

On export all layers are written to a single GML file all in a single feature collection. Each layer's name is used as the element name for objects from that layer. Geometries are always written as the ogr:geometryProperty property on the feature.

The GML writer supports the following creation options:

Example

The ogr2ogr utility can be used to dump the results of a Oracle query to GML:
ogr2ogr -f GML output.gml OCI:usr/pwd@db my_feature -where "id = 0"

The ogr2ogr utility can be used to dump the results of a PostGIS query to GML:

ogr2ogr -f GML output.gml PG:'host=myserver dbname=warmerda' -sql "SELECT pop_1994 from canada where province_name = 'Alberta'"

See Also