Skip to content

Conversation

@robho
Copy link
Contributor

@robho robho commented Jan 2, 2026

The return value of Distance() differs depending on which version of that's used:

Distance( geom1 Geometry , geom2 Geometry ) : Double precision
return the distance between geom1 and geom2 (always measured in CRS units).

Distance( geom1 Geometry , geom2 Geometry ,
use_ellipsoid Boolean ) : Double precision
return the distance between geom1 and geom2 (measured in meters).

Fixes #411

@robho
Copy link
Contributor Author

robho commented Jan 2, 2026

I haven't actually tested this in Android Auto. I've only tested that the locations returned from getChargeLocationsRadius are now sorted in the same order as distanceBetween would sort the locations.

The return value of Distance() differs depending on which version of that's
used:

Distance( geom1 Geometry , geom2 Geometry ) : Double precision
  return the distance between geom1 and geom2 (always measured in CRS units).

Distance( geom1 Geometry , geom2 Geometry ,
          use_ellipsoid Boolean ) : Double precision
  return the distance between geom1 and geom2 (measured in meters).

Ordering by CRS units causes unexpected item order.

Fixes ev-map#411
@robho robho force-pushed the distance_sorting branch from f63c817 to d74c867 Compare January 2, 2026 16:31
@johan12345
Copy link
Collaborator

Happy new year and thanks a lot!

@johan12345 johan12345 merged commit fa0826c into ev-map:master Jan 2, 2026
8 checks passed
@robho robho deleted the distance_sorting branch January 2, 2026 18:15
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

Successfully merging this pull request may close these issues.

Auto: Nearest chargers are not correctly sorted by distance (OCM, OSM, Nobil)

2 participants