Bug with Longitude in JSON & KMLGoogle "Takeout" Location data - json

Location History data (downloaded from Google Takeout) is reporting incorrect Longitude on both the JSON and KML exports. Latitude is correct but Longitude is showing in the 304 to 305 range (after dividing by 107), instead of the negative number it should be in my case. It seems like the longitude data is simply "too high", by 430 (×107).
The problem shows in a JSON Location History I retrieved a few days ago; today I tried re-generating the downloads in both JSON and KML and both are still affected by this issue.
The same problem is reported by someone else here about 4 days ago but that's the only other mention of this issue I can find online.
Thoughts on how to proceed?

Found a solution: (no thanks to Google on this one!)
They seem to have an integer overflow error in preparing the data for
the takeout (downloading the kml directly from google maps for a
specific day works correct).
If the number is greater than 1800000000 (for latitude, also comparing
to 900000000 would work) you need to subtract 2^32 (=4294967296) and
you get the correct latitudeE7 or longitudeE7.
Example:
latitudeE7 = 4233738877 - 4294967296 = -61228419 (= 6.12 South)
longitudeE7 = 1066510714 (= 106.7 East, no conversion here)

Related

Google maps get list of Point of intrest

While requesting to get point of interests in google map's API, I am getting only 20 Results from any area or on any Lat, Long.
how can I get all the list of Point of interests
Get Point Of Intrest
As written in the Places API documentation on accessing additional results, places nearby search or text search returns up to 20 results per query, but each search request can have as many as 60 results divided into 3 pages.
If you have more than 20 results, you will have a next_page_token value in the response. Submit a new query passing the next_page_token to the pagetoken parameter to get the next 20 results. Like
https://maps.googleapis.com/maps/api/place/nearbysearch/json?pagetoken=[next_page_token from previous query here]&key=YOUR_API_KEY
With regards to getting more than 60 results
It is stated here on the issuetracker that it is not feasible due to technical concerns and that would turn the API into a database.

Get Latitude / Longitude from Address with Accuracy

I know this question has been asked too many times but my question is more of about standard approach.
I do have following fields in my form and using all of them for concatenation and sending to the Google Maps Api for fetching address which works.
But for some address Google Maps Api gives wrong lat/long due to the values insertion. fields with values are mentioned below.
Fields :
Street Address 1 - SHOP NO 56
Location - Sector 14
State - Haryana
City - Gurgaon
Resulting Google Map Url is giving me Lat/long of Sector 56 rather than Sector 14. Almost 9 Kms Difference.
http://maps.google.com/maps/api/geocode/json?address=Shop+No+56,Sector+14,Haryana,Gurgaon,IN
Can anybody please help me in this ?
What I tried/thought
I was planning to use Only Location Field but I suspect that will not help much.
It's true, businesses are excluded from Geocoding API. If you need a location for certain business just use the Places API.
E.g.
https://maps.googleapis.com/maps/api/place/textsearch/json?query=Shop%20No%2056%2C%20Sector%2014%2C%20Haryana%2C%20Gurgaon%2C%20IN&key=YOUR_API_KEY

Lat Lng to Makani Converter

Is there anyone knows how to convert a latitude and longitude coordinate to a Makani Code?
Makani is the new addressing system being implemented in Dubai. I wonder how they convert coordinate points to 10 digit unique code called Makani.
see this Makani Website
Just for your information, the Makani number IS based on a standard position system, the MGRS (Millitary Grid Reference System), so the conversion is straight forward enough, or so you would expect.
The problem is the implementation, you need to be accurate to 1m with the selected Co-Ordinates for where the guys at Makani decided to pick, or else your 'converted' Makani number WILL NOT be recognized by the system.
There are actually ways around this however; take for example....
Arabian Ranches, Al Mahra, Villa 124 (Street 4 Villa 12)
Makani Number: 26038 71480
MGRS Reference: 40R CN 26038 71480
Just drop onto Google Maps, select 'somewhere' on this Villa, and get the Co-ordinates...
Lat/Long: 25.049095, 55.275528
Convert this to Military Grid you get...
MGRS Reference: 40R CN 26036 71492
(Just to clarify CN is a 100Km Square Grid and the numbers are X,Y Meter References within that grid, so physically, my Lat/Lon Pick was actually only 2M West [26038-26036] and 12M North [71492-71480] of the Makani Guys Pick, unfortunately, the accuracy makes the error dramatic)
Goto Makani and enter 26036 71492, and you get a 'No Data Found' Error However; Makani DOES let you search by MGRS, so if you enter the complete '40R CN 26036 71492' into the Makani search, it shows the correct location, with the highlighted Makani Pin.
Hope this helps...
I know it's late for answering the problem now, but I think the solution is worth it.
After googling the problem for quite some time, at last, found some solution which is practical and works.
here it is,
You can use this
Dubai-Makani-No-Api , It's
Javascript Module for getting details about Makani Numbers.
OR
the government of Dubai provides a Makani Public Web Service Access API Given
Here and Here
you can view the API for a more sophisticated requirement.

Convert Google maps link to coordinates

How do I convert a Google maps link to GPS coordinates? (I think
10°11'12.0"N 13°14'15.0"E
is an example of a common GPS coordinate format.)
The reason I ask is that Google Maps for Android (I use Samsung Galaxy Note 3) does not seem to give coordinates. It will only give Google links. (Any instructions with right click can not be followed in a phone, only in a computer.)
For example. How do I convert the following link to find the coordinates of the Eiffel Tower:
http://goo.gl/maps/VqEsU
I think there have been earlier standards by Google where the hyperlink arguments contained the coordinates. But the current standard is more cryptic.
Right now I want to do it manually in my Android (Samsung Galaxy Note 3) phone. But maybe the question is of interest for programmatic conversion too.
Edit:
This question is NOT about the conversion between decimal and DMS (degrees, minutes, seconds) formats for coordinates. Many web pages and code-snippets are available for that.
You need to unshorten the url link, and the result will be and url with coordinates embedded in it. In your example:
https://www.google.com/maps/place/Eiffel+Tower/#48.8583701,2.2922926,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x8ddca9ee380ef7e0?hl=en
See this topic on how to unshorten using Python:
How can I unshorten a URL?
Then you need to parse it for the coordinates, for example by searching for the # character. Assume your long url is called longurl. In Python, you can do
import re
temp = re.search('#([0-9]?[0-9]\.[0-9]*),([0-9]?[0-9]\.[0-9]*)', longurl, re.DOTALL)
latitude = temp.groups()[0]
longitude = temp.groups()[1]
(Then you can further convert it from DD to minutes, seconds, if you need that.)
This link shows you how to convert coordinates from a Google Maps link (which is in DD, aka decimal degrees) into GPS coordinates (DMS - degrees, minutes, seconds). The general idea is to take the DD value and split it up into the degrees, minutes, and seconds values for latitude and longitude using the following process:
1) Take the integer value. This becomes the degrees.
2) Take the remaining decimal value and multiply it by 60. The integer portion of this value is the minutes.
3) Lastly, take the remaining decimal value and multiply it by 60 again. This is the seconds value (and is generally rounded off to 2 decimal points).
Example: 48.8583701, 2.2944813
Latitude: degrees = 48
0.8583701 * 60 = 51.502206 => minutes = 51
0.502206 * 60 = 30.13236 => seconds = 30.13
Latitude (DMS): 48º 51' 30.13" N
The link also has some code if you want to do it programmatically.

limit in the geolocation of multiple points in google fusion tables

I'm trying to geolocate these 27 points at the same time, in the same row. But the process returns only the first 10 points, even if in the preview they are all 27 correctly geolocated. Why? Is there a particular limit to the number of points I can locate?
<Point><coordinates>7.680237,45.064504,0.0</coordinates></Point>
<Point><coordinates>7.681675,45.061957,0.0</coordinates></Point>
<Point><coordinates>7.685044,45.060768,0.0</coordinates></Point>
<Point><coordinates>7.686482,45.06029,0.0</coordinates></Point>
<Point><coordinates>7.689443,45.05926,0.0</coordinates></Point>
<Point><coordinates>7.692157,45.060836,0.0</coordinates></Point>
<Point><coordinates>7.693799,45.062837,0.0</coordinates></Point>
<Point><coordinates>7.69352,45.06605,0.0</coordinates></Point>
<Point><coordinates>7.693316,45.065519,0.0</coordinates></Point>
<Point><coordinates>7.693723,45.065193,0.0</coordinates></Point>
<Point><coordinates>7.694796,45.069065,0.0</coordinates></Point>
<Point><coordinates>7.689893,45.072081,0.0</coordinates></Point>
<Point><coordinates>7.684025,45.075225,0.0</coordinates></Point>
<Point><coordinates>7.682716,45.075377,0.0</coordinates></Point>
<Point><coordinates>7.675881,45.078135,0.0</coordinates></Point>
<Point><coordinates>7.674809,45.076672,0.0</coordinates></Point>
<Point><coordinates>7.673264,45.074521,0.0</coordinates></Point>
<Point><coordinates>7.672727,45.073809,0.0</coordinates></Point>
<Point><coordinates>7.671729,45.072399,0.0</coordinates></Point>
<Point><coordinates>7.670302,45.071013,0.0</coordinates></Point>
<Point><coordinates>7.669648,45.070119,0.0</coordinates></Point>
<Point><coordinates>7.669197,45.068565,0.0</coordinates></Point>
<Point><coordinates>7.670592,45.06802,0.0</coordinates></Point>
<Point><coordinates>7.672427,45.067414,0.0</coordinates></Point>
<Point><coordinates>7.67557,45.065981,0.0</coordinates></Point>
<Point><coordinates>7.675592,45.06633,0.0</coordinates></Point>
<Point><coordinates>7.675892,45.064094,0.0</coordinates></Point>
The Google Maps reverse geocoder (whichever one you are using) is subject to a quota and a rate limit. If you don't check for and handle the status OVER_QUERY_LIMIT returned, you will get that behavior.
There used to be a limitation on multigeometries that only the 10 most prominent locations would show (can't find that in the documentation for FusionTables anymore though). Put each point in its own row.