Google Map marker in wrong location - google-maps

All of my lat/lng locations have been taken off of Google Earth using the mouse.
When I enter the data into Google Maps I have multiple instances where the marker does not show the proper location. For example: a marker for lat 38.015986 lng -84.355413 (coordinates for The Aviation Museum of Kentucky) shows up at 38.005754, -84.211968 (again using my mouse pointer to provide lat/lng of marker.)
I can't use geocode because many of my locations do not have addresses - in road medians, internal to 430 acre park, etc.
How do I correct for (or get) the proper lat/lng?

Possibly you have the units of your Lat Long incorrectly entered.
Lat and long can be entered as
hdd.ddddd (decimal degrees)
hddd'mm.mmm' (degrees with decimal minutes)
hdd'mm'ss.ss'' (degrees, minutes seconds)
This seems likely, since you get close to the correct answer.
If you need to convert between these or any positional grid system and datum I recommend using Garmin Basecamp, it is free.

Related

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.

Save geolocation as latitude/longitude or address/area name?

Suppose a service like Foursquare, I want to save the location of a check-in. Should I save this as latitude-longitude or the address/area name such as 123 Portmill St, NY 12345 or SoHo, NY.
In the first case, I can have users type an address and my service looks up and stores lat-long information. By doing this my service can search check-ins within a polygon-boundary.
While on the second case, I can store location as a bucket and avoid redundant information such as (lat,long) = (100000.1,100000.1), (100000.2,100000.2) which are very close together and can even be considered the same location.
I don't think I've completely understood the nuances of what you're trying to do, but computers usually work better with numbers like latitude and longitude rather than human-readable text information. For example, with the text address, how would you ensure consistency, e.g. dealing with extra spaces, ZIP+4 codes rather than just shorter zip codes etc etc.
I guess it's just my instinct that latitude and longitude might be better than text. Where I live in the UK, there are a lot of examples where towns and cities have two roads of the same name, so I do think that there are likely to be more pitfalls with storing text instead of latitude/longitude.
How about this. I'd store 3 columns in the database, namely (Latitude, Longitude, TextLocation), but it's the pair (Latitude, Longitude) that's regarded as the key of the table. The TextLocation is just the last known result from the reverse geocoder when the geocoder was asked for the text corresponding to the given (Latitude, Longitude).
When a new position arrives, (New_Latitude, New_Longitude), I'd search the database to find all closest rows in the database. To calculate distance of (New_Latitude, New_Longitude) to (Latitude, Longitude), I'd use the following code
float LatDiff = New_Latitude - Latitude;
float LongDiff = New_Longitude - Longitude;
float CosNewLat = Math.cos(New_Latitude);
float ConversionFac = 6371000 * Math.PI / 180; // 6371000 is earth radius in metres
float Dist_metres = ConversionFac * Math.sqrt(LatDiff*LatDiff + LongDiff*LongDiff*CosNewLat*CosNewLat);
Then for each of the closest points to (New_Latitude, New_Longitude), I'd update the TextLocation in the database using reverse geocoding. If the new position doesn't match the current reverse geocoding for any of the existing locations, I'd add it into the database.
Part of my thinking here is that even storing 3 columns which includes a column of text, the database is still going to be tiny compared to modern storage capacities.

Correctly draw on Google Maps a point which exceeds 90 degrees of latitude

I'm working on a simulator that plots the flight path of an aircraft on Google Maps.
The simulator is not aware that the latitude is only defined between -90 and +90 degrees and the longitude between -180 and +180 deg. As a result of this, the flight path may include points beyond the map boundaries. Exceeding in longitude is not an issue as it still plots correctly (a point at longitude x and x+360 is the same), but the latitude is a problem.
Is there any way of telling Google Maps to keep the points between the correct boundaries and plot them correctly?
Otherwise, do you have any ideas of where to find functions that do so?
Longitude, latitude and elevation are a bad coordinate system for a flight simulator, because the mapping presents singularities i.e. there are points infinitely close on the earth that have very different coordinates. For example where you're close to one of the poles longitude variation speed can become arbitrarily big compared to airplane speed. When standing exactly on the pole the longitude doesn't even make sense.
A better solution is to use an XYZ coordinate system for the simulator and only convert to longitude/latitude and elevation for plotting. If you can approximate the earth to a sphere for your use case the computation of this transformation is trivial... otherwise things can get much more complex depending on how accurate you want it to be.
That said it's still possible to give "a" meaning to a point with latitude slightly outside the range -90...90 by extending it over the pole...
if latitude < -90:
latitude = -180 - latitude
longitude = longitude + 180
if latitude > 90:
latitude = 180 - latitude
longitude = longitude + 180
but using this coordinate system for navigating is a very bad idea (the same point in space can have multiple triplets of coordinates).
If your simulator doesn't know that the maximum value for latitude is 90 degrees it is broken and needs to be fixed. Google Maps works correctly for valid/possible values of latitude and longitude.

Why is this lat lng coordinate is split into 2 halfs?

I have this file from tsp.gatech but the lat lng coordinate is divide into two half. Why is this?
COMMENT: Created July 7, 2012, www.tsp.gatech.edu/data/usa/
1 33613.158800 86118.306100
2 33100.954000 85529.675300
3 31571.835200 85250.489300
For example the first coordinate should be 33.613158800 86.118306100.
Update: I searched for New York City and I found it lat lng coordinate to be similar.
Update 2: I think it's incorrect formated see this image of points: http://www.tsp.gatech.edu/data/usa/img/usa115475_large.jpg. I get the points from a file from this website: http://www.tsp.gatech.edu/data/usa/index.html. The site is about a challenge and the file I downloaded is usa115475.tsp.
Euclidean Distance would tend to suggest the values are X,Y distances from a reference point (in feet, meters, kilometers, miles, ...). But this is normally reserved for small scale mapping where the effects of the curvature of the earth can be considered minor.
If the data seems to correspond to decimal degrees that are incorrectly formatted, there could be an error in whatever system is returning the data. But its better to review your own processes before pointing the finger. What query/process/code are you doing to obtain this data?

to find locations in google map within 5 km radius of a given point

hey i just want to gather the locations in google maps database which are under 5 km radius of the given point.. i will be storing them in database for later processing .....can this be done...thanks...how to get longitude and latitude of points with in the required circle...
You can use PlaceSearches
with the parameter : radius