Adding feet to a lat/long position

I have a known lat/long position, let us treat it as the origin of a grid sectioned off in feet. Is there a formula to take an X/Y position on the grid and add it to the lat/long to find a new lat/long? At first this seemed easy, but then I realized that a degree of longitude will change drastically as you move north and south.

I have a lot of control over the knowns at the start of the experiment, so if there are other things needed to be known, I can include them.

How precise is your original measurement - do you have a differential GPS reading, or are you using a handheld GPS? Calculating a change in lat/long by changing a position by feet rather than miles implies a very high degree of precision, which may or may not be appropriate for your purposes. How many feet are we talking about, anyway?

You do need to establish what map projection/grid you are using at the outset.

This page has some calculations and explanations of how to do what you want, but since it’s for sailors it uses Mercator projection: NavList: for the Preservation and Practice of Celestial Navigation by Sextant

I’m sure there would be. You are correct in saying that a degree of longitude varies with latitude, but it varies in a known way. Given a particular latitude, you can know how many feet are in a degree of longitude.

Latitude is easier. A minute of latitude is approximately equal to 1 nautical mile or 6076 feet. So moving 100 feet north or south results in a change in latitude of about 0.016 minutes.

Assuming the range of your grid is “small”, that you’re not too close to either pole, and that the Earth is a perfect sphere — then the length on the ground of a small longitude angle will be the length of a latitude angle multiplied by the cosine of your latitude.

Turning that around: a unit length in the east-west direction will represent an angle 1/cos(lat) times larger than the same angle it would represent in the north-south direction.

We have a pretty high degree of precision, although I am not permitted to tell you how. We are talking about the size of an office building.

Properly, you need to assume a geoid, a model for the shape of the Earth’s sea-level equipotential surface. A geoid typically defines an oblate elipsoid of revolution either by its two axes or by one axis and one ratio. A “datum” in this context (in which the plural is “datums”) is a definition of an effective geoid and of the reference points on it (because the geoid doesn’t have an East pole, so to speak, but a coordinate system needs one). GPS devices usually use WGS84 as the default geoid, but the ITRF00 geoid is more accurate and preferred for careful work. The USGS web site offers freeware conversion programs and whatnot for working with datums and their geoids. You will note that each datum allows either lat lon alt coordinates or x y z coordinates, but the x y z are one single cartesian coordinate system for the entire Earth and the space around it, so that typically the x and y and z axes are all at odd angles to your local up and north and east.

Then, you need to do the spherical trigonometry and geometry to move around in feet.

A pretty easy workaround if you don’t want to do that is to buy some software that can work in XYZ or lat lon alt coordinates, make up a matrix of points, and do a regression to create estimation functions between these.

You also have to be thoughtful about where you want to place the distortion, or if you want to have your verticals not be parallel everyplace.

Wait, what exactly are you trying to do? Are you trying to have one point, such as 10 10’10.000"N 100 10’10.000" and want to see what point it is 50 feet east? If so it’s called a forward and from a quick look there are programs out there that will do it. I have no idea what the formula is. We use it here at work and we have to have a high degree of precision, but we have an in house program to do it.

You do have to know the Lat, Long, Azimuth, and distance.

If that’s not what you’re looking for then can’t help you.

Isn’t the plural of datum always data?

Are you confusing two concepts? Lat/long are spherical measurements, a grid is rectangular.Lat/long position is not the origin of a grid–it is the origin of curved lines. Lines of longitude are not parallel to each other, but lines of a grid are parallel. Like apples and oranges–you can’t just add them to each other.

Rectangular coordinates (X,Y) can be added to other XY coordinates very simply–but it’s not the same as spherical lat/long computations, which are much more complex.

Most engineering projects are done with rectangular coordinates, not spherical. What do you need to do with your building?

If you don’t mind paying a little money, call a professional land surveyor from your local phone book. They can convert your building’s lat/long into the local rectangular grid (called the State Plane Coordinate System), with an accuracy half an inch.

>Isn’t the plural of datum always data?

Nope. See:

http://geodesy.noaa.gov/faq.shtml#Datums

You could convert the lat/lon to an x/y representation (UTM, State Plane, etc), add the values, and then convert back.

Brian

The interesting thing to consider is how much you throw yourself off by assuming that lat/long is a grid on a plane. I can think of three assumptions that introduce errors:

  1. the surface of the earth is flat for short distances
  2. the earth is a sphere, as opposed to a geoid
  3. the rate of change of longitude is constant for short distances

The amount of error introduced by the first one is very small, but I don’t have it in me to do the math right now. What I can say is that the error is going to be much smaller than the curvature of the earth: the earth curves away from a straight line by 1 inch over 1864 feet, but the error introduced by projecting that straight line onto the curve is much, much less than 1 inch. Defining “short distances” is kind of difficult, but this type of error doesn’t seem like it would give you much trouble until you spanned several degrees of arc at least.

I suspect that the impact of the second assumption is even smaller: the earth only deviates from spherical by 100 meters at the most, if I recall correctly.

It’s the last one that gives you trouble, since it varies so much depending on where you are. At the equator, it’s pretty small: you’ll be off by approximately .002 inches over a mile (based on 1 degree of longitude being 365220.5884178935 feet at the equator but 365220.5769604414 feet 1 mile from the equator – all numbers arrived at using this calculator and using 0.0144 degrees latitude as a rough measure of 1 mile). At 45 degrees, it gets more significant: over a mile you’ll be off by 16 inches. By the time you get up to 89 degrees, you’ll be off by 76 feet every mile.

ETA: Long story short, if this amount of error is within your tolerances and I have not made any gross miscalculations, then you can use Bytegeist’s method.

You can use Seissoft’s Coordinate Transform shareware program to convert your lat/longs to X-Ys in feet, add or subtract feet as desired and then convert the coordinates back to lat/longs. I do it often. Read the excellent help files to avoid goobering up your results.

LOL. No, not confusing anything. Guilty of being lazy I guess in my explanation.

How do you add feet to a known lat/long position? That is the question as implied in the title ( Adding feet to a lat/long position)

Now, with a grid laid out in feet, I can take a known point P1 and find out the distance (in feet) (with a fairly simple calculation) between it and any P2 where I know an X/Y on the grid.

OK from there let us assume that I also know the lat/lon of P1.

I want to then take that distance (in feet) and *add *it to the Lat/Lon and get a *new *Lat/Lon - the Lat/Lon of P2.

I’m going to be lazy again and not explain how I know the direction of P2 from P1, but let us assume that I do.
I appreciate the recommendations of programs to do this - some of them do what I want - but I am looking to figure out how to write such a program.

How complicated this is depends, as ntucker has already mentioned, on how large a region you’re interested in (“size of an office building”, so maybe ~300ft) and on how accurate you need to be (“pretty high degree of precision” doesn’t answer the question).

Except near the poles, the geodetic coordinate system is locally well approximated by a rectangular coordinate system with axes given by East and North vectors at some fixed point. How large you can make this local rectangular coordinate system depends on how much inaccuracy you can tolerate.

Let’s assume that you are looking at points restricted to the surface of the earth, and that your relative measurements (in feet) measure the horizontal distance only. If you approximate the earth by a sphere of radius R~3959mi, you can convert a local relative measurement in feet (in the form “x feet East, y feet North” measured relative to geodetic North) to a change in latitude and longitude: the change in latitude is just y/R radians (so 0.000002739°/ft, or 9.859 milliarcseconds of latitude per foot north), and the change in longitude is x/(R cos(lat)) radians. If your office building is in southern Pennsylvania (latitude 40°), this works out to a change of 12.881 milliarcseconds of longitude per foot east.

There are, as ntucker has pointed out, a couple sources of error in this approximation. First, the surface of the Earth is not a sphere; it’s closer to an oblate ellipsoid with equatorial radius about 21km larger than the polar radius; so R is not really constant, and using the wrong value might give you an error of up to about 0.3% in your computations. (To do the computations right, you need to know what coordinate system you’re using. If you’re using GPS, the coordinates are likely to be given relative to the WGS84 ellipsoid.) But the geoid, the mean-sea-level surface which defines the local vertical, is not quite an ellipsoid either, varying by up to about 100m from the ellipsoid, for an additional error of about 0.0016%. You have to decide, based on your required accuracy, which coordinate system is right for you.

Next, the curvature of the Earth’s surface causes distortions with any Cartesian (or other flat) coordinate system, which grow with the size of the region you’re trying to describe. If you project, say, 1 mile east to a new geodetic point, and then project 1 mile north from there to a second point, you will not get quite the same answer as if you project first north and then east (nitpick: unless you start at a carefully-chosen latitude). So long closed paths will usually fail to close in this approximation, with an error growing with the size of the region enclosed by the path. Similarly, because the lines of latitude are not great circles, a constant-bearing eastward course will curve (leftward in the Northern Hemisphere). A point one mile away on an initially-eastward bearing is not actually directly east; in southern PA, it’s actually about 7 inches south of the parallel you started on. If this sort of error is not tolerable, you will have to be careful about what your measurements really mean.

The grid is in feet. I need to be accurate to that degree. If I’m off 7 inches, I won’t care too much. If I’m off several feet, I probably do care. (Well, actually in early versions not so much, but as the program progresses, more and more.)

I fear that my NDA is keeping me from asking the right questions. I suspect if I explained the program people would see straight off what needs to be done.

For the size of an office building, this is essentially linear. The radius of the Earth is about 2.0891e+007 feet, close enough for what you want. One degree* is then 364,310 feet.

I’m going to assume positive Y is due North of the origin, and positive X is due East of the origin, and X and Y are in feet. Assume the origin is at Lat0, Long0, with longitude West of the Prime Meridian. Find C = cos(Lat0). As an example, the geographic center of Pennsylvania is at 77° 44.8’W, 40° 53.8’N, and for that, C = 0.7559. For a point (X,Y), the corresponding Lat, Long in degrees are then

Lat = Lat0 + Y / 364310
Long = Long0 - X / (364310 * C)

The plus sign on latitude is assuming you’re North of the equator, and the minus sign on longitude is assuming you’re anywhere in the Western hemisphere. Like in Pennsylvania.

(*) That’s one degree of latitude, or one degree of longitude at the Equator.