Ein Python-Skript, das dezimale Breiten- und Längengrade in Mesh-Code konvertiert. (Manchmal versuche ich, einen Beitrag zur Community zu leisten ...)
Coordinate2MeshCode.py
def Coordinate2MeshCode( dLat, dLng ):
# cf: http://white-bear.info/archives/1400
# Make sure the input values are decimal
iMeshCode_1stMesh_Part_p = dLat *60 // 40;
iMeshCode_1stMesh_Part_u = ( dLng - 100 ) // 1;
iMeshCode_2ndMesh_Part_q = dLat *60 % 40 // 5;
iMeshCode_2ndMesh_Part_v = ( ( dLng - 100 ) % 1 ) * 60 // 7.5;
iMeshCode_3rdMesh_Part_r = dLat *60 % 40 % 5 * 60 // 30;
iMeshCode_3rdMesh_Part_w = ( ( dLng - 100 ) % 1 ) * 60 % 7.5 * 60 // 45;
iMeshCode = iMeshCode_1stMesh_Part_p * 1000000 + iMeshCode_1stMesh_Part_u * 10000 + iMeshCode_2ndMesh_Part_q * 1000 + iMeshCode_2ndMesh_Part_v * 100 + iMeshCode_3rdMesh_Part_r * 10 + iMeshCode_3rdMesh_Part_w;
return iMeshCode;
Es diente auch als Upload-Test von Kobito.
Recommended Posts