Class: GeoJSONX

GeoJSONX

Feature format for reading and writing data in the GeoJSONX format.


new GeoJSONX(options)

Parameters:
Name Type Description
options *

options.

Properties
Name Type Argument Default Description
decimals number

number of decimals to save, default 7 for EPSG:4326, 2 for other projections

deleteNullProperties boolean | Array.<*>

An array of property values to remove, if false, keep all properties, default [null,undefined,""]

extended boolean | Array.<*>

Decode/encode extended GeoJSON with foreign members (id, bbox, title, etc.), default false

whiteList Array.<string> | function

A list of properties to keep on features when encoding or a function that takes a property name and retrun true if the property is whitelisted

blackList Array.<string> | function

A list of properties to remove from features when encoding or a function that takes a property name and retrun true if the property is blacklisted

layout string <optional>
'XY'

layout layout (XY or XYZ or XYZM)

dataProjection ol.ProjectionLike

Projection of the data we are reading. If not provided EPSG:4326

featureProjection ol.ProjectionLike

Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.

Extends

  • ol.format.GeoJSON

Members


_radix

Radix


_size

Radix size


_toType

GeoSJONX types


_type

GeoSJON types

Methods


decodeCoordinates(v, decimal)

Decode coordinates

Parameters:
Name Type Description
v string | Array.<string>
decimal number

Number of decimals

Returns:

v

Type
ol.coordinate | Array.<ol.coordinate>

decodeNumber(s, decimals)

Decode a number

Parameters:
Name Type Description
s string
decimals number

Number of decimals

Returns:
Type
number

encodeCoordinates(v, decimal)

Encode coordinates

Parameters:
Name Type Description
v ol.coordinate | Array.<ol.coordinate>
decimal number
Returns:
Type
string | Array.<string>

encodeNumber(number, decimals)

Encode a number

Parameters:
Name Type Description
number number

Number to encode

decimals number

Number of decimals

string

getLayout()

Get geometry layout

Returns:

layout

Type
string

readFeatureFromObject(object, options)

Decode GeoJSONX Feature object.

Parameters:
Name Type Description
object *

GeoJSONX

options *

Read options.

Returns:
Type
ol.Feature

readFeaturesFromObject(object, options)

Decode a GeoJSONX object.

Parameters:
Name Type Description
object *

GeoJSONX

options *

Read options.

Returns:
Type
Array.<ol.Feature>

setLayout(layout)

Set geometry layout

Parameters:
Name Type Description
layout string

the geometry layout (XY or XYZ or XYZM)


writeFeatureObject(feature, options)

Encode a set of features as a GeoJSONX object.

Parameters:
Name Type Description
feature ol.Feature

Feature

options *

Write options.

Returns:

GeoJSONX Object.

Type
*

writeFeaturesObject(features, options)

Encode an array of features as a GeoJSONX object.

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

Features.

options *

Write options.

Returns:

GeoJSONX Object.

Type
*

writeGeometryObject(geometry, options)

Encode a geometry as a GeoJSONX object.

Parameters:
Name Type Description
geometry ol.geom.Geometry

Geometry.

options *

Write options.

Returns:

Object.

Type
*