Greater latitude and longitude values - google-maps

I came across a dataset which has Latitude values in the range (0,181.763) i.e. minimum latitude is 0 degree and maximum latitude is 181.763 degree and Longitude values in the range (228.722,242.008) i.e. minimum latitude is 228.722 degree and maximum latitude is 242.008 degree. Is there some way by which I may confine the latitude and longitude's to correct boundaries?

well if they are spherical coordinates, long 181.763deg points in the same direction as -178.237deg or 361.763deg, depending on the conventions used
to transform latitude ranges of (228.722,242.008) to (-90,90) the transformation matrix to use is ((x-228.722)/0.073811)-90 for each point x. for example 229.3deg gives -82.169deg
it could be that you are using slightly scaled (elliptical) polar coordinates and you can transform them back by division...

Related

What is maximum points limit for Google's heatmap feature?

Hello there's I am use google's Heatmap feature in my project. I do not know whats the maximum points (latitude ,longitude )limit for google's heatmap to visualization.
There is no limit to the number of points added to the heatmap, but there are practical constraints (the memory of the device displaying them, the time to load them, etc.)
Longitude is in the range -180 and +180 specifying coordinates west and east of the Prime Meridian, respectively. For reference, the Equator has a latitude of 0°, the North pole has a latitude of 90° north (written 90° N or +90°), and the South pole has a latitude of -90°.
The limit is for longitude and latitude not for google heatmap feature for using latitude or longitude. If your latitude/longitude is in valid range , it will work.

Distance in meters between two Spacial Points in MySQL query

I am trying to query a MySQL database (version 5.7.15) to retrieve all locations that are within 300 meters from some coordinates (40.7542, -73.9961 in my case):
SELECT *
FROM location
WHERE st_distance_sphere(latlng, POINT(40.7542, -73.9961)) <= 300
From the MySQL documentation:
ST_Distance_Sphere(g1, g2 [, radius])
Returns the mimimum spherical distance between two points and/or
multipoints on a sphere, in meters, or NULL if any geometry argument
is NULL or empty.
Unfortunately, the query also returns points that are more than 300 meters away from POINT(40.7542, -73.9961) such as:
POINT(40.7501, -73.9949) (~ 470 meters in real life)
POINT(40.7498, -73.9937) (~ 530 meters in real life)
Note that in MySql the order of coordinates are:
1. POINT(lng, lat) - no SRID
2. ST_GeomFromText('POINT(lat lng)', 4326) - with SRID
select st_distance_sphere(POINT(-73.9949,40.7501), POINT( -73.9961,40.7542))
will return 466.9696023582369, as expected, and 466.9696023582369 > 300 of course
Just to make it clear for future people (like myself):
Mituha Sergey has answered the question in comments on the OP. The problem was that OP was using POINT(lat, lng) when in fact MySQL expects POINT(lng, lat).
Not sure about the time OP posted the question, but as of today the official documentation makes it a bit clearer:
The geometry arguments should consist of points that specify
(longitude, latitude) coordinate values:
Longitude and latitude are the first and second coordinates of the point, respectively.
Both coordinates are in degrees.
Longitude values must be in the range (-180, 180]. Positive values are east of the prime meridian.
Latitude values must be in the range [-90, 90]. Positive values are north of the equator.
From: https://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html#function_st-distance-sphere
And if you're getting "invalid arguments" errors it's probably because of that. Try adding WHERE lat between -90 and 90 AND lng between -180 and 180 just to be on the safe side haha :)

NOAA's GIS Polygons - How to use them?

NOAA gives a Polygon area for plotting shapes on a map. The only thing I can find in google maps is to use a lat/lon to create a shape.
You can view the warnings here with their polygons:
http://www.nws.noaa.gov/regsci/gis/last10.html
Can somebody please tell me what these 4 digit numbers represent and if it's possible to convert them to a latitude / longitude.
The numbers are hundredths of degrees. A 4-digit number is latitude, so for instance 3503 represents 35.03 degrees North latitude. A 5-digit number is longitude, so 10581 would be 105.81 degrees West longitude.

Converting degrees to other units of measurement

I am storing a point as latitude and longitude in a Mysql server. They are both float(10,6). Given a radius, say 100 yards or 100 meters, how can I calculate points around the center. I was thinking of using GIS but I heard it is incomplete or very limited in functionality.
1) Tranform the lat/lon to a cartesian based coordinate system of units meter,
the tranformed point is now at (x,y)
2) Use school mathemathics (polar coordinates) to calculate the points:
2a) create points on circle at (0,0) with polar coordinates (r* sin (phi), r* cos(phi)), r in meters, phi in radians
2b) add (x,y) to all that resulting points, to move the circle points from center (0,0) to (x,y)
3) tranform all points back to lat/lon

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.