Geocoding issue

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Geocoding issue

Post by Thierry » Fri Feb 19, 2021 2:43 pm

bogs wrote:
Fri Feb 19, 2021 2:08 pm
PaulDouBret wrote:
Fri Feb 19, 2021 1:50 pm
I am getting very upset :D :D :D
Well don't do that,....
Well, feeling upset with 3 smilies, you still have some chance :)

Sorry, I don't have a key to do a real test,
but did you try the 2 lines of script given by simon ?
This is straightforward and if this doesn't work,
then you can start thinking about the validity of your key?

Good luck,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

PaulDouBret
Posts: 10
Joined: Wed Feb 17, 2021 5:30 pm

Re: Geocoding issue

Post by PaulDouBret » Fri Feb 19, 2021 2:55 pm

Yes, I remove the unnecessary lines as Thierry suggested. No change
I used the only two lines that Simon suggested. No change.
And my key works fine with launch or directly with the browser :mrgreen:

I also tried different addresses from my short App. And tried trough the message box too with one simple line... the same that works in the browsers... no change

The point I am now.
From LC, put doesn't work, load doesn't work either.
Launch works OK, of course, as working directly in the browser does.

Same thing with Firefox or Safari.
My versions are updated...
Still I must do something wrong.

Is there a way I could send my testing App to somebody so you can test on your machines? ... it's 74Ko

And I never get upset. Not with LiveCode which I really like. Still I do make mistakes anyway. :D :D :D :D

PaulDouBret
Posts: 10
Joined: Wed Feb 17, 2021 5:30 pm

Re: Geocoding issue

Post by PaulDouBret » Fri Feb 19, 2021 2:58 pm

Thierry,

Are you the Thierry who used to work with Hypercard??? Loooong time ago...

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Geocoding issue

Post by Thierry » Fri Feb 19, 2021 3:03 pm

PaulDouBret wrote:
Fri Feb 19, 2021 2:58 pm
Are you the Thierry who used to work with Hypercard??? Loooong time ago...
Well, maybe... We are few thierry I guess :)
I've started using hypercard at the very beginning
and did a couple of apps in France at the end of the 80's...

Are you French ?

Thierry
Last edited by Thierry on Fri Feb 19, 2021 3:54 pm, edited 1 time in total.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

elanorb
Livecode Staff Member
Livecode Staff Member
Posts: 516
Joined: Fri Feb 24, 2006 9:45 am

Re: Geocoding issue

Post by elanorb » Fri Feb 19, 2021 3:04 pm

Hi

I have done a quick test here and there are a few things to try

1. Can you successfully get a value from a different URL? Could you try this test API?

Code: Select all

put "https://jsonplaceholder.typicode.com/todos/" into tURL
put url tURL
2. Try url encoding the URL e.g.

Code: Select all

 put urlEncode(laddress) into laddress
   replace "+" with "%20" in laddress
3. In my test (although I don't have a key) I get JSON back.

Code: Select all

 put "Champ de Mars, 5 Avenue Anatole France, 75007 Paris" into laddress
   put urlEncode(laddress) into laddress
   replace "+" with "%20" in laddress
   put url ("https://maps.googleapis.com/maps/api/geocode/json?address=" & laddress & "+France&sensor=false&key=my_Key") into loriginalrequest
   put loriginalrequest into field "result"
4. You can check the result function after getting the URL. This might give you more of a clue about where the error is.

Code: Select all

   put url ("https://maps123.googleapis.com/maps/api/geocode/json?address=" & laddress & "+France&sensor=false&key=my_Key") into loriginalrequest
   put the result into tResult
   put tResult into field "result"
Kind regards

Elanor
Elanor Buchanan
Software Developer
LiveCode

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Geocoding issue

Post by Thierry » Fri Feb 19, 2021 3:05 pm

Is there a way I could send my testing App to somebody so you can test on your machines?
Feel free to send it to me (zipped please)

I'll do my best

Thierry
Last edited by Thierry on Thu Nov 17, 2022 12:08 pm, edited 1 time in total.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

PaulDouBret
Posts: 10
Joined: Wed Feb 17, 2021 5:30 pm

Re: Geocoding issue

Post by PaulDouBret » Fri Feb 19, 2021 3:53 pm

Thansk Elanor

I will try all this over the weekend and come back to y'all on Monday

Thanks and best regards

Paul

PaulDouBret
Posts: 10
Joined: Wed Feb 17, 2021 5:30 pm

Re: Geocoding issue ==> SIM card issue?

Post by PaulDouBret » Mon Feb 22, 2021 10:06 am

Good morning to y'all

With Thierry and Elanor's help, I found the reason for the geocoding calls not to work.
I am connected to internet thru a 4G router (Huawei B818) and a new SIM card (issued Dec 20). That SIM card only has a IPv6 address and no IPv4 address. It seems to be the norm nowadays.
This restriction (and maybe others that I don't know) prevents a few things to work: the alarm system, TuneIn on a Bose speaker, etc...).
I discover this weekend that it also prevents LC to call URLs and thus prevents geocoding!
I can surf Internet without problem with any browser but I can't call it from LC.

I installed an old SIM card... and everything works fine as it used to be.

My problem is thus not the geocoding code or the LC code but the restrictions brought by my new SIM card with a IPv6 address and no IPv4.

Of course, I welcome any idea that would allow me to call Google (or other URLSs) from LC with my new SIM card. :D :D

Thanks to all for the advices, ideas and help and best regards

Paul

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm

Re: Geocoding issue

Post by liveme » Mon Feb 22, 2021 7:17 pm

Thanks for sharing this IP6 limitation to all....interesting !

sorry if I was not much of a help in this matter..

I saw you are willing to get some time measure - which is cool - here is 2 script code I use on my side to start and end a chrono task.
it returns in field "Kronotime", the final time measured in ms for a task...

you can just add the name : doStartKrono inside your button script - at the begining...and doEndKrono....at the end of the operation you want to measure.


script below to be copied on the STACK script.

Code: Select all

on doStartKrono
   put the milliseconds into KronoStart
   put "Chrono is ON" into field KronoTime
end doStartKrono

Code: Select all

on doEndkrono
   put the milliseconds into KronoEnd
   put (KronoEnd - KronoStart)&" ms" into field KronoTime
end doEndkrono

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm

Re: Geocoding issue ==> SIM card issue?

Post by liveme » Mon Feb 22, 2021 7:50 pm

[quote=My problem is thus not the geocoding code or the LC code but the restrictions brought by my new SIM card with a IPv6 address and no IPv4.
[/quote]

Have you tried to see if you router offers any IPV6 to IPV4 mapping menu ?
the idea would be,
to use a feature to have the Router associate the SIM IPV6 to a virtual IPV4 set in the router before any request is sent to the internet.
it will then reverse the replies from the intenet...mapping the answers to the fixed IPV4 to the real IPV6 of your Sim card.
it should be doable on most routers... Depending on the Router ability, it could be all transparent and super fast, set once and forget it.

Image

www youtube com/watch?v=OBxwCE2_8EQ
Attachments
ipv6 to ipv4.png

elanorb
Livecode Staff Member
Livecode Staff Member
Posts: 516
Joined: Fri Feb 24, 2006 9:45 am

Re: Geocoding issue

Post by elanorb » Tue Feb 23, 2021 4:29 pm

Hi

I had a quick chat with the team and there is a bug report about this.

https://quality.livecode.com/show_bug.cgi?id=11674

I have added a link to this thread to the bug report.

Elanor
Elanor Buchanan
Software Developer
LiveCode

Post Reply