Decimal "constant" for lat and long in miles - geospatial

Understanding that it would only be an estimate...
How what decimal constant would be able to be used to find a point X Miles away from a point in latitude and longitude to facilitate creating a lat long bounding box.

Unfortunately there is no such simple constant. As you go farther north, the "walking distance" between lines of longitude becomes smaller and smaller. If you were right next to the north pole, you could walk in a circle around it, covering almost no distance at all, and yet you'd still have touched every line of longtiude.
What you need is the great-circle distance between two points on a sphere.

Not sure what you are trying to do. You want a create a bounding box based on distance from a point? Are you looking for a way to calculate new lat/long from given lat/long using a distance in miles?
You can use the manhattan function to get an approximation of distance (realizing that lat/long are based on a spheroid approximating the earth, and truly calculating this requires more math), calculating x and y values with a forumla to follow
Manhattan function:
sqrt(x*x + y*y)
X and Y from Lat/Long:
x = 69.1 * (lat2 - lat1)
y = 53 * (lon2 - lon1)
Still, that method is pretty error-prone.
There's the great circle distance formula too, gotta use some trig for it, but it's probably worth it since you can get pretty good error in approximation depending upon what part of the spheroid (e.g. the lat/long) you start at.
Check out this page:
http://www.meridianworlddata.com/Distance-Calculation.asp

Related

Accurate direct distance between two points (latitude, longitude, and altitude)

First of all, thanks for reading. I have Vincenty working in Excel(VBA) already, and want to do this in Excel, but this is a math question, not a coding question. By the way, I'll readily cop up front to the fact that ellipsoids are way over my head.
I'm looking to calculate accurate direct distance between two objects, given their latitude, longitude and altitude. Vincenty was an interesting start, but two issues:
(a) Vincenty is the distance along the ellipsoid, and I would need the chord length.
(b) Vincenty doesn't account for elevation, and the distance between points increases as elevation increases.
It would be easy to take Vincenty as my horizontal distance, and use the elevation difference to solve for the slope, but that doesn't seem accurate.
Maybe this should just be solving for the line between points on concentric circles (i.e. the lower elevation versus the higher elevation) except what Earth radius to use? I mean, it's an ellipsoid, so...?
My distances will typically be 10 - 40 miles, but millimeter precision is required.
Point me in the right direction? Thanks! ~Mike

Build a geographical map from triangle points based on distance

I have 5 {x,y} points randomly placed on a grid
Each of the points do not know the {x,y} coordinates of the other points
Each of the points do know the distance of each of the other points from their {x,y} position
Each of the points exchanges this distance information with every other point
So every point knows every distance of every other point
Using this distance information every point can calculate (by finding the angles) triangles for every other point using itself as a reference point
Example, point 1 can calculate the following triangles:
1-2-3,
1-2-4,
1-2-5,
1-3-4,
1-3-5,
1-4-5,
and using the distance data recieved from the other points it can also calculate
2-3-4,
2-3-5,
2-4-5,
3-4-5
I would like to build a map of the location of every other point relative to a single point
How should I go about doing this? I am asuming it would be some kind of triangulation algorithm but these mainly seem to compute the location of a point from three other points, not the other way around where the other points {x,y} coordinates are discovered based on only the distance information.
I have tried plotting the two possible triangles for every 3 triangle points and then rotating them on a fixed known point to try and align them, but I think this avenue will end up with too many possibilities and errors
Ultimately I would like every point to end up with {x,y} coordinates of every other point relative to itself
You know the distance from one point to every other, dij. Thus, point 2 lies in a circumference of center point 1 and radius = d12. Point 3 lies in a circumference of center point 1 and R=d13 and it also lies in another circumference of center point 2 and R=d23.
See this picture:
I've set point 2 in X-axis for simplicity.
As you see, point 3 is on the intersection of two cicrcumferences centered at P1 and P2. There is a second intersection, P3a. Let's choose the one that is upwards and continue.
For P4 we can use three circumferences, centered at P1, P2 and P3. Again we get two solutions.
The same process can be done with the rest of points. For Pn you have n-1 circumferences.
I'm sure you can find the maths for circle-circle intersection.
Some remarks must be observed:
1) The construction is simpler if you first sort the points by distance to P1.
2) Not all distances generate a solution. For example, increase d13 an there's no intersection between the two circumferences for P3. Or increase d14 and now the three circumferences don't intersect in just the two expected points 4 and 4a.
3) This fact can be overworked by considering the average of intersections and the distance from each solution to this average. You can set a tolerance in these distances and tell if the average is a solution or else some dij is wrong. Since two solutions are possible, you must consider two averages.
4) The two possible triangulations are symmetric, over X-axis in the case I've drawn.
The real solution is obtained by a rotation around P1. To calculate the angle of rotation you need the {x,y} coordinates of another point.

Cartesian to Latitude/Longitude

I have a 3D model of a 10km x 10km topographic map which I've imported from sketch-up , the model is just a bunch of X,Y,Z points (where X+ is the north and Z+ is straight up, perpendicular to the ground)
I know the Latitude Longitude values of the (0,0,0) point. So given a X,Y,Z point how do I get its Latitude Longitude values?
I need to be pretty accurate so you can't assume the earth is a perfect sphere (you can however assume it's an ellipsoid)
For best accuracy you need to know what map projection the map was drawn in. You should be able to find that out from the map. For example in the UK the Ordnance Survey maps use the OSGB36 datum, and the projection is Transverse mercator. The projection tells you how to convert geographic (lat,long for the datum ellipsoid) coordinates to map coordinates (easting and northing) and how to do the reverse calculation, which is pretty much what you want.
If you don't know the projection, the next best thing would be if you could find out -- again from the map, they are often written on it -- the scale-factor and convergence of the projection at some points on the map. The point is that there is usually a slowly spatially varying difference between map north (the direction the north axis points in) and true north (the direction of the north pole from a point, the direction of the latitude axis) and there is always a slowly spatiallty varying scale factor, the ratio of a distance in map coordinates and the true distance. Note that this not the same thing as the scale of the printed map (an inch to a mile or whatever), it is a property of the projection.
Over a 10km square, it would be reasonably accurate to treat both the scale and convergence as constants. Then given an x,y point you compute the map bearing from 0,0 using
b = atan2(x,y)
and convert this to a true bearing by subtracting the convergence.
You also compute the map distance by
r = hypot(x,y)*S
where S is the scale of the map, e.g. if your a change of 1 in x coordinates represents a distance of 100m, S is 100
and convert r to a true distance by dividing by the scale-factor.
Finally you want to compute the lat,long a given distance and bearing from a given point (the lat,long of 0,0). An accurate way to do this is to use Vincenty's formulae.
One thing to note here is that the scale and convergence, if quoted on the map will be relative to the ellipoid used in construction of the map, so you will be computing lat,long coordinates for that ellipsoid.

Calculate square bounds on Earth with given radius for center point

I'm trying to calculate bounds for square with particular radius and when center of square is known(longitude, latitude). But I'm getting into troubles with it.
I've tried to use haversine formula from here :
But I'm getting into troubles when radius is pretty big.
Currently to find
1). latitude delta in radians I use:
radiusInMeters / EARTH_RADIUS_METERS
2). longitude delta in radians I use:
2.0 * | arcsin( |sin(radiusInMeters/(EARTH_RADIUS_METERS*2.0))
/ |cos(latitudeStart)| | ) |
These formulas I got from haversine formula.
Could please someone point me to the exact generic formula for calculations which will be good for big and small distances for my case.
Also how should be handled situations when radius exceeds -180˚/180˚ on longitude or -90˚/90˚ on latitude?
UPDATE
Some clarifications. Let's say that I'm staying in some particular point with coordinates (lon, lat), where lon is -113˚ and lat 50˚.
I would like to query points in some radius of interest from database. For that I need to calculate bounds of a "square". (Then filter-out stuff that's not in interesting radius). Formula above works fine on small distances(let's say 'till 100 kilometers(63 miles). But the more I go from equatorial point the poles, the more rounding errors I get.)
Thanks in advance

Given a latitude / longitude to a certain number of decimal places, how to tell the area covered (in metres)?

If i have a position specified in latitude and longitude, then it can cover a box, depending on how many digits of accuracy are in the position.
For example, given a position of 55.0° N, 3.0° W (i.e. to 1 decimal place), and assuming a truncation (as opposed to rounding), this could cover anything that's 55.01° to 55.09°. This would cover the area in this box: http://www.openstreetmap.org/?minlat=55.0&maxlat=55.1&maxlon=-3.0&minlon=-3.1&box=yes
Is there anyway to calculate the area of that box? I only want to do this once, so a simple website that provides this calculation would suffice.
The main reason I want to do this is because I have a position to a very high number of decimal places, and I want to see how precise it is.
While the Earth isn't exactly spherical you can treat it as such for these calculations.
The North/South calculation is relatively simple as there are 180° from pole to pole and the distance is 20,014 km (Source) so one degree == 20014/180 = 111.19 km.
The East/West calculation is more difficult as it depends on the latitude. The Equatorial distance is 40,076 km (Source) so one degree = 40076/360 = 111.32 km. The circumference at the poles is (by definition) 0 km. So you can calculate the circumference at any latitude by trigonometry (circumference * sin(latitude)).
I have written an online geodesic area calculator which is available at
http://geographiclib.sf.net/cgi-bin/Planimeter. Enter in the four
corners of your box (counter clockwise) and it will give its area.

Resources