Results 1 to 10 of 12

Thread: Straight line distance between two points latitude longitude in meters?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,216
    Blog Entries
    8

    Default

    You should be able to do it with cartesian + pythag if your assuming that the coordinate system is a sphere. WGS84 coords are spherical from a datum of the centre of earths gravity so it ought to be ok. If your not in WGS84 then it depends on the datum used and you can be a few hundred meters out if you dont use the correct elipsoid. Us brits get collard by this since almost every map you see in the UK is OSGB which means you need to set up a GPS datum or else its out. Extrapolating the OSGB elipsoid to the whole earth and you would be miles out on the other side of the planet. I have the formula to convert OSGB to WGS84 and back but it turns out that there is no single step you can do it in. You have to run it itteratively ! Bizarre but true. I dont have any datum to WGS84 but I am sure GDAL would be able to do this tho I have never looked.

  2. #2
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by Redrobes View Post
    You should be able to do it with cartesian + pythag if your assuming that the coordinate system is a sphere. WGS84 coords are spherical from a datum of the centre of earths gravity so it ought to be ok. If your not in WGS84 then it depends on the datum used and you can be a few hundred meters out if you dont use the correct elipsoid. Us brits get collard by this since almost every map you see in the UK is OSGB which means you need to set up a GPS datum or else its out. Extrapolating the OSGB elipsoid to the whole earth and you would be miles out on the other side of the planet. I have the formula to convert OSGB to WGS84 and back but it turns out that there is no single step you can do it in. You have to run it itteratively ! Bizarre but true. I dont have any datum to WGS84 but I am sure GDAL would be able to do this tho I have never looked.
    The WGS84 datum is not a sphere, it's a spheroid.

    As for datum shifts, GDAL requires special data files describing the transformation between datums (In geography this is the correct plural) and those transformations are specific to a particular pair of datums, for a particular region, and sometimes for a particular time. Depending on the distribution of GDAL you are using, you might get some transformations, particularly some common ones like transforming between NAD83 and WGS84 within North America.

    That said, I don't expect Robbie's use case will require datum shifts, it should all be doable in a single datum, be it WGS84 or something else. GDAL/OGR is probably overkill. Proj.4 is a more focused library that can do the same thing in terms of coordinate system transformation, including datum shifts, but without all the additional geometry (OGR) and raster handling (GDAL).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •