[Feature]: Bend Lines: straight origin–destination lines as arcs

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
49/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by reading the Cartography toolbox tools and the implementations of geolibre:generate_od_links, geolibre:table_to_geometry, and geolibre:geodetic_densify to learn how tools produce geometry and notices. Then trace how a two-point line is represented and how generated polylines are tested. Done means a Bend Lines tool creates left-side arcs with the proposed bulge and vertex defaults, reports multi-vertex inputs, and copies and counts zero-length lines.

Written by the indexing model from the issue text.

Description

What's missing

geolibre:generate_od_links and geolibre:table_to_geometry (XY To Line) draw origin–destination lines as straight segments. On a flow map they overlap where two places send to each other, and they cross every other line in a bundle. geolibre:geodetic_densify gives the great-circle path, which is a different thing: at a regional scale it is nearly straight.

Proposal

A Bend Lines tool (bendLines, Cartography toolbox) that turns each two-point line into an arc:

  • Bulge: the arc's height as a share of its length (default 0.2).
  • Side: always to the left of the direction of travel, so A → B and B → A become two separate arcs.
  • Vertices: a quadratic curve sampled every few degrees of turn (default 24 points), so the result is an ordinary polyline that every other tool, export and renderer already reads.
  • Lines with more than two vertices are bent between their ends and say so in a notice; lines of zero length are copied as they are, counted.

Choices in this proposal

  • A tool, not a symbol option: the arc becomes real geometry, so it exports to GeoJSON or GeoPackage and labels follow it. A symbol-only curve would be lost on export.
  • Bend to the left of travel, the cartographic convention for flow maps: opposite flows don't overlap.
  • In RustGIS, not in GeoLibre: it is a cartographic tool, next to the other Cartography tools.
Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
11h 1m
Merged PRs (30d)
942

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 opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.