Monday, January 20, 2020

Convert HEXEWKB to Latitude/Longitude in python


from shapely import wkb

hexlocation_list = ["0101000020E6100000AECB9307F9D812400F2ADCE003704940", 
                    "0101000020E6100000E40AAE6CD6DA1240941F95531C704940", 
                    "0101000020E6100000C0D7C68E7CD81240F550364044704940", 
                    "0101000020E6100000CB752BC86AC8ED3FF232E58BDA7E4440", 
                    "0101000020E6100000DB81DF2B5F7822C0DFBB7262B4744A40"]


for hexlocation in hexlocation_list:
    point = wkb.loads(hexlocation, hex=True)
    
    longitude, latitude = point.x, point.y
    print(longitude, latitude)





Related articles:
1- How to convert HEXEWKB to Latitude, Longitude (in python)?


No comments:

Post a Comment