Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/geojson-types

Package Overview
Dependencies
Maintainers
14
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/geojson-types

Flow type declarations for [GeoJSON](https://tools.ietf.org/html/rfc7946).

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
513K
increased by3.87%
Maintainers
14
Weekly downloads
 
Created

What is @mapbox/geojson-types?

@mapbox/geojson-types is a TypeScript library that provides type definitions for GeoJSON objects. It helps developers ensure that their GeoJSON data adheres to the correct structure and types, making it easier to work with GeoJSON data in a type-safe manner.

What are @mapbox/geojson-types's main functionalities?

Point

Defines a GeoJSON Point object with specific coordinates.

const point: GeoJSON.Point = { type: 'Point', coordinates: [100.0, 0.0] };

LineString

Defines a GeoJSON LineString object with an array of coordinate pairs.

const lineString: GeoJSON.LineString = { type: 'LineString', coordinates: [[100.0, 0.0], [101.0, 1.0]] };

Polygon

Defines a GeoJSON Polygon object with an array of linear rings.

const polygon: GeoJSON.Polygon = { type: 'Polygon', coordinates: [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]] };

Feature

Defines a GeoJSON Feature object that includes a geometry and properties.

const feature: GeoJSON.Feature<GeoJSON.Point> = { type: 'Feature', geometry: { type: 'Point', coordinates: [100.0, 0.0] }, properties: { name: 'Sample Point' } };

FeatureCollection

Defines a GeoJSON FeatureCollection object that includes an array of features.

const featureCollection: GeoJSON.FeatureCollection<GeoJSON.Geometry> = { type: 'FeatureCollection', features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [100.0, 0.0] }, properties: { name: 'Sample Point' } }] };

Other packages similar to @mapbox/geojson-types

FAQs

Package last updated on 30 Jul 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc