OpenLayers v4.0.1 API - Namespace: format

# Namespace: format

This documentation is for OpenLayers v4.0.1. The latest is v.

## olx.format

### Type Definitions

#### olx.format.EsriJSONOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `geometryName` | string | undefined | <optional> | Geometry name to use when creating features.

#### olx.format.GeoJSONOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `defaultDataProjection` | ol.ProjectionLike |  | Default data projection. Default is `EPSG:4326`.
  `featureProjection` | ol.ProjectionLike |  | Projection for features read or written by the format. Options passed to read or write methods will take precedence.
  `geometryName` | string | undefined | <optional> | Geometry name to use when creating features.

#### olx.format.GMLOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `featureNS` | Object.<string, string> | string | undefined | <optional> | Feature namespace. If not defined will be derived from GML. If multiple feature types have been configured which come from different feature namespaces, this will be an object with the keys being the prefixes used in the entries of featureType array. The values of the object will be the feature namespaces themselves. So for instance there might be a featureType item `topp:states` in the `featureType` array and then there will be a key `topp` in the featureNS object with value `http://www.openplans.org/topp`.
  `featureType` | Array.<string> | string | undefined | <optional> | Feature type(s) to parse. If multiple feature types need to be configured which come from different feature namespaces, `featureNS` will be an object with the keys being the prefixes used in the entries of featureType array. The values of the object will be the feature namespaces themselves. So for instance there might be a featureType item `topp:states` and then there will be a key named `topp` in the featureNS object with value `http://www.openplans.org/topp`.
  `srsName` | string |  | srsName to use when writing geometries. Required.
  `surface` | boolean | undefined | <optional> | Write gml:Surface instead of gml:Polygon elements. This also affects the elements in multi-part geometries. Default is `false`.
  `curve` | boolean | undefined | <optional> | Write gml:Curve instead of gml:LineString elements. This also affects the elements in multi-part geometries. Default is `false`.
  `multiCurve` | boolean | undefined | <optional> | Write gml:MultiCurve instead of gml:MultiLineString. Since the latter is deprecated in GML 3, the default is `true`.
  `multiSurface` | boolean | undefined | <optional> | Write gml:multiSurface instead of gml:MultiPolygon. Since the latter is deprecated in GML 3, the default is `true`.
  `schemaLocation` | string | undefined | <optional> | Optional schemaLocation to use when writing out the GML, this will override the default provided.

#### olx.format.GPXOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `readExtensions` | function | undefined | <optional> | Callback function to process `extensions` nodes. To prevent memory leaks, this callback function must not store any references to the node. Note that the `extensions` node is not allowed in GPX 1.0. Moreover, only `extensions` nodes from `wpt`, `rte` and `trk` can be processed, as those are directly mapped to a feature.

#### olx.format.IGCOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `altitudeMode` | ol.format.IGCZ | undefined | <optional> | Altitude mode. Possible values are `barometric`, `gps`, and `none`. Default is `none`.

#### olx.format.KMLOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `extractStyles` | boolean | undefined | <optional> | Extract styles from the KML. Default is `true`.
  `showPointNames` | boolean | undefined | <optional> | Show names as labels for placemarks which contain points. Default is `true`.
  `defaultStyle` | Array.<ol.style.Style> | undefined | <optional> | Default style. The default default style is the same as Google Earth.
  `writeStyles` | boolean | undefined | <optional> | Write styles into KML. Default is `true`.

#### olx.format.MVTOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `featureClass` | undefined | function | function | <optional> | Class for features returned by `ol.format.MVT#readFeatures`. Set to `ol.Feature` to get full editing and geometry support at the cost of decreased rendering performance. The default is `ol.render.Feature`, which is optimized for rendering and hit detection.
  `geometryName` | string | undefined | <optional> | Geometry name to use when creating features. Default is 'geometry'.
  `layerName` | string | undefined | <optional> | Name of the feature attribute that holds the layer name. Default is 'layer'.
  `layers` | Array.<string> | undefined | <optional> | Layers to read features from. If not provided, features will be read from all layers.

#### olx.format.PolylineOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `factor` | number | undefined | <optional> | The factor by which the coordinates values will be scaled. Default is `1e5`.
  `geometryLayout` | ol.geom.GeometryLayout | undefined | <optional> | Layout of the feature geometries created by the format reader. Default is `ol.geom.GeometryLayout.XY`.

#### olx.format.ReadOptions{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `dataProjection` | ol.ProjectionLike | Projection of the data we are reading. If not provided, the projection will be derived from the data (where possible) or the `defaultDataProjection` of the format is assigned (where set). If the projection can not be derived from the data and if no `defaultDataProjection` is set for a format, the features will not be reprojected.
  `featureProjection` | ol.ProjectionLike | Projection of the feature geometries created by the format reader. If not provided, features will be returned in the `dataProjection`.

#### olx.format.TopoJSONOptions{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `defaultDataProjection` | ol.ProjectionLike | Default data projection. Default is `EPSG:4326`.

#### olx.format.WFSOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `featureNS` | Object.<string, string> | string | undefined | <optional> | The namespace URI used for features.
  `featureType` | Array.<string> | string | undefined | <optional> | The feature type to parse. Only used for read operations.
  `gmlFormat` | ol.format.GMLBase | undefined | <optional> | The GML format to use to parse the response. Default is `ol.format.GML3`.
  `schemaLocation` | string | undefined | <optional> | Optional schemaLocation to use for serialization, this will override the default.

#### olx.format.WFSWriteGetFeatureOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `featureNS` | string |  | The namespace URI used for features. Required.
  `featurePrefix` | string |  | The prefix for the feature namespace. Required.
  `featureTypes` | Array.<string> |  | The feature type names. Required.
  `srsName` | string | undefined | <optional> | SRS name. No srsName attribute will be set on geometries when this is not provided.
  `handle` | string | undefined | <optional> | Handle.
  `outputFormat` | string | undefined | <optional> | Output format.
  `maxFeatures` | number | undefined | <optional> | Maximum number of features to fetch.
  `geometryName` | string | undefined | <optional> | Geometry name to use in a BBOX filter.
  `propertyNames` | Array.<string> | undefined | <optional> | Optional list of property names to serialize.
  `startIndex` | number | undefined | <optional> | Start index to use for WFS paging. This is a WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.
  `count` | number | undefined | <optional> | Number of features to retrieve when paging. This is a WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some Web Feature Services have repurposed `maxfeatures` instead.
  `bbox` | ol.Extent | undefined | <optional> | Extent to use for the BBOX filter.
  `filter` | ol.format.filter.Filter | undefined | <optional> | Filter condition. See `ol.format.filter` for more information.
  `resultType` | string | undefined | <optional> | Indicates what response should be returned, E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.

#### olx.format.WFSWriteTransactionOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `featureNS` | string |  | The namespace URI used for features. Required.
  `featurePrefix` | string |  | The prefix for the feature namespace. Required.
  `featureType` | string |  | The feature type name. Required.
  `srsName` | string | undefined | <optional> | SRS name. No srsName attribute will be set on geometries when this is not provided.
  `handle` | string | undefined | <optional> | Handle.
  `nativeElements` | Array.<Object> |  | Native elements. Currently not supported. Required.
  `gmlOptions` | olx.format.GMLOptions | undefined | <optional> | GML options for the WFS transaction writer.

#### olx.format.WKTOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `splitCollection` | boolean | undefined | <optional> | Whether to split GeometryCollections into multiple features on reading. Default is `false`.

#### olx.format.WMSGetFeatureInfoOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `layers` | Array.<string> | undefined | <optional> | If set, only features of the given layers will be returned by the format when read.

#### olx.format.WriteOptions{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `dataProjection` | ol.ProjectionLike |  | Projection of the data we are writing. If not provided, the `defaultDataProjection` of the format is assigned (where set). If no `defaultDataProjection` is set for a format, the features will be returned in the `featureProjection`.
  `featureProjection` | ol.ProjectionLike |  | Projection of the feature geometries that will be serialized by the format writer. If not provided, geometries are assumed to be in the `dataProjection` if that is set; in other words, they are not transformed.
  `rightHanded` | boolean | undefined | <optional> | When writing geometries, follow the right-hand rule for linear ring orientation. This means that polygons will have counter-clockwise exterior rings and clockwise interior rings. By default, coordinates are serialized as they are provided at construction. If `true`, the right-hand rule will be applied. If `false`, the left-hand rule will be applied (clockwise for exterior and counter-clockwise for interior rings). Note that not all formats support this. The GeoJSON format does use this property when writing geometries.
  `decimals` | number | undefined | <optional> | Maximum number of decimal places for coordinates. Coordinates are stored internally as floats, but floating-point arithmetic can create coordinates with a large number of decimal places, not generally wanted on output. Set a number here to round coordinates. Can also be used to ensure that coordinates read in can be written back out with the same number of decimals. Default is no rounding.