mapbox / mapbox/mapbox-maps-ios

Add ability to disable Douglas-Peucker simplification algorithm in GeoJSONSource

Open
#1,101 6 comments 8 reactions 1 assignee View on GitHub

@ZiZasaurus is already working on this.

Since Feb 8, 2022.

auto-triaged feature :green_apple:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## New Feature

Add ability to disable Douglas-Peucker simplification algorithm in `GeoJSONSource`.

## Why

We are trying to draw high precision (< 50cm) geospatial geometry (e.g. lines, arcs, splines) but Douglas-Peucker algorithm simplifies it to lines.

Screenshot 2022-02-08 at 16 34 03

We've found out that the `tolerance` parameter of `GeoJSONSource` drives this algorithm.
Setting this parameter to `0` fixes the issue a little bit, but the final geometry looks noisy. The algorithm still applies some simplification.

Screenshot 2022-02-08 at 16 27 36

It's crucial for our app to draw precise geometry. That's why it would be very handy to have the ability to disable the simplification algorithm.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.