New module proposal: Transform
See original GitHub issueInspired by PR #729 and the necessity to use a rotated gridPoint
as turf-isobands
input, I’d like to implement the following basic transformation functions, if of interest in Turf
:
@turf/transform-translate
- Moves a feature of
distance
kilometers (orunits
) on a specificdirection
angle - 3rd (z) coordinates support
/**
@param {GeoJSON}` **object** to be translated
@param {Number}` **distance** length of the motion
@param {Number}` **direction** angle/bearing of the motion, in degrees from North (positive clockwise)
@param {String}` **units** (optional, default Km) unit for distance
@returns {Feature<any>}` the translated Feature
@turf/transform-scale
- Enlarges or shrinks a feature by a scale
factor
. - 3rd (z) coordinates support
/**
@param {GeoJSON}` **object** to be scaled
@param {Number}` **factor** scale factor (positive number)
@param {Feature|Geometry<Point>|Array<number>}` **origin** point (of the Feature) around which the scaling will occur, defaults to centroid
@returns {Feature<any>}` the scaled Feature
@turf/transform-rotate
- Rotates a feature of
angle
degrees around a fixedpoint
(default to its center/center of mass/centroid) - 3rd (z) coordinates support (rotation only by z axis, i.e. on the x,y plane)
/**
@param {GeoJSON}` **object** to be rotated
@param {Number}` **angle** extent of the rotation, in degrees from North (positive clockwise)
@param {Feature|Geometry<Point>|Array<number>}` **pivot**, point around which the rotation will occur, defaults to `centroid`
@returns {Feature<any>}` the rotated Feature
Geometry Support
Geometry|Feature<Point>
=>Feature<Point>
Geometry|Feature<LineString>
=>Feature<LineString>
Geometry|Feature<Polygon>
=>Feature<Polygon>
Geometry|Feature<MultiPoint>
=>Feature<MultiPoint>
Geometry|Feature<MultiLineString>
=>Feature<MultiLineString>
Geometry|Feature<MultiPolygon>
=>Feature<MultiPolygon>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Proposal Creation
In this module you will learn how to: ▫ Create a new proposal. ▫ Navigate the proposal. ▫ Assign proposal permissions. ▫ Track...
Read more >Module 5 | UCLA OCGA
In this module you will learn how to: ❑Create a new proposal. ❑Navigate the proposal ... ❑Lock/Break Lock. ❑Copy/Transform proposals. Objectives ...
Read more >Proposal for a New Module ARO 035b - University of Stirling
Proposal for a New Module ARO 035b. This form should be used, in conjunction with the Module Descriptor (ARO 035a) to submit new...
Read more >BUS 6120 Module 4 Resistance Transformation Proposal ...
Module answer and details for the course bus 6120 module resistance transformation proposal worksheet directions: use this worksheet to create proposal to.
Read more >babel/plugin-proposal-dynamic-import depends on a modules ...
My repo has babel-jest installed, and my project's babel.config.js is this: module.exports = { presets: [ [ "@babel/preset ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Woot 🎉 https://github.com/Turfjs/turf/pull/759
My 👍 votes for the following:
@turf/transform-rotate
,@turf/transform-translate
,@turf/transform-scale
)pivot
param name for@turf/transform-rotate
origin
param for `@turf/transform-scale