Android Question Address is not determined in GeoLocation

I created a geolocation routine based on DonManfred's algorithm, Nov 25, 2018: https://www.b4x.com/android/forum/threads/geolocation.99710/.

It worked fine until recently.

As usual, City, Country is determined, but instead of Address, an incomprehensible set of characters like "9W5C+336" is returned.

Apparently, there is no point in providing my code, because I have not made any changes compared to DonManfred.

The only thing that has changed since then is the version of B4A itself.

What can you say about this?
 

emexes

Expert
Licensed User
Longtime User
That looks like a Google Plus Code, which is a shorthand longitude+latitude. My first guess is that the API has changed slightly, and a parameter that was previously unused and worked fine when you passed it a reasonable "no idea what this is for" value of zero or similar, now is used to specify what type of address to return. Or maybe they've changed the values of an enumeration, and your program needs to be updated to use the new list.

From memory the Google Plus Codes with four digits in front of the plus are only within a 1 degree (about 110 km) rectangle, so the location that it pinpoints when you resolve it wherever you are, will be different to the location pinpointed when I resolve the same code where I am (Melbourne, Australia).

Like when I do it here, it comes up with a place about 22 km away from where I am:

1755672165682.png
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
It worked fine until recently.

Do existing apps that used to work, still work?

Another idea is that perhaps the provider that was previously being used, is no longer in operation, and the library that you're using has defaulted to using Google, which perhaps supplies Plus Codes if there is no address associated with the coordinates.

What coordinates produced the 9W5C+336 ?
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
To get you by in the meantime, you could use OSRM, eg the drive to my suburb to my parents' suburb:


(lol I should have rounded off the coordinates that I got from Google... nanometre precision is overkill)

returns street names, and I'm sure there was a way to get the actual address. Although OSM doesn't have every individual property listed like Google Maps is getting close to, so it might not be enough for your purpose.
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
I'm sure there was a way to get the actual address

Grok says no, not by OSRM, and to use OSM's Nominatim instead:


actually, this:


returns something easier to parse, and more human-readable too:

XML:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<reversegeocode timestamp="Wed, 20 Aug 2025 07:29:35 +00:00" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright" querystring="lat=-37.73415768439494&lon=144.6667188381609&format=xml">
<result place_id="393925989" osm_type="node" osm_id="12420128165" lat="-37.7342550" lon="144.6667177" boundingbox="-37.7343050,-37.7342050,144.6666677,144.6667677" place_rank="30" address_rank="30">47, Westcott Parade, Rockbank, Melbourne, City of Melton, Victoria, 3335, Australia</result>
<addressparts>
<house_number>47</house_number>
<road>Westcott Parade</road>
<suburb>Rockbank</suburb>
<city>Melbourne</city>
<municipality>City of Melton</municipality>
<state>Victoria</state>
<ISO3166-2-lvl4>AU-VIC</ISO3166-2-lvl4>
<postcode>3335</postcode>
<country>Australia</country>
<country_code>au</country_code>
</addressparts>
</reversegeocode>
 
Upvote 0
Работают ли существующие приложения, которые работали раньше?

Другая идея заключается в том, что, возможно, поставщик, который использовался ранее, больше не работает, а библиотека, которую вы используете, по умолчанию использует Google, который, возможно, предоставляет коды Plus, если с координатами не связан адрес.

Какие координаты образовали 9W5C+336?
43.3574257, 76.9203727
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If you enter the location, the log displays the message: "Access blocked" and then the reasons for this blocking.
This is NOT how this forum is designed.
- You should ALWAYS create a new thread for any new question you have.
- The library is written by @TILogistic and not subject of this thread!
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
"Access blocked"

If your app isn't going to blast the server with thousands of requests every hour, then you could just do the request via normal http, at least to get your app back up and running while you find a more-permanent solution.

At worst, if you overrun your welcome at the server, your app will be blocked after too many requests from an IP address.

How many lookups are we talking about? Eg 100 users x 100 lookups per day = 10,000 lookups per day. Short term to get you going, that should be ok. But if your multiplication turned out to be 10,000,000 lookups per day, ok, that's probably going to get blocked, same as the API library you tried out.

If your app caches the lookups long-term then the number of lookups should decrease over time. In my use-case, doing 70 deliveries per day, it petered out after a couple of months to ~5 new addresses each day.

Not that it mattered for us: we have this beautiful dataset available:


and there were only about 100,000 addresses in our area, which was like a 10 MB text file that could be kept in memory no problem (same size as three camera photos). Maybe something similar is available for the area you're app is used in.
 
Last edited:
Upvote 0
Top