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

[Map] Add new helpers: DistanceUnit, DistanceCalculator, CoordinateUtils #2551

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Feb 6, 2025

Q A
Bug fix? no
New feature? yes
Issues Fix #
License MIT

To ease the work on distances while managing maps, this PR introduce some new tools

  • DistanceUnit enum, that contains the most common distance units and their conversion ratios
  • A DistanceCalculatorInterface, and 3 implementations (most commonly used formulas)
  • A DistanceCalculator final service, that defaults to Vincenty formula and Meter unit
  • A CoordinateUtils helper to convert DMS coordinates (48° 7′ 3″ N) in decimal ones (48.1175 N)

Also, added getLatitude() and getLongitude() on Point, avoiding the use of toArray()

@smnandre smnandre requested a review from Kocal as a code owner February 6, 2025 00:15
@carsonbot carsonbot added Feature New Feature Map Status: Needs Review Needs to be reviewed labels Feb 6, 2025
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Feb 6, 2025
@smnandre smnandre force-pushed the map/distance-unit-calculator branch from 48a2c88 to 381bc6e Compare February 7, 2025 23:56
@smnandre smnandre merged commit 33a4141 into symfony:2.x Feb 7, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Map Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants