Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of decimal places and breakpoints in measure and draw tool #2020

Open
asemoller opened this issue May 29, 2024 · 1 comment
Open

Number of decimal places and breakpoints in measure and draw tool #2020

asemoller opened this issue May 29, 2024 · 1 comment

Comments

@asemoller
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We're having some concerns regarding the number of decimal places and breakpoints shown in the measure and draw tool. We would like if number of decimal places and breakpoints could be an option in the config file.

For example, we would like to have these settings:

  • 1 decimal place for lenghts of less than 10 m (we never want to show accuracy in centimetre)
  • no decimal place for lenghts shown in m and exceeding 10 m
  • 2 decimal places for lenghts shown in km (high and low)
  • no decimal place for areas shown in kvm
  • 2 decimal places for areas shown in ha and is less than 10 ha
  • 1 decimal places for areas shown in ha and is larger than 10 ha
  • 2 decimal places for areas shown in kvkm (high and low)

We're aware that others may think differently so that's why we want it to be an option, if it's possible.

Related issues: #881 and #1617.

@tonnyandersson
Copy link
Collaborator

tonnyandersson commented Jun 11, 2024

I think the main challenge is to figure out how to do this in a way that isn't a complete *insert expletive* nightmare from an admin, developer or user perspective.

Came up with this for your length example:

[
  {
    "breakpoint": 10, // If less than...
    "divisor": 1, // Divide length in meters with...
    "precision": 1, // Number of decimals
    "unit": "m" // Duh...
  },
  {
    "breakpoint": 1000,
    "divisor": 1,
    "precision": 0,
    "unit": "m"
  },
  {
    "breakpoint": "Infinity",
    "divisor": 1000,
    "precision": 2,
    "unit":" km"
  }
]

Makes sense? I dunno.

EDIT: Parameters could be shortened to...

[
  [10, 1, 1, "m"],
  [1000, 1, 0, "m"],
  ["Infinity", 1000, 2, "km"]
]

...to save space, at the expense of readablilty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants