{
  "id": 238669,
  "title": "How to apply ellipsoidal height WGS 84?",
  "url": "/competitions/google-smartphone-decimeter-challenge/discussion/238669",
  "author_name": "",
  "post_date": "2021-05-13T02:28:27.931017100Z",
  "votes": 13,
  "comment_count": 2,
  "views": 0,
  "content": "<p>When we swim synchronizing GPS requires longitude, latitude and altitude above sea level information.</p>\n<p>Since the feature heightAboveWgs84EllipsoidM figures in locations_train csv, I'm curious how to apply it on a script.</p>\n<p>I'll be glad to read the triangulation with lat and long in any code.</p>",
  "messages": [
    {
      "id": "1304935",
      "postDate": "05/13/2021 02:28:27",
      "content": "<p>When we swim synchronizing GPS requires longitude, latitude and altitude above sea level information.</p>\n<p>Since the feature heightAboveWgs84EllipsoidM figures in locations_train csv, I'm curious how to apply it on a script.</p>\n<p>I'll be glad to read the triangulation with lat and long in any code.</p>",
      "rawMarkdown": "When we swim synchronizing GPS requires longitude, latitude and altitude above sea level information.\n\nSince the feature heightAboveWgs84EllipsoidM figures in locations_train csv, I'm curious how to apply it on a script.\n\nI'll be glad to read the triangulation with lat and long in any code.",
      "votes": null
    },
    {
      "id": "1306496",
      "postDate": "05/13/2021 20:04:41",
      "content": "<p>Hi!<br>\nYou can use brilliant lib - pyproj </p>\n<p><a href=\"https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__\" target=\"_blank\">https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__</a></p>\n<pre><code>from pyproj import Geod\ng = Geod(ellps='WGS84') # Use WGS84 ellipsoid.\n# specify the lat/lons of some cities.\nboston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)\nportland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)\nnewyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)\nlondon_lat = 51.+(32./60.); london_lon = -(5./60.)\n# compute forward and back azimuths, plus distance\n# between Boston and Portland.\naz12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)\nf\"{az12:.3f} {az21:.3f} {dist:.3f}\"\n'-66.531 75.654 4164192.708'\n</code></pre>\n<p>Also, take a look <a href=\"https://github.com/tkrajina/srtm.py\" target=\"_blank\">https://github.com/tkrajina/srtm.py</a><br>\nyou can download NASA elevation data by lat,lon.  How knows, It might be an interesting feature)</p>\n<pre><code>import srtm\nelevation_data = srtm.get_data()\nprint('CGN Airport elevation (meters):', elevation_data.get_elevation(50.8682, 7.1377))\n</code></pre>\n<p>Finally<br>\nyou can try Ramer-Douglas-Peucker algorithm for simplification.<br>\nan iterative implementation can be found here<br>\n<a href=\"https://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988\" target=\"_blank\">https://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988</a></p>",
      "rawMarkdown": "Hi!\nYou can use brilliant lib - pyproj \n\nhttps://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__\n\n```\nfrom pyproj import Geod\ng = Geod(ellps='WGS84') # Use WGS84 ellipsoid.\n# specify the lat/lons of some cities.\nboston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)\nportland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)\nnewyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)\nlondon_lat = 51.+(32./60.); london_lon = -(5./60.)\n# compute forward and back azimuths, plus distance\n# between Boston and Portland.\naz12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)\nf\"{az12:.3f} {az21:.3f} {dist:.3f}\"\n'-66.531 75.654 4164192.708'\n```\n\n\n\nAlso, take a look https://github.com/tkrajina/srtm.py\nyou can download NASA elevation data by lat,lon.  How knows, It might be an interesting feature)\n\n```\nimport srtm\nelevation_data = srtm.get_data()\nprint('CGN Airport elevation (meters):', elevation_data.get_elevation(50.8682, 7.1377))\n```\n\nFinally\nyou can try Ramer-Douglas-Peucker algorithm for simplification.\nan iterative implementation can be found here\nhttps://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988",
      "votes": null
    },
    {
      "id": "1306610",
      "postDate": "05/13/2021 23:27:35",
      "content": "<p>Thank you for your instructive, detailed, substantial answer Maksim. </p>",
      "rawMarkdown": "Thank you for your instructive, detailed, substantial answer Maksim.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1306496,
      "author_name": "shadowklesh",
      "author_url": "",
      "post_date": "05/13/2021 20:04:41",
      "content": "<p>Hi!<br>\nYou can use brilliant lib - pyproj </p>\n<p><a href=\"https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__\" target=\"_blank\">https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__</a></p>\n<pre><code>from pyproj import Geod\ng = Geod(ellps='WGS84') # Use WGS84 ellipsoid.\n# specify the lat/lons of some cities.\nboston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)\nportland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)\nnewyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)\nlondon_lat = 51.+(32./60.); london_lon = -(5./60.)\n# compute forward and back azimuths, plus distance\n# between Boston and Portland.\naz12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)\nf\"{az12:.3f} {az21:.3f} {dist:.3f}\"\n'-66.531 75.654 4164192.708'\n</code></pre>\n<p>Also, take a look <a href=\"https://github.com/tkrajina/srtm.py\" target=\"_blank\">https://github.com/tkrajina/srtm.py</a><br>\nyou can download NASA elevation data by lat,lon.  How knows, It might be an interesting feature)</p>\n<pre><code>import srtm\nelevation_data = srtm.get_data()\nprint('CGN Airport elevation (meters):', elevation_data.get_elevation(50.8682, 7.1377))\n</code></pre>\n<p>Finally<br>\nyou can try Ramer-Douglas-Peucker algorithm for simplification.<br>\nan iterative implementation can be found here<br>\n<a href=\"https://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988\" target=\"_blank\">https://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1306610,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/13/2021 23:27:35",
          "content": "<p>Thank you for your instructive, detailed, substantial answer Maksim. </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1304935": "When we swim synchronizing GPS requires longitude, latitude and altitude above sea level information.\n\nSince the feature heightAboveWgs84EllipsoidM figures in locations_train csv, I'm curious how to apply it on a script.\n\nI'll be glad to read the triangulation with lat and long in any code.",
    "1306496": "Hi!\nYou can use brilliant lib - pyproj \n\nhttps://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.__init__\n\n```\nfrom pyproj import Geod\ng = Geod(ellps='WGS84') # Use WGS84 ellipsoid.\n# specify the lat/lons of some cities.\nboston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)\nportland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)\nnewyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)\nlondon_lat = 51.+(32./60.); london_lon = -(5./60.)\n# compute forward and back azimuths, plus distance\n# between Boston and Portland.\naz12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)\nf\"{az12:.3f} {az21:.3f} {dist:.3f}\"\n'-66.531 75.654 4164192.708'\n```\n\n\n\nAlso, take a look https://github.com/tkrajina/srtm.py\nyou can download NASA elevation data by lat,lon.  How knows, It might be an interesting feature)\n\n```\nimport srtm\nelevation_data = srtm.get_data()\nprint('CGN Airport elevation (meters):', elevation_data.get_elevation(50.8682, 7.1377))\n```\n\nFinally\nyou can try Ramer-Douglas-Peucker algorithm for simplification.\nan iterative implementation can be found here\nhttps://github.com/fhirschmann/rdp/issues/5#issuecomment-229691988",
    "1306610": "Thank you for your instructive, detailed, substantial answer Maksim."
  },
  "source": "meta"
}