Socket
Socket
Sign inDemoInstall

@types/geojson

Package Overview
Dependencies
0
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/geojson

TypeScript definitions for geojson


Version published
Weekly downloads
4M
increased by5.12%
Maintainers
1
Install size
7.92 kB
Created
Weekly downloads
 

Package description

What is @types/geojson?

The @types/geojson package provides TypeScript type definitions for the GeoJSON format. It allows developers to use GeoJSON objects in TypeScript projects with type checking, enabling them to work with geographical data structures according to the GeoJSON specification. This package does not include functionality to manipulate GeoJSON data but rather ensures type safety and autocompletion when working with GeoJSON in TypeScript.

What are @types/geojson's main functionalities?

Defining GeoJSON Objects

This code sample demonstrates how to define a GeoJSON object representing a feature collection with TypeScript. The @types/geojson package ensures that the object structure adheres to the GeoJSON specification.

{"type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}

Type Checking GeoJSON Objects

This code sample shows how to use the @types/geojson package for type checking a GeoJSON object. It ensures that the object conforms to the GeoJSON specification for a FeatureCollection containing Point features.

import { FeatureCollection, Point } from 'geojson';

const myGeoJsonObject: FeatureCollection<Point> = {
  type: 'FeatureCollection',
  features: [
    {
      type: 'Feature',
      geometry: {
        type: 'Point',
        coordinates: [102.0, 0.5]
      },
      properties: {}
    }
  ]
};

Other packages similar to @types/geojson

Readme

Source

Installation

npm install --save @types/geojson

Summary

This package contains type definitions for geojson (https://geojson.org/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson.

Additional Details

  • Last updated: Tue, 30 Jan 2024 21:35:45 GMT
  • Dependencies: none

Credits

These definitions were written by Jacob Bruun, Arne Schubert, Jeff Jacobson, Ilia Choly, and Dan Vanderkam.

FAQs

Last updated on 30 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc