ol.format.GeoJSON

new GeoJSON

Stability: experimental

Provide access to features stored in the GeoJSON format.

Parameters:
Name Type Argument Description
options olx.format.GeoJSONOptions <optional>

Options.

Properties
Name Type Description
defaultProjection ol.proj.ProjectionLike

Default projection.

Source:
  • geojsonformat.js, line 31

Extends

  • ol.format.JSONFeature

Methods

readFeature

Stability: experimental

Read a feature from a GeoJSON Feature source. This method will throw an error if used with a FeatureCollection source.

Parameters:
Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

Source:
  • geojsonformat.js, line 327
Returns:

Feature.

Type
ol.Feature

readFeatures

Stability: experimental

Read all features from a GeoJSON source. Works with both Feature and FeatureCollection sources.

Parameters:
Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

Source:
  • geojsonformat.js, line 339
Returns:

Features.

Type
Array.<ol.Feature>

readGeometry

Stability: experimental

Read a geometry from a GeoJSON source.

Parameters:
Name Type Description
source ArrayBuffer | Document | Node | Object | string

Source.

Source:
  • geojsonformat.js, line 393
Returns:

Geometry.

Type
ol.geom.Geometry

readProjection

Stability: experimental

Read the projection from the GeoJSON source file.

Parameters:
Name Type Description
object ArrayBuffer | Document | Node | Object | string

Source.

Source:
  • geojsonformat.js, line 412
Returns:

Projection.

Type
ol.proj.Projection

writeFeature

Stability: experimental

Encode a feature as a GeoJSON Feature object.

Parameters:
Name Type Description
feature ol.Feature

Feature.

Source:
  • geojsonformat.js, line 442
Returns:

Result.

Type
ArrayBuffer | Node | Object | string

writeFeatures

Stability: experimental

Encode an array of features as GeoJSON.

Parameters:
Name Type Description
features Array.<ol.Feature>

Features.

Source:
  • geojsonformat.js, line 478
Returns:

Result.

Type
ArrayBuffer | Node | Object | string