Socket
Socket
Sign inDemoInstall

turf-circle

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-circle

turf circle module


Version published
Maintainers
2
Created
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

Package last updated on 15 Jun 2016

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