latlong icon indicating copy to clipboard operation
latlong copied to clipboard

Denmark coords resolve as Asia/Phnom_Penh

Open cicika opened this issue 10 years ago • 10 comments

Hi!

There's a patch of Denmark that resolves into Asia/Phnom_Penh timezone, which is quite unusual. I would have addressed the problem myself, but, admittedly, I have been playing with the language only for a short while, and wouldn't even know where to start.

Example coords: 55.850667, 12.56804

Awesome lib by the way and a wonderful solution to the problem.

Thanks!

cicika avatar Feb 20 '15 14:02 cicika

I have confirmed this using latest tz_world data. Using this code, I found the bounding box of this anomaly to be:

http://bbox.me/osm/index.html?bbox=55.812497,12.562490,56.000007,12.750010

I've opened the tz_world shapefile in Qgis and AFAIK it looks OK. Selecting 'Asia/Phnom_Penh' and zooming in on that does not include any area near Denmark.

porjo avatar Mar 05 '15 02:03 porjo

Sorry, I can't look at this anytime soon. I'm offline for two weeks starting tomorrow, on vacation. Let me know if you discover any other clues.

bradfitz avatar Mar 05 '15 17:03 bradfitz

~~I notice that the tests are failing and timezone Asia/Phnom_Penh appears in the output. Coincidence?~~

Sorry, ignore that. Tests were failing due to non-existence of tables. Tests are OK :blush:

latlong_test.go contains this comment alluding to a previous bug involving Asia/Phnom_Penh

                // previous bug with the wrong oceanIndex. This pixmap
                // leaf resolves to leaf index 0xff (Asia/Phnom_Penh).
                // It was being treated as a special value. It's not.

porjo avatar Mar 06 '15 07:03 porjo

Singapore airport also resolves to Asia/Phnom_Penh... If I ever get the time I might make a pull request.

cicika avatar Apr 30 '15 13:04 cicika

@bradfitz I know that this library isn't supposed to be very accurate and you probably don't have time to mantain this.

Would you have recommendations for a more accurate go library to use?

sidazhang avatar Oct 12 '16 06:10 sidazhang

Not off the top of my head.

bradfitz avatar Nov 27 '16 23:11 bradfitz

@cicika, @sidazhang, could either of you try this again with the latest data?

bradfitz avatar Apr 10 '17 18:04 bradfitz

I tested this earlier and thought it looked good, but turns out that the coords @cicika supplied now return no timezone! e.g.

        lat := 55.850667
	lon := 12.56804
	fmt.Println(latlong.LookupZoneName(lat, lon))

returns blank. I've tried a few other locations around the globe and they return correct results.

porjo avatar Apr 10 '17 21:04 porjo

I still get the above result – blank zone names for certain lat, lng's, looks like it's usually when it's close to the water.

alex-fung avatar Mar 15 '18 20:03 alex-fung

For Singapore I also get blank zone names

lat := 1.294719
long := 103.774107
fmt.Println(latlong.LookupZoneName(lat, long))

How to fix it?

vsile avatar Feb 19 '19 06:02 vsile