On what basis do Appengine location pointers indicate location?

I hosted my web app on Google Appengine. From time to time I need to know the location of visitors. Therefore, I used the request headers provided by Google:

String visitorCountry = request.getHeader("X-AppEngine-Country"); String visitorRegion = request.getHeader("X-AppEngine-Region"); String visitorCity = request.getHeader("X-AppEngine-City"); String visitorLatLong = request.getHeader("X-AppEngine-CityLatLong"); 

They were never accurate for the location, and I think that tells me the location of the Internet service provider. How do Google Appengine request headers work? Is it primarily on the IP address that the client sends on request?

Here are the header documents for reference.

+4
source share
2 answers

People can go here - http://mylocationtest.appspot.com/ - and see what location information is right for them.

For me, lat / long is only the nominal city center that is listed - about 20 km from my actual location. Internet Service Provider - Rogers Canada.

Apparently, sometimes the country returns as "ZZ". http://code.google.com/p/googleappengine/issues/detail?id=5296

Information about this IP address is usually packed using ASN . This tells you the ISP, and as mentioned above, only they can tell where one of their IPs is assigned. Perhaps the accuracy of the location information depends on the provider.

(This is not an answer to the question - just a further discussion - but in fact it did not work in the comment).

+2
source

In my experience, using the HTML5 Geolocation feature tends to be more accurate than IP based geolocation. This will be especially important if you use your mobile website on GPS enabled devices and if you have enabled high accuracy.

Check out this post and for a good discussion of two approaches: Why HTML5 Geolocation?

+1
source

Source: https://habr.com/ru/post/1442606/


All Articles