spring-projects / spring-data-elasticsearch

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-elasticsearch/
Apache License 2.0
2.92k stars 1.33k forks source link

Fix GeoHash toString conversion #3001

Closed sothawo closed 4 days ago

sothawo commented 4 days ago

In the org.springframework.data.elasticsearch.utils.geohash.Geohash#toLatLon() method the code currently uses

String.format("%f,%f", point.getLat(), point.getLon());

to convert a geopoint to a String containing lat,lon values. This produces a wrong string when running in a Locale where the decimal separator is a comma (germany for example). Need to be fixed to use a defined Locale in formatting