extract adresse from google map ?
Moderator: Martin
extract adresse from google map ?
Hallo,
I Start a voice search with automagic for an shop. Now google map Start and Show me the location with name of the shop.
Is IT possible to get only the adresse as result without the name of the Shop ?
For example
Search: toom Wandsbek Hamburg
Result : street 1 Hamburg
Can i save the search result from google maps as variable ?
I Start a voice search with automagic for an shop. Now google map Start and Show me the location with name of the shop.
Is IT possible to get only the adresse as result without the name of the Shop ?
For example
Search: toom Wandsbek Hamburg
Result : street 1 Hamburg
Can i save the search result from google maps as variable ?
Re: extract adresse from google map ?
or maybe change the Text from
toom Baumarkt
Am Stadtrand 31-33, 22047 Hamburg
040 6969710
https://maps.app.goo.gl/6w1Pq7Rkpjvy9HuN6
To
Am Stadtrand 31-33, 22047 Hamburg
This is finally what i want.
I try regex but i dont know how
toom Baumarkt
Am Stadtrand 31-33, 22047 Hamburg
040 6969710
https://maps.app.goo.gl/6w1Pq7Rkpjvy9HuN6
To
Am Stadtrand 31-33, 22047 Hamburg
This is finally what i want.
I try regex but i dont know how
Re: extract adresse from google map ?
How do you get the exact text from gmaps? Do you still need to share from Gmaps back to Automagic?
It seems the standard formatting from gmaps is
1st line : Place name
2nd line : address
3rd line : phone number or any extra info
4th line : gmaps link
If it is consistent, you can retrieve only the 2nd line using regex.
\\n to match newline char
(.*) to match the whole line
By putting \\n then (.*) then \\n, we tell the regex to match a newline (must be after second line already), the whole line, then another newline. In short, match the second line of the text.
It seems the standard formatting from gmaps is
1st line : Place name
2nd line : address
3rd line : phone number or any extra info
4th line : gmaps link
If it is consistent, you can retrieve only the 2nd line using regex.
Code: Select all
find = findAll(text, '\\n(.*)\\n', true);
address = find[0][1];
(.*) to match the whole line
By putting \\n then (.*) then \\n, we tell the regex to match a newline (must be after second line already), the whole line, then another newline. In short, match the second line of the text.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: extract adresse from google map ?
Thx, IT works
Is there also a way to get the information without start gmaps ?
Maybe an http request with a answer from gmaps ?
Is there also a way to get the information without start gmaps ?
Maybe an http request with a answer from gmaps ?
Re: extract adresse from google map ?
Do you mean you want to search for location and then return only the address from it? We can use Gmap geocode location API, but it is very limited for public user.
You can use nominatim openstreetmap API instead. You can look at here : viewtopic.php?f=5&t=7457
Maybe that is what you want. You can parse the json later and retrieve the address.
You can use nominatim openstreetmap API instead. You can look at here : viewtopic.php?f=5&t=7457
Maybe that is what you want. You can parse the json later and retrieve the address.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: extract adresse from google map ?
hallo desmanto,
i mean : i start a Action : voice search
for example : toom Wandsbek Germany
and i get the adress from this shop and save the adress in a variable.
is that possible ?
i mean : i start a Action : voice search
for example : toom Wandsbek Germany
and i get the adress from this shop and save the adress in a variable.
is that possible ?
Re: extract adresse from google map ?
hmm, many thx for the answer but i dont know how i can do this ?Desmanto wrote: ↑15 Jun 2019 16:23Do you mean you want to search for location and then return only the address from it? We can use Gmap geocode location API, but it is very limited for public user.
You can use nominatim openstreetmap API instead. You can look at here : viewtopic.php?f=5&t=7457
Maybe that is what you want. You can parse the json later and retrieve the address.
can you tell me how i can create this flow ?
Re: extract adresse from google map ?
I don't use voice search, since it will open up google assistant. If you mean to use voice recognition in Automagic, I use action Input Speech, set the language. You can use no user interface to prompt without the mic icon. This will store the result in {value}. You can then use the {value} to query the address. The link I give you above is to reverse search base on location. We can use the normal search for this location name search.
then use {url} in http request field. The result is in {response} which you can parse using
In the {js}, you can check the value by using condition debug dialog, dig down and find the address you want. However, the address format shown using osm query is a bit different than the google maps version. You need to see it first and tell me which one you need. From my finding, it is most likely this
Code: Select all
url = "https://nominatim.openstreetmap.org/search?q={value}&format=json&limit=1&addressdetails=1";
Code: Select all
js = fromJSON(response);
Code: Select all
address = js[0]["display_name'];
// toom Baumarkt, 31,33, Am Stadtrand, Wandsbek, Hinschenfelde, Hamburg, 22047, Deutschland
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: extract adresse from google map ?
thx for your help
road, house_number, city_district
i tried it with road but i gel only zero as result. in js i found this data in address
from the js i Need in the orderDesmanto wrote: ↑23 Jun 2019 15:20You need to see it first and tell me which one you need. From my finding, it is most likely thisCode: Select all
address = js[0]["display_name']; // toom Baumarkt, 31,33, Am Stadtrand, Wandsbek, Hinschenfelde, Hamburg, 22047, Deutschland
road, house_number, city_district
i tried it with road but i gel only zero as result. in js i found this data in address
address={doityourself=toom Baumarkt, house_number=31,33, road=Am Stadtrand,
suburb=Wandsbek, city_district=Wandsbek, hamlet=Hinschenfelde,
state=Hamburg, postcode=22047, country=Deutschland, country_code=de}}]
Re: extract adresse from google map ?
i got it
Little mistake only
many thx
Little mistake only
many thx