Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Affine trans. matrix element ordering for `ST_Affine`

Open Beginner friendly
#289 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
r
Domain
databases

Research direction

Locate the .trans_f() function in the package source and replace the !!!v splice with c(t(m[, -ncol(m)]), m[, ncol(m)]) to match DuckDB's ST_Affine order. Run the spatial transform tests (including the two new ones) to confirm a rotation is no longer transposed.

Written by the indexing model from the issue text.

Description

  • .trans_f() hands the matrix to ST_Affine() with !!!v, which splices it column by column. For rbind(c(a, b, xoff), c(d, e, yoff)) the call becomes ST_Affine(geometry, a, d, b, e, xoff, yoff), but DuckDB's 2D signature is ST_Affine(geom, a, b, d, e, xoff, yoff). So the 2 × 2 part is transposed and a rotation comes out turned the other way. The two new tests use a translation and a diagonal scale, which give the same result either way. c(t(m[, -ncol(m)]), m[, ncol(m)]) would give DuckDB the order it expects, in 2D and 3D.

Cuiwei

Originally posted by @CuiweiG in #251

Following the above comment, should be an easy fix.

Dominant language
R
Stars
37
Forks
10
Avg merge
22h 46m
Merged PRs (30d)
20

Getting set up

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.

More from HelenaLC/spatialdataR

All issues in HelenaLC/spatialdataR

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.