# Converting latitude/longitude into a slab number (or item number) and vice versa?

Purpose: To compress the data transmission for the longitude and the latitude. Initially these datas are in the form DD.MM.mmmm: degrees, minutes, ten thousandths of a minute. Latitude stands under 28 bits and longitude occupies 29 bits. So for each position one must transmit 57 bits.

To reduce the amount of data to be transmitted, we start from the following principle: If we set the precision of the position to 1 meter (for example) and that we divide the earth, in the considering as a sphere, in slabs of 1 square meter contiguous, we obtain a number of slabs < 2^49 so instead of transmitting latitude latitude position under 57 bits one can transmit the number of the slab under 49 bits (gain 8 bits per transmission).

Do you know how to convert longitude/latitude in a slab number (or item number) and vice vesa? what is the equation or algorithm to do it?

• Since a "slab" is a product of your own creation, it's unlikely that tools exist for this. Geohashes exist, but they use a dozen characters at that precision. It seems as if you will be paying an exorbitant computing cost for those eight bits. – Vince Aug 28 at 13:01
• How precise are your locations? If 3x3 m is good enough, have a look at what3words. – Erik Aug 28 at 13:21
• The precision is 1*1 m – user2912344 Aug 28 at 15:11