Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Unable to use location.reverse_geocode inside a scene/layer
-
@daveM I've tri d your program on my iPad WiFi (no gps) and my_location contains latitude and longitude but no address. Thus it is normal that geocode does not work but reverse should work, you're right
-
@daveM Tried on my iPhone with gps (I hope 😅) and same result
-
Yeah, I’m really not sure what’s happening. I don’t really get it. If you try the code at the very top, it should work as expected and GeoCode and ReverseGeo both work (probably not on your iPad, did you try the working code on your phone?
I only dig up this old thread because the problem seemed to be identical and was hopeful that one of the original posters might remember how (if) they resolved it
-
@daveM Just try working code on my iPad and ok (gps known via WiFi router even if no iPad cellular)
-
Ahh found the issue. I didn’t look hard enough. There was another post detailing the answer and it has worked. Placing the first line here before the update gets things working!!
@ui.in_background def update(self): If not...
https://forum.omz-software.com/topic/5430/reverse-geolocation-works-on-console-but-not-in-code/5
-
@daveM well done
the worst is that I knew it, I had read this topic, but I forgot, sad to grow old 👴🏻😢Only 3 months later, shame on me
-
Lol. Yes. I saw your name there. All good. I’m not sure how much older than me you might be, but I certainly understand the pains of a failing memory!!! Lol
-
-
@daveM Also, be careful, these geocode functions need an Internet connection and if you call them to often, you could be refused during some time...
-
you should not send more than one geocoding request per minute
Édit: typed before reading your post just under
-
Rofl re not speaking your age. Lol. I’ve just hit a milestone that involved the words [‘half’,’century’], but as with most people I know, now it is just a number. Nobody really cares (unless you’re looking for work or a partner!!!) lol
Re the geocode API, I’ve been wondering what the “go” is with it. I have been using the google API for a few years and never had any issues. But I’ve always respected the limits and played by the rules. I was surprised Apple has opened them up to third parties. I’ll dig through the Apple docs later and see what restrictions are in place, but I don’t plan to use it too often. I’m developing an in-house tool that will allow using it as required. But it’ll only be 10-20 times a day. Although I may hit limits in testing. I hope that’s not the case. Lol
-
-
I localize my contacts on a map using this CLGeocoder and I have more than 200 contacts. The script has to retry a lot because it is too much requests in some seconds.
On GitHub, this explanation of my code:
sometimes, geocodeAddressString returns None. Either the address string is invalid, but somerimes, a retry gives a correct gps localization. Perhaps due to a big number of calls in a short time. In this case, the script display a button 'nn not (yet) localized' and starts a thread which will retry (maximum 100 times) all not yet localized contacts. The delay between two retries increase at each retry. The button title is green if the thread runs and red if not. Tapping this button gives the list of these contacts with their retries number
-
Nice idea. I do like it. I love that we have such great access to the Apple ecosystem through python. Some of the stuff I’ve seen people put together (yourself included) is encouraging.