noandrea / geo2tz

A self-hostable REST-like API to get the time zone from geo coordinates
MIT License
63 stars 14 forks source link

Docker build returning incorrect results #33

Closed LarrySonar closed 18 hours ago

LarrySonar commented 1 week ago

We utilize the docker image using @latest and the 2.2.0 is not returning correct results. Here are some examples:


curl http://geo2tz:2004/tz/43.74206/-87.73337
{"coords":{"lat":43.74206,"lon":-87.73337},"tz":"America/Detroit"}

Should be returning tz: America/Chicago


curl http://geo2tz:2004/tz/44.50144/-88.0625889
{"coords":{"lat":44.50144,"lon":-88.0625889},"tz":"America/Detroit"}

Again, tz: America/Chicago is correct.


curl http://geo2tz:2004/tz/50/40
{"coords":{"lat":50,"lon":40},"tz":"Europe/Kyiv"}

Should be returning tz: Europe/Moscow


Please let me know if any further information is needed. Thanks!

noandrea commented 1 week ago

thanks for reporting, yes this version fixes errors where location were not found at all but it is less precise than before. I will work on a fix, meanwhile use version 2.1.5:

docker run --pull=always -p 2004:2004 ghcr.io/noandrea/geo2tz:2.1.5
LarrySonar commented 1 week ago

Appreciate the quick response! Precision is important for us, so we have rolled back to an earlier version and will monitor for changes.

noandrea commented 1 week ago

@LarrySonar should be fixed in https://github.com/noandrea/geo2tz/releases/tag/v2.3.0 can you give it a go?

LarrySonar commented 1 week ago

This is indeed resolved in that release, all of the previous issues have been corrected. Thanks for the rapid fix!

LarrySonar commented 4 days ago

While fixed in 2.3.0 it is broken in 2.4.0. The coordinates 0, 0 are returning Pacific/Honolulu and should be returning Etc/GMT.

noandrea commented 4 days ago

I cannot reproduce, here are the results I get running it locally:

version request

➜ curl -s http://localhost:2004/tz/version | jq 
{
  "version": "2024a",
  "url": "https://github.com/evansiroky/timezone-boundary-builder/releases/tag/2024a",
  "geo_data_url": "https://github.com/evansiroky/timezone-boundary-builder/releases/download/2024a/timezones-with-oceans.geojson.zip"
}

coordinates request

➜ curl -s http://localhost:2004/tz/0/0 | jq    
{
  "coords": {
    "lat": 0,
    "lon": 0
  },
  "tz": "Etc/GMT"
}

server logs

➜ docker run --pull=always -p 2004:2004 ghcr.io/noandrea/geo2tz:latest
latest: Pulling from noandrea/geo2tz
Digest: sha256:6f4db352cbe26ecb415a3ab600f106a9c3cbf4feddea05732f76502a880b21cb
Status: Image is up to date for ghcr.io/noandrea/geo2tz:latest

  _____           ___  _
 / ____|         |__ \| |
| |  __  ___  ___   ) | |_ ____
| | |_ |/ _ \/ _ \ / /| __|_  /
| |__| |  __/ (_) / /_| |_ / /
 \_____|\___|\___/____|\__/___| version 2.4.0
⇨ http server started on [::]:2004
{"time":"2024-07-01T14:59:22.315462477Z","id":"","remote_ip":"172.17.0.1","host":"localhost:2004","method":"GET","uri":"/tz/version","user_agent":"curl/7.81.0","status":200,"error":"","latency":20320,"latency_human":"20.32µs","bytes_in":0,"bytes_out":234}
{"time":"2024-07-01T14:59:28.355996568Z","id":"","remote_ip":"172.17.0.1","host":"localhost:2004","method":"GET","uri":"/tz/0/0","user_agent":"curl/7.81.0","status":200,"error":"","latency":67025,"latency_human":"67.025µs","bytes_in":0,"bytes_out":44}
noandrea commented 18 hours ago

closing as I cannot reproduce it, @LarrySonar please reopen if you have more details about the issue you are facing