1. turf-polygon
turf polygon module
turf-polygon
Package: turf-polygon
Created by: Turfjs
Last modified: Mon, 27 Jun 2022 23:31:04 GMT
Version: 1.0.3
License: MIT
Downloads: 23,644
Repository: https://github.com/Turfjs/turf-polygon

Install

npm install turf-polygon
yarn add turf-polygon

turf-polygon

build status

turf polygon module

turf.polygon(rings, properties)

Takes an array of LinearRings and optionally an Object with properties and returns a GeoJSON Polygon feature.

Parameters

parameter type description
rings Array.<Array.> - an array of LinearRings
properties Object - an optional properties object

Example

 var polygon = turf.polygon([[
 [-2.275543, 53.464547],
 [-2.275543, 53.489271],
 [-2.215118, 53.489271],
 [-2.215118, 53.464547],
 [-2.275543, 53.464547]
]], { name: 'poly1', population: 400});

//=polygon

//=polygon.properties

Installation

Requires nodejs.

 $ npm install turf-polygon

Tests

 $ npm test

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin