Socket
Socket
Sign inDemoInstall

turf-circle

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    turf-circle

turf circle module


Version published
Maintainers
1
Install size
53.7 kB
Created

Readme

Source

turf-circle

build status

turf circle module

turf.circle(center, radius, steps, units)

Takes a Point and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.

Parameters

parametertypedescription
centerFeature.<Point>center point
radiusNumberradius of the circle
stepsNumbernumber of steps
unitsStringmiles, kilometers, degrees, or radians

Example

var center = {
  "type": "Feature",
  "properties": {
    "marker-color": "#0f0"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-75.343, 39.984]
  }
};
var radius = 5;
var steps = 10;
var units = 'kilometers';

var circle = turf.circle(center, radius, steps, units);

var result = {
  "type": "FeatureCollection",
  "features": [center, circle]
};

//=result

Returns Feature.<Polygon>, circle polygon

Installation

Requires nodejs.

$ npm install turf-circle

Tests

$ npm test

Keywords

FAQs

Last updated on 02 Jun 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc