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

@turf/tag

Package Overview
Dependencies
Maintainers
9
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/tag

turf tag module

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
832K
increased by52.8%
Maintainers
9
Weekly downloads
 
Created

What is @turf/tag?

@turf/tag is a module within the Turf.js library that allows you to tag points with properties from polygons. This is particularly useful for geospatial analysis where you need to associate point data with the regions they fall into.

What are @turf/tag's main functionalities?

Tagging Points with Polygon Properties

This feature allows you to tag points with properties from polygons they fall into. In this example, points are tagged with the 'name' property from the polygons.

const turf = require('@turf/turf');

const points = turf.points([
  [-77, 44],
  [-77, 38],
  [-77, 39]
]);

const polygons = turf.featureCollection([
  turf.polygon([[[-80, 41], [-70, 41], [-70, 39], [-80, 39], [-80, 41]]], { name: 'polygon1' }),
  turf.polygon([[[-80, 45], [-70, 45], [-70, 43], [-80, 43], [-80, 45]]], { name: 'polygon2' })
]);

const taggedPoints = turf.tag(points, polygons, 'name', 'polygonName');
console.log(taggedPoints);

Other packages similar to @turf/tag

Keywords

FAQs

Package last updated on 09 Aug 2024

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