locationtech / locationtech/spatial4j

Compute polygon approximation of geodetic circle

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

InternIdea
Dominant language
Java
Stars
961
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Given a geodetic circle, produce a polygon that encloses (i.e. circumscribes) the true circle shape. It should take an additional input that is the maximum error distance between the edge of the true circle and any given vertex; the smaller this error distance is, the more points will be needed to approximate the circle. Furthermore, the polygon must fit within the bounding box of the circle.

I've seen code that instead produces a series of points along the circle at fixed angles but that produces a shape that does not include some of the outer edge of the circle. To add further detail to this task, the polygon is projected directly in lat-lon space (just as polygons are done now in Spatial4j.

If this task were done about perfectly, then the outer polygon's sides would all be tangent to the circle so as to minimize cumulative error. If that proves too challenging then I've worked out a loose algorithm for solving this task but doesn't produce perfectly tangent edges except for the edges coinciding with the bounding box.

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

The issue names no files or tests. Start by locating Spatial4j’s existing geodetic-circle and lat-lon polygon entry points, then compare their behavior with the enclosure, error-distance, and bounding-box requirements. Done means the new behavior is specified and tested for a polygon that contains the true circle while remaining within its bounding box.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.