Turfjs / Turfjs/turf

transformScale with `mutate: true` creates wrong shape

Open
#2,725 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/transform-scale
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

reproduced with Turf version 7.1 running at https://turf-sandbox.netlify.app/ with the following code, results with wrong shape (screenshot attached)

const bbox = [34.785947387585615, 32.06427402333092, 34.8024054221005, 32.07576582361696];

const poly = turf.bboxPolygon(bbox);
const poly2 = turf.bboxPolygon(bbox);

const scaledPoly = turf.transformScale(poly, 1.7, {mutate: false})
const scaledPoly2Mutated = turf.transformScale(poly2, 1.7, {mutate: true})

return turf.featureCollection([poly , scaledPoly, scaledPoly2Mutated]);

possibly similar to https://github.com/Turfjs/turf/issues/895 which was resolved.

4EZV7s2sM8kT2Eh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided bboxPolygon and transformScale example in the Turf sandbox, then inspect the transformScale entry point and the behavior described in issue #895. Done means the mutate: true and mutate: false results have the same correct shape for this reproduction, with regression coverage added in the project’s existing test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.