New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/tag

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/tag

turf tag module

7.2.0
latest
Source
npm
Version published
Maintainers
0
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

geojson

FAQs

Package last updated on 29 Dec 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