2 Major Differences between HK1980 and WGS84 Coordinate System (and How to Use HK1980 coordinates)
As we suggested in another article, the HK government Open Data API program is using HK1980 coordinate system instead of the more universal WGS84 system. We took some time in studying both system and would like to share with you on our findings.
Disclaimer: we are no expert of coordinate system but only sharing what we found when processing the GovHK Open Data API. Hope this would be helpful for those who are using the API in the future.
There are 2 major differences between HK1980 and universal WGS84 coordinate system:
- Reference ellipsoid
Most people know that our lovely planet Earth is not a perfect sphere but an ellipsoid (imagined pressing a ball from the top and how it deform). This created various problems when we are drawing maps. If Earth is only a ball, all we need to know is the radius and we can easily calculate most of geographical numbers. However, there are a lot variables about the an ellipsoid than sphere, like flattening (i.e. how hard you are pressing on the ball).
Historically, there are different models of the Earth and the coordinates would be a bit different if you are using a different ball model. The WGS84 (the one GPS system are using) is based on the WGS84 ellipsoid model while the HK1980 system is based on the “International Hayford (1910)” ellipsoid model.
2. Origin
Still remember that when you were in high school, the first thing your teacher told you about coordinates was “every coordinate system need to start somewhere”? This is same for the geo-coordinates. We will need to first define a starting point and name it as “zero”. To draw a coordinate system, you can define anywhere on Earth as “zero”, it could be North Pole, New York, Hong Kong.
In fact, it could be anywhere on/in Earth. This is exactly the difference between HK1980 and WGS84 system. WGS84 uses “centre of mass” of Earth as “zero” while HK1980 uses an unused (actually removed) trig in Hong Kong Observatory as “zero”. If you are curious enough to know more, its latitude and longitude is (22°18’12.82"N, 114°10’18.75"E).
Of course, there are also other differences between the two coordinate systems which are more complicated (e.g. projection method, grid system etc.). For a detailed documentation, you can refer to the official document here.
3 Ways in Converting between HK1980 and WGS84 System
As a data scientist, how to handle this kind of data issue would be our major concern, i.e. how we can convert non-universal units into universal system for further processing and analysis.
Luckily, the Hong Kong Government provided really good support in this (probably because they also understand that the HK1980 system is not a universal system). And of course, it is actually really hard for a layman of coordinate system to manually convert it even with excel or calculators (take a look in the formula below).
But don’t worry, there are 3 easy ways for data analyst to do the conversion:
- Manual Conversion
As Hong Kong is a relatively small place, we can use a simple way to do the conversion with minimal error (up to 0.1")
2. Online Conversion
There is also an online tool published by Lands Department of Hong Kong Government. You can access the tool for free and without registration here.
3. API Conversion
If you need API processing on HK1980 coordinates (e.g. using the GovHK Open Data APIs), you can also leverage the free conversion API provided by Lands Department of Hong Kong Government. You can refer to the user manual here. This is the method we used to process the data for the Journey Time Indicator API study (more about the study, please refer to this article).
If you are expert in coordinate system, do let us know if we made any mistakes!