Yes, the  5La7FKDZAMA5Hr4N8 is just a 'random' identifier, it not unique to
the location, but unique to the particular short link. The short url
service looks up that key in database to find the full link.
... there is no direct API for the google URL shortener.

Although in theory can just make a HTTP request to the short URL, and it
should reply with a HTTP redirect to the 'full' url, so get back the full
url
https://www.google.com/maps/place/The+Louis/@13.749013,100.5899982,17z/data=!3m1!4b1!4m5!3m4!1s0x30e29f76120e2781:0x93aa21eeb98e2ebb!8m2!3d13.7490078!4d100.5921869?shorturl=1
in Location header.


The problem is that still isn't *directly* decodable. Pretty sure there is
a 'place id' in encoded in the url encoded protocol buffer (ie the id for
The Louis in that example),
0x30e29f76120e2781:0x93aa21eeb98e2ebb
which in theory could be used with the PLaces Details API, which may even
return a plus code directly!
https://developers.google.com/places/web-service/details
Note entirely sure how to convert the one in the URL to the one the API
needs. The one in URL seems to be hex encoded, but the API wants a
different format.

(However not totally sure you are *allowed *to store the location returned
from the Places API in a database, even if you are re-encoding the lat/long
as a Plus-Code. Read the Terms carefully.)


There IS a simple lat/long in the long URL - just after the @ symbol, which
can be turned into a Plus Code easily. But, its the location of the center
of the map, NOT of the searched feature.
... The feature typically isn't centered. The feature often starts centered
in the 'visible' map on Google Maps, but hte @ location is the actual
center, and the map may technically go behind the 'sidebar'.
Of course the user may of dragged/moved the map between searching, and
producing the short link! (or even copying a long link direct from
browser!)









On Wed, Mar 11, 2020 at 5:40 PM Andreas B <andr...@bocops.de> wrote:

> Hi Henry,
>
> the sample URL you added is a Google Maps short link, with the identifying
> part ("5La7FKDZAMA5Hr4N8") likely being a random string with no obvious
> relation to the place this link was created for. I'm not sure if one of the
> Maps-related APIs might be useful to turn this proprietary string into
> something like a place object containing latitude/longitude, but I guess
> not: https://developers.google.com/maps/documentation
>
> Is your list of URLs too large to do this manually?
>
> --
> Public site: http://www.openlocationcode.com/
> Github project: https://github.com/google/open-location-code
> Demo site: http://plus.codes/
> ---
> You received this message because you are subscribed to the Google Groups
> "Plus Codes Community Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-location-code+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/open-location-code/5c6bcb6d-5309-4019-bf0a-42e9160ce61a%40googlegroups.com
> <https://groups.google.com/d/msgid/open-location-code/5c6bcb6d-5309-4019-bf0a-42e9160ce61a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
--- 
You received this message because you are subscribed to the Google Groups "Plus 
Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-location-code+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/open-location-code/CAJCAUuJ5e7zk_vLFjs_oiufOuSioVPtZc5pvjMOpajCCJ0BZGQ%40mail.gmail.com.

Reply via email to