'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _index = require('../index.js');

var _index2 = _interopRequireDefault(_index);

var _feature = require('../feature.js');

var _feature2 = _interopRequireDefault(_feature);

var _asserts = require('../asserts.js');

var _asserts2 = _interopRequireDefault(_asserts);

var _extent = require('../extent.js');

var _extent2 = _interopRequireDefault(_extent);

var _feature3 = require('../format/feature.js');

var _feature4 = _interopRequireDefault(_feature3);

var _jsonfeature = require('../format/jsonfeature.js');

var _jsonfeature2 = _interopRequireDefault(_jsonfeature);

var _geometrylayout = require('../geom/geometrylayout.js');

var _geometrylayout2 = _interopRequireDefault(_geometrylayout);

var _geometrytype = require('../geom/geometrytype.js');

var _geometrytype2 = _interopRequireDefault(_geometrytype);

var _linestring = require('../geom/linestring.js');

var _linestring2 = _interopRequireDefault(_linestring);

var _linearring = require('../geom/linearring.js');

var _linearring2 = _interopRequireDefault(_linearring);

var _multilinestring = require('../geom/multilinestring.js');

var _multilinestring2 = _interopRequireDefault(_multilinestring);

var _multipoint = require('../geom/multipoint.js');

var _multipoint2 = _interopRequireDefault(_multipoint);

var _multipolygon = require('../geom/multipolygon.js');

var _multipolygon2 = _interopRequireDefault(_multipolygon);

var _point = require('../geom/point.js');

var _point2 = _interopRequireDefault(_point);

var _polygon = require('../geom/polygon.js');

var _polygon2 = _interopRequireDefault(_polygon);

var _deflate = require('../geom/flat/deflate.js');

var _deflate2 = _interopRequireDefault(_deflate);

var _orient = require('../geom/flat/orient.js');

var _orient2 = _interopRequireDefault(_orient);

var _obj = require('../obj.js');

var _obj2 = _interopRequireDefault(_obj);

var _proj = require('../proj.js');

var _proj2 = _interopRequireDefault(_proj);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

/**
 * @classdesc
 * Feature format for reading and writing data in the EsriJSON format.
 *
 * @constructor
 * @extends {ol.format.JSONFeature}
 * @param {olx.format.EsriJSONOptions=} opt_options Options.
 * @api
 */
var _ol_format_EsriJSON_ = function (opt_options) {

  var options = opt_options ? opt_options : {};

  _jsonfeature2.default.call(this);

  /**
   * Name of the geometry attribute for features.
   * @type {string|undefined}
   * @private
   */
  this.geometryName_ = options.geometryName;
};

_index2.default.inherits(_ol_format_EsriJSON_, _jsonfeature2.default);

/**
 * @param {EsriJSONGeometry} object Object.
 * @param {olx.format.ReadOptions=} opt_options Read options.
 * @private
 * @return {ol.geom.Geometry} Geometry.
 */
_ol_format_EsriJSON_.readGeometry_ = function (object, opt_options) {
  if (!object) {
    return null;
  }
  /** @type {ol.geom.GeometryType} */
  var type;
  if (typeof object.x === 'number' && typeof object.y === 'number') {
    type = _geometrytype2.default.POINT;
  } else if (object.points) {
    type = _geometrytype2.default.MULTI_POINT;
  } else if (object.paths) {
    if (object.paths.length === 1) {
      type = _geometrytype2.default.LINE_STRING;
    } else {
      type = _geometrytype2.default.MULTI_LINE_STRING;
    }
  } else if (object.rings) {
    var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
    var rings = _ol_format_EsriJSON_.convertRings_(object.rings, layout);
    object = /** @type {EsriJSONGeometry} */_obj2.default.assign({}, object);
    if (rings.length === 1) {
      type = _geometrytype2.default.POLYGON;
      object.rings = rings[0];
    } else {
      type = _geometrytype2.default.MULTI_POLYGON;
      object.rings = rings;
    }
  }
  var geometryReader = _ol_format_EsriJSON_.GEOMETRY_READERS_[type];
  return (
    /** @type {ol.geom.Geometry} */_feature4.default.transformWithOptions(geometryReader(object), false, opt_options)
  );
};

/**
 * Determines inner and outer rings.
 * Checks if any polygons in this array contain any other polygons in this
 * array. It is used for checking for holes.
 * Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
 * @param {Array.<!Array.<!Array.<number>>>} rings Rings.
 * @param {ol.geom.GeometryLayout} layout Geometry layout.
 * @private
 * @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
 */
_ol_format_EsriJSON_.convertRings_ = function (rings, layout) {
  var flatRing = [];
  var outerRings = [];
  var holes = [];
  var i, ii;
  for (i = 0, ii = rings.length; i < ii; ++i) {
    flatRing.length = 0;
    _deflate2.default.coordinates(flatRing, 0, rings[i], layout.length);
    // is this ring an outer ring? is it clockwise?
    var clockwise = _orient2.default.linearRingIsClockwise(flatRing, 0, flatRing.length, layout.length);
    if (clockwise) {
      outerRings.push([rings[i]]);
    } else {
      holes.push(rings[i]);
    }
  }
  while (holes.length) {
    var hole = holes.shift();
    var matched = false;
    // loop over all outer rings and see if they contain our hole.
    for (i = outerRings.length - 1; i >= 0; i--) {
      var outerRing = outerRings[i][0];
      var containsHole = _extent2.default.containsExtent(new _linearring2.default(outerRing).getExtent(), new _linearring2.default(hole).getExtent());
      if (containsHole) {
        // the hole is contained push it into our polygon
        outerRings[i].push(hole);
        matched = true;
        break;
      }
    }
    if (!matched) {
      // no outer rings contain this hole turn it into and outer
      // ring (reverse it)
      outerRings.push([hole.reverse()]);
    }
  }
  return outerRings;
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} Point.
 */
_ol_format_EsriJSON_.readPointGeometry_ = function (object) {
  var point;
  if (object.m !== undefined && object.z !== undefined) {
    point = new _point2.default([object.x, object.y, object.z, object.m], _geometrylayout2.default.XYZM);
  } else if (object.z !== undefined) {
    point = new _point2.default([object.x, object.y, object.z], _geometrylayout2.default.XYZ);
  } else if (object.m !== undefined) {
    point = new _point2.default([object.x, object.y, object.m], _geometrylayout2.default.XYM);
  } else {
    point = new _point2.default([object.x, object.y]);
  }
  return point;
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} LineString.
 */
_ol_format_EsriJSON_.readLineStringGeometry_ = function (object) {
  var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
  return new _linestring2.default(object.paths[0], layout);
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} MultiLineString.
 */
_ol_format_EsriJSON_.readMultiLineStringGeometry_ = function (object) {
  var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
  return new _multilinestring2.default(object.paths, layout);
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.GeometryLayout} The geometry layout to use.
 */
_ol_format_EsriJSON_.getGeometryLayout_ = function (object) {
  var layout = _geometrylayout2.default.XY;
  if (object.hasZ === true && object.hasM === true) {
    layout = _geometrylayout2.default.XYZM;
  } else if (object.hasZ === true) {
    layout = _geometrylayout2.default.XYZ;
  } else if (object.hasM === true) {
    layout = _geometrylayout2.default.XYM;
  }
  return layout;
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} MultiPoint.
 */
_ol_format_EsriJSON_.readMultiPointGeometry_ = function (object) {
  var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
  return new _multipoint2.default(object.points, layout);
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} MultiPolygon.
 */
_ol_format_EsriJSON_.readMultiPolygonGeometry_ = function (object) {
  var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
  return new _multipolygon2.default(
  /** @type {Array.<Array.<Array.<Array.<number>>>>} */object.rings, layout);
};

/**
 * @param {EsriJSONGeometry} object Object.
 * @private
 * @return {ol.geom.Geometry} Polygon.
 */
_ol_format_EsriJSON_.readPolygonGeometry_ = function (object) {
  var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
  return new _polygon2.default(object.rings, layout);
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONGeometry} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writePointGeometry_ = function (geometry, opt_options) {
  var coordinates = /** @type {ol.geom.Point} */geometry.getCoordinates();
  var esriJSON;
  var layout = /** @type {ol.geom.Point} */geometry.getLayout();
  if (layout === _geometrylayout2.default.XYZ) {
    esriJSON = /** @type {EsriJSONPoint} */{
      x: coordinates[0],
      y: coordinates[1],
      z: coordinates[2]
    };
  } else if (layout === _geometrylayout2.default.XYM) {
    esriJSON = /** @type {EsriJSONPoint} */{
      x: coordinates[0],
      y: coordinates[1],
      m: coordinates[2]
    };
  } else if (layout === _geometrylayout2.default.XYZM) {
    esriJSON = /** @type {EsriJSONPoint} */{
      x: coordinates[0],
      y: coordinates[1],
      z: coordinates[2],
      m: coordinates[3]
    };
  } else if (layout === _geometrylayout2.default.XY) {
    esriJSON = /** @type {EsriJSONPoint} */{
      x: coordinates[0],
      y: coordinates[1]
    };
  } else {
    _asserts2.default.assert(false, 34); // Invalid geometry layout
  }
  return (/** @type {EsriJSONGeometry} */esriJSON
  );
};

/**
 * @param {ol.geom.SimpleGeometry} geometry Geometry.
 * @private
 * @return {Object} Object with boolean hasZ and hasM keys.
 */
_ol_format_EsriJSON_.getHasZM_ = function (geometry) {
  var layout = geometry.getLayout();
  return {
    hasZ: layout === _geometrylayout2.default.XYZ || layout === _geometrylayout2.default.XYZM,
    hasM: layout === _geometrylayout2.default.XYM || layout === _geometrylayout2.default.XYZM
  };
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONPolyline} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writeLineStringGeometry_ = function (geometry, opt_options) {
  var hasZM = _ol_format_EsriJSON_.getHasZM_( /** @type {ol.geom.LineString} */geometry);
  return (/** @type {EsriJSONPolyline} */{
      hasZ: hasZM.hasZ,
      hasM: hasZM.hasM,
      paths: [
      /** @type {ol.geom.LineString} */geometry.getCoordinates()]
    }
  );
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONPolygon} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writePolygonGeometry_ = function (geometry, opt_options) {
  // Esri geometries use the left-hand rule
  var hasZM = _ol_format_EsriJSON_.getHasZM_( /** @type {ol.geom.Polygon} */geometry);
  return (/** @type {EsriJSONPolygon} */{
      hasZ: hasZM.hasZ,
      hasM: hasZM.hasM,
      rings: /** @type {ol.geom.Polygon} */geometry.getCoordinates(false)
    }
  );
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONPolyline} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writeMultiLineStringGeometry_ = function (geometry, opt_options) {
  var hasZM = _ol_format_EsriJSON_.getHasZM_( /** @type {ol.geom.MultiLineString} */geometry);
  return (/** @type {EsriJSONPolyline} */{
      hasZ: hasZM.hasZ,
      hasM: hasZM.hasM,
      paths: /** @type {ol.geom.MultiLineString} */geometry.getCoordinates()
    }
  );
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONMultipoint} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writeMultiPointGeometry_ = function (geometry, opt_options) {
  var hasZM = _ol_format_EsriJSON_.getHasZM_( /** @type {ol.geom.MultiPoint} */geometry);
  return (/** @type {EsriJSONMultipoint} */{
      hasZ: hasZM.hasZ,
      hasM: hasZM.hasM,
      points: /** @type {ol.geom.MultiPoint} */geometry.getCoordinates()
    }
  );
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONPolygon} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writeMultiPolygonGeometry_ = function (geometry, opt_options) {
  var hasZM = _ol_format_EsriJSON_.getHasZM_( /** @type {ol.geom.MultiPolygon} */geometry);
  var coordinates = /** @type {ol.geom.MultiPolygon} */geometry.getCoordinates(false);
  var output = [];
  for (var i = 0; i < coordinates.length; i++) {
    for (var x = coordinates[i].length - 1; x >= 0; x--) {
      output.push(coordinates[i][x]);
    }
  }
  return (/** @type {EsriJSONPolygon} */{
      hasZ: hasZM.hasZ,
      hasM: hasZM.hasM,
      rings: output
    }
  );
};

/**
 * @const
 * @private
 * @type {Object.<ol.geom.GeometryType, function(EsriJSONGeometry): ol.geom.Geometry>}
 */
_ol_format_EsriJSON_.GEOMETRY_READERS_ = {};
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.POINT] = _ol_format_EsriJSON_.readPointGeometry_;
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.LINE_STRING] = _ol_format_EsriJSON_.readLineStringGeometry_;
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.POLYGON] = _ol_format_EsriJSON_.readPolygonGeometry_;
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.MULTI_POINT] = _ol_format_EsriJSON_.readMultiPointGeometry_;
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.MULTI_LINE_STRING] = _ol_format_EsriJSON_.readMultiLineStringGeometry_;
_ol_format_EsriJSON_.GEOMETRY_READERS_[_geometrytype2.default.MULTI_POLYGON] = _ol_format_EsriJSON_.readMultiPolygonGeometry_;

/**
 * @const
 * @private
 * @type {Object.<string, function(ol.geom.Geometry, olx.format.WriteOptions=): (EsriJSONGeometry)>}
 */
_ol_format_EsriJSON_.GEOMETRY_WRITERS_ = {};
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.POINT] = _ol_format_EsriJSON_.writePointGeometry_;
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.LINE_STRING] = _ol_format_EsriJSON_.writeLineStringGeometry_;
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.POLYGON] = _ol_format_EsriJSON_.writePolygonGeometry_;
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.MULTI_POINT] = _ol_format_EsriJSON_.writeMultiPointGeometry_;
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.MULTI_LINE_STRING] = _ol_format_EsriJSON_.writeMultiLineStringGeometry_;
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[_geometrytype2.default.MULTI_POLYGON] = _ol_format_EsriJSON_.writeMultiPolygonGeometry_;

/**
 * Read a feature from a EsriJSON Feature source.  Only works for Feature,
 * use `readFeatures` to read FeatureCollection source.
 *
 * @function
 * @param {ArrayBuffer|Document|Node|Object|string} source Source.
 * @param {olx.format.ReadOptions=} opt_options Read options.
 * @return {ol.Feature} Feature.
 * @api
 */
_ol_format_EsriJSON_.prototype.readFeature;

/**
 * Read all features from a EsriJSON source.  Works with both Feature and
 * FeatureCollection sources.
 *
 * @function
 * @param {ArrayBuffer|Document|Node|Object|string} source Source.
 * @param {olx.format.ReadOptions=} opt_options Read options.
 * @return {Array.<ol.Feature>} Features.
 * @api
 */
_ol_format_EsriJSON_.prototype.readFeatures;

/**
 * @inheritDoc
 */
_ol_format_EsriJSON_.prototype.readFeatureFromObject = function (object, opt_options) {
  var esriJSONFeature = /** @type {EsriJSONFeature} */object;
  var geometry = _ol_format_EsriJSON_.readGeometry_(esriJSONFeature.geometry, opt_options);
  var feature = new _feature2.default();
  if (this.geometryName_) {
    feature.setGeometryName(this.geometryName_);
  }
  feature.setGeometry(geometry);
  if (opt_options && opt_options.idField && esriJSONFeature.attributes[opt_options.idField]) {
    feature.setId( /** @type {number} */esriJSONFeature.attributes[opt_options.idField]);
  }
  if (esriJSONFeature.attributes) {
    feature.setProperties(esriJSONFeature.attributes);
  }
  return feature;
};

/**
 * @inheritDoc
 */
_ol_format_EsriJSON_.prototype.readFeaturesFromObject = function (object, opt_options) {
  var esriJSONObject = /** @type {EsriJSONObject} */object;
  var options = opt_options ? opt_options : {};
  if (esriJSONObject.features) {
    var esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */
    object;
    /** @type {Array.<ol.Feature>} */
    var features = [];
    var esriJSONFeatures = esriJSONFeatureCollection.features;
    var i, ii;
    options.idField = object.objectIdFieldName;
    for (i = 0, ii = esriJSONFeatures.length; i < ii; ++i) {
      features.push(this.readFeatureFromObject(esriJSONFeatures[i], options));
    }
    return features;
  } else {
    return [this.readFeatureFromObject(object, options)];
  }
};

/**
 * Read a geometry from a EsriJSON source.
 *
 * @function
 * @param {ArrayBuffer|Document|Node|Object|string} source Source.
 * @param {olx.format.ReadOptions=} opt_options Read options.
 * @return {ol.geom.Geometry} Geometry.
 * @api
 */
_ol_format_EsriJSON_.prototype.readGeometry;

/**
 * @inheritDoc
 */
_ol_format_EsriJSON_.prototype.readGeometryFromObject = function (object, opt_options) {
  return _ol_format_EsriJSON_.readGeometry_(
  /** @type {EsriJSONGeometry} */object, opt_options);
};

/**
 * Read the projection from a EsriJSON source.
 *
 * @function
 * @param {ArrayBuffer|Document|Node|Object|string} source Source.
 * @return {ol.proj.Projection} Projection.
 * @api
 */
_ol_format_EsriJSON_.prototype.readProjection;

/**
 * @inheritDoc
 */
_ol_format_EsriJSON_.prototype.readProjectionFromObject = function (object) {
  var esriJSONObject = /** @type {EsriJSONObject} */object;
  if (esriJSONObject.spatialReference && esriJSONObject.spatialReference.wkid) {
    var crs = esriJSONObject.spatialReference.wkid;
    return _proj2.default.get('EPSG:' + crs);
  } else {
    return null;
  }
};

/**
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @private
 * @return {EsriJSONGeometry} EsriJSON geometry.
 */
_ol_format_EsriJSON_.writeGeometry_ = function (geometry, opt_options) {
  var geometryWriter = _ol_format_EsriJSON_.GEOMETRY_WRITERS_[geometry.getType()];
  return geometryWriter( /** @type {ol.geom.Geometry} */_feature4.default.transformWithOptions(geometry, true, opt_options), opt_options);
};

/**
 * Encode a geometry as a EsriJSON string.
 *
 * @function
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {string} EsriJSON.
 * @api
 */
_ol_format_EsriJSON_.prototype.writeGeometry;

/**
 * Encode a geometry as a EsriJSON object.
 *
 * @param {ol.geom.Geometry} geometry Geometry.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {EsriJSONGeometry} Object.
 * @override
 * @api
 */
_ol_format_EsriJSON_.prototype.writeGeometryObject = function (geometry, opt_options) {
  return _ol_format_EsriJSON_.writeGeometry_(geometry, this.adaptOptions(opt_options));
};

/**
 * Encode a feature as a EsriJSON Feature string.
 *
 * @function
 * @param {ol.Feature} feature Feature.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {string} EsriJSON.
 * @api
 */
_ol_format_EsriJSON_.prototype.writeFeature;

/**
 * Encode a feature as a esriJSON Feature object.
 *
 * @param {ol.Feature} feature Feature.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {Object} Object.
 * @override
 * @api
 */
_ol_format_EsriJSON_.prototype.writeFeatureObject = function (feature, opt_options) {
  opt_options = this.adaptOptions(opt_options);
  var object = {};
  var geometry = feature.getGeometry();
  if (geometry) {
    object['geometry'] = _ol_format_EsriJSON_.writeGeometry_(geometry, opt_options);
    if (opt_options && opt_options.featureProjection) {
      object['geometry']['spatialReference'] = /** @type {EsriJSONCRS} */{
        wkid: _proj2.default.get(opt_options.featureProjection).getCode().split(':').pop()
      };
    }
  }
  var properties = feature.getProperties();
  delete properties[feature.getGeometryName()];
  if (!_obj2.default.isEmpty(properties)) {
    object['attributes'] = properties;
  } else {
    object['attributes'] = {};
  }
  return object;
};

/**
 * Encode an array of features as EsriJSON.
 *
 * @function
 * @param {Array.<ol.Feature>} features Features.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {string} EsriJSON.
 * @api
 */
_ol_format_EsriJSON_.prototype.writeFeatures;

/**
 * Encode an array of features as a EsriJSON object.
 *
 * @param {Array.<ol.Feature>} features Features.
 * @param {olx.format.WriteOptions=} opt_options Write options.
 * @return {Object} EsriJSON Object.
 * @override
 * @api
 */
_ol_format_EsriJSON_.prototype.writeFeaturesObject = function (features, opt_options) {
  opt_options = this.adaptOptions(opt_options);
  var objects = [];
  var i, ii;
  for (i = 0, ii = features.length; i < ii; ++i) {
    objects.push(this.writeFeatureObject(features[i], opt_options));
  }
  return (/** @type {EsriJSONFeatureCollection} */{
      'features': objects
    }
  );
};
exports.default = _ol_format_EsriJSON_;
module.exports = exports['default'];