I am developing an application for 'phone and i would like to know if the longitude and latitude change with height?For example within a building if we move to north east corner room in each floor.
No, you have an other value for height : altitude.
when you are in a building, with GPS, you can know how you are precisely.
For sample, in an elevator, your latitude, and your longitude don't change, your altitude change. with this third value, you can know which floor you are.
In general, you have also two other values :
horizontal accuracy : precision for longitude/ latitude.
vertical accuracy : precision for altitude.
For more details, you can see this article, explain all GPS terms
Longitude and lattitude can be supposed as a grid on a sphere upon which we are standing.If you start jumping on your place only thing that will change with respect to the grid is height and and not the cordinates.
So longitude and latitude are independent of height.
Related
Basically I am getting answers with only 2 GPS coordinates sometimes with bearing or altitude. But how do I combine all three together to get the distance between two points?
Edit:
All my points are pretty close, i.e. distance lie between few meters to 10 km max. Can I optimize by removing some of the above parameters for such close points?
Some similar questions, although not exact:-
Calculate distance between 2 GPS coordinates: There is an answer taking bearing in consideration, way below.
Taking altitude into account when calculating geodesic distance: Altitude in the calculation
I've been logging the altitude of an MKMapView's camera as the view is scrolled and I've discovered a strange behavior: the altitude of the viewpoint fluctuates as the user scrolls although the apperance of the map's zoom level stays the same.
After closer inspection, it seems that the altitude decreases as the user scrolls South (toward the equator) and the increases again once the user passes the equator. I thought that it might have something to do with curvature of the Earth and possible involve some trigonometry or cartography knowledge that I don't have.
I am trying to emulate this function. I have a CLLocationCoordinate2D and the current altitude and zoom level and I want to calculate the proper altitude for the MKMapCamera.
Thanks!
I found your post when asking the same question. I then found this post:
How to determine the correct altitude for an MKMapCamera focusing on an MKPolygon
Condensing this into the answer to your question (and mine):
double distance = MKMetersBetweenMapPoints(MKMapPointForCoordinate(pinCenter.coordinate),
MKMapPointForCoordinate(pinEye.coordinate));
double altitude = distance / tan(M_PI*(15/180.0));
MKMapCamera *camera = [MKMapCamera cameraLookingAtCenterCoordinate:pinCenter.coordinate
fromEyeCoordinate:pinEye.coordinate
eyeAltitude:altitude];
Given latitude and longitude of a location say 27.1231 and 72.3454 how do I randomly plot points within a circle of radius say 10km with the above lat and log as the center?
It's somewhat similar to this (?)
EDIT
It's a geocoder question and not a Gmaps4rails one
How to get the co-ordinates of random points within a given range?
you may use google.maps.geometry.spherical.computeOffset with random distance and heading
I want to ask this question without thinking about a specific technology. Suppose I pull a map tile from any maps provider using my real world location. How can I mark my location on this map tile? What is the calculation used here to convert longitude and latitude to pixels?
I have worked on OpenGL methods to view data on the earth and I think I'd summarize the position process as follows. This is by no mean the only way to do it by hopefully it helps you to think about the problem.
Treat the earth's core as the origin of a sphere, convert all polar coordinate of (latitude, longitude, radius) into (x,y,z) for every map points. Same thing for a particular mark you are interested in.
At this point, you would need to pick a view origin. Say this is your location.
Rotate everything by view origin's negative longitude through z-axis.
Rotate everything by view origin's negative latitude through y-axis.
At this point, the cartesian coordinate of all the points should have view location as the origin. Essentially, you are looking downward to the view origin.
Finally, scale it down and translate so that (x,y) fits in your coordinate system.
I have a series of lat/lon which represents the center of some object. I need to draw a line through this point that is x meters on either side of the center and it needs to be perpendicular to the heading (imagine a capital T)
Ultimately I want to get the lat/lon of this line's endpoints.
Thanks!
The basic calculation is in this similar question's answer: Calculate second point knowing the starting point and distance. Calculate the points for the two headings perpendicular to the main heading the distance away you want.
Have a look at: Core Location extensions for bearing and distance
With those extensions and two points on the initial line you should be able to get the bearing, add/subtract pi/2 and find points to either side like this:
double bearing = [bottomOfT bearingInRadiansTowardsLocation:topOfT];
CLLocation *left = [topOfT newLocationAtDistance:meters
alongBearingradians:bearing+M_PI/2];
CLLocation *right = [topOfT newLocationAtDistance:meters
alongBearingradians:bearing-M_PI/2];