Socket
Socket
Sign inDemoInstall

topojson-client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

topojson-client

Manipulate TopoJSON and convert it to GeoJSON.


Version published
Weekly downloads
1.2M
increased by2.89%
Maintainers
1
Weekly downloads
 
Created

What is topojson-client?

The topojson-client npm package provides utilities for converting TopoJSON to GeoJSON, manipulating and transforming TopoJSON objects, and extracting specific geometries from TopoJSON. It is useful for client-side manipulation of geographic data in TopoJSON format.

What are topojson-client's main functionalities?

Convert TopoJSON to GeoJSON

This feature allows you to convert a TopoJSON object into a GeoJSON object. The 'feature' function takes a TopoJSON topology and a specific object within that topology and converts it to a GeoJSON Feature or FeatureCollection.

const topojsonClient = require('topojson-client');
const geojson = topojsonClient.feature(topology, topology.objects.yourObjectName);

Merge multiple geometries into a single geometry

The 'merge' function combines multiple geometries into a single geometry. This is useful for creating a single shape from multiple adjacent or overlapping features.

const topojsonClient = require('topojson-client');
const mergedGeometry = topojsonClient.merge(topology, topology.objects.yourObjectName.geometries);

Extract and convert a specific geometry

The 'mesh' function is used to extract a specific geometry from a TopoJSON object and convert it to GeoJSON. This is particularly useful for extracting borders or edges.

const topojsonClient = require('topojson-client');
const geometry = topojsonClient.mesh(topology, topology.objects.yourObjectName);

Other packages similar to topojson-client

Keywords

FAQs

Package last updated on 06 Nov 2019

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