• Version 7946.0.7
  • Published
  • 8.51 kB
  • No dependencies
  • MIT license


npm i @types/geojson
yarn add @types/geojson
pnpm add @types/geojson


TypeScript definitions for geojson



interface Feature

interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties>
extends GeoJsonObject {}
  • A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2

property geometry

geometry: G;
  • The feature's geometry

property id

id?: string | number;
  • A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2.

property properties

properties: P;
  • Properties associated with this feature.

property type

type: 'Feature';

    interface FeatureCollection

    interface FeatureCollection<
    G extends Geometry | null = Geometry,
    P = GeoJsonProperties
    > extends GeoJsonObject {}
    • A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3

    property features

    features: Array<Feature<G, P>>;

      property type

      type: 'FeatureCollection';

        interface GeoJsonObject

        interface GeoJsonObject {}
        • The base GeoJSON object. https://tools.ietf.org/html/rfc7946#section-3 The GeoJSON specification also allows foreign members (https://tools.ietf.org/html/rfc7946#section-6.1) Developers should use "&" type in TypeScript or extend the interface to add these foreign members.

        property bbox

        bbox?: BBox;
        • Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5

        property type

        type: GeoJsonTypes;
        • Specifies the type of GeoJSON object.

        interface GeometryCollection

        interface GeometryCollection extends GeoJsonObject {}
        • Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8

        property geometries

        geometries: Geometry[];

          property type

          type: 'GeometryCollection';

            interface LineString

            interface LineString extends GeoJsonObject {}
            • LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4

            property coordinates

            coordinates: Position[];

              property type

              type: 'LineString';

                interface MultiLineString

                interface MultiLineString extends GeoJsonObject {}
                • MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5

                property coordinates

                coordinates: Position[][];

                  property type

                  type: 'MultiLineString';

                    interface MultiPoint

                    interface MultiPoint extends GeoJsonObject {}
                    • MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3

                    property coordinates

                    coordinates: Position[];

                      property type

                      type: 'MultiPoint';

                        interface MultiPolygon

                        interface MultiPolygon extends GeoJsonObject {}
                        • MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7

                        property coordinates

                        coordinates: Position[][][];

                          property type

                          type: 'MultiPolygon';

                            interface Point

                            interface Point extends GeoJsonObject {}
                            • Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2

                            property coordinates

                            coordinates: Position;

                              property type

                              type: 'Point';

                                interface Polygon

                                interface Polygon extends GeoJsonObject {}
                                • Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6

                                property coordinates

                                coordinates: Position[][];

                                  property type

                                  type: 'Polygon';

                                    Type Aliases

                                    type BBox

                                    type BBox =
                                    | [number, number, number, number]
                                    | [number, number, number, number, number, number];
                                    • Bounding box https://tools.ietf.org/html/rfc7946#section-5

                                    type GeoJSON

                                    type GeoJSON = Geometry | Feature | FeatureCollection;
                                    • Union of GeoJSON objects.

                                    type GeoJsonGeometryTypes

                                    type GeoJsonGeometryTypes = Geometry['type'];
                                    • The valid values for the "type" property of GeoJSON geometry objects. https://tools.ietf.org/html/rfc7946#section-1.4

                                    type GeoJsonProperties

                                    type GeoJsonProperties = { [name: string]: any } | null;

                                      type GeoJsonTypes

                                      type GeoJsonTypes = GeoJSON['type'];
                                      • The value values for the "type" property of GeoJSON Objects. https://tools.ietf.org/html/rfc7946#section-1.4

                                      type Geometry

                                      type Geometry =
                                      | Point
                                      | MultiPoint
                                      | LineString
                                      | MultiLineString
                                      | Polygon
                                      | MultiPolygon
                                      | GeometryCollection;
                                      • Geometry object. https://tools.ietf.org/html/rfc7946#section-3

                                      type GeometryObject

                                      type GeometryObject = Geometry;

                                        type Position

                                        type Position = number[];
                                        • A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.

                                        Package Files (1)

                                        Dependencies (0)

                                        No dependencies.

                                        Dev Dependencies (0)

                                        No dev dependencies.

                                        Peer Dependencies (0)

                                        No peer dependencies.


                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/geojson.

                                        • Markdown
                                        • HTML
                                          <a href="https://www.jsdocs.io/package/@types/geojson"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>