0

I'm trying to decode this url: https://www.google.com/maps/place//data=!4m2!3m1!1s0x4745bd4af4e60a51:0xd62aba005d92953d?utm_source=mstt_1LM_pY9N8KOrk5pGERKQRIPXvuU12TY

I am guessing that "0x4745bd4af4e60a51:0xd62aba005d92953d" is the part storing the coordinates but I am not sure how to decode it. I tried to convert it from hex to decimal but it doesn't give me a coordinate value.

Adrian
  • 717
  • 11
  • 18

2 Answers2

1

After some more research, I have found this SO post containing the exact answer to my question.

Both methods work:

  1. Calling https://maps.googleapis.com/maps/api/place/details/json?key=YOUR_API_KEY&ftid=0xd62377123a70817:0x85e89b65fcf7c648 and extract coordinates from "geometry"
  2. Converting "0x85e89b65fcf7c648" (second number, after colon) into decimal, resulting a CID number. Then, the location can be decoded by accessing https://google.com/maps?cid=16601872622479930233
Adrian
  • 717
  • 11
  • 18
  • Method 2: you convert the hex into decimal, and then what? you obtain a big int number, not a lat/lng coordinates. What do you do next? Thanks – Gabriel Nov 21 '22 at 12:52
  • @Gabriel, the returned number is a CID. You can access it like this: https://google.com/maps?cid=16601872622479930233 – Adrian Nov 22 '22 at 13:16
  • Thanks. But still, it does not contain any direct Lat Lng indication. You still have to use a browser to search for them in the HTML response. – Gabriel Nov 22 '22 at 20:34
  • 1
    @Gabriel, unfortunately yes – Adrian Nov 24 '22 at 04:51
0

The Coordinates are listed in UTM and not Lat/Long. There are convertors online that will help with this conversion. When you click on the link you will see the following URL: https://www.google.com/maps/place/Westfield/@46.225795,21.2673783,17z/data=!3m1!4b1!4m5!3m4!1s0x4745bd4af4e60a51:0xd62aba005d92953d!8m2!3d46.225795!4d21.269567.

The coordinates are listed as : 46.225795,21.2673783
You have a couple of options, 1) Download Google Earth and enter the coordinates in the search box. From the tag you can retrieve the lat/long 2) Open Google maps and type those coordinates in and you will see the Lat/Long listed below that search box.

Ari
  • 1
  • Google Earth or Google Maps is not helping me because I need to obtain the coordinates in my Android app. – Adrian Jan 04 '19 at 19:05