{"id":29623764,"url":"https://github.com/mikemitterer/ts-latlong","last_synced_at":"2025-07-21T05:07:55.146Z","repository":{"id":142151372,"uuid":"194040520","full_name":"MikeMitterer/ts-latlong","owner":"MikeMitterer","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-02T03:11:37.000Z","size":6126,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-16T06:44:42.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MikeMitterer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-27T07:00:51.000Z","updated_at":"2025-07-11T05:09:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c915458-5342-4fc3-b42f-ea7f92df79ba","html_url":"https://github.com/MikeMitterer/ts-latlong","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MikeMitterer/ts-latlong","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeMitterer%2Fts-latlong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeMitterer%2Fts-latlong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeMitterer%2Fts-latlong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeMitterer%2Fts-latlong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikeMitterer","download_url":"https://codeload.github.com/MikeMitterer/ts-latlong/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeMitterer%2Fts-latlong/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266242072,"owners_count":23898102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T05:07:54.300Z","updated_at":"2025-07-21T05:07:55.112Z","avatar_url":"https://github.com/MikeMitterer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LatLong - Lightweight library for common latitude and longitude calculation\n\u003e [Live-Example](#) | [GitHub-Home](https://github.com/MikeMitterer/ts-latlong)\n\nThis library supports both, the \"Haversine\" and the \"Vincenty\" algorithm.\n\n\"Haversine\" is a bit faster but \"Vincenty\" is far more accurate!\n \n\u003cp align=\"center\"\u003e \n    \u003cimg alt=\"LatLong\" src=\"https://github.com/MikeMitterer/ts-latlong/raw/master/doc/images/latlong.jpg\"\u003e \n\u003c/p\u003e\n\n[Catmull-Rom algorithm](http://hawkesy.blogspot.co.at/2010/05/catmull-rom-spline-curve-implementation.html) is used for smoothing out the path.\n\n## Basic usage \n\n### Distance\n```typescript\n    const distance = new Distance();\n    \n    // km = 423\n    const km = distance.as(LengthUnit.Kilometer,\n     new LatLng(52.518611,13.408056),new LatLng(51.519475,7.46694444));\n    \n    // meter = 422591.551\n    const meter = distance.distance(\n        new LatLng(52.518611,13.408056),\n        new LatLng(51.519475,7.46694444)\n        );\n\n```\n\n## Offset\n```typescript\n    const distance = new Distance();\n    const distanceInMeter = Math.round(EARTH_RADIUS * Math.PI / 4));\n    \n    const p1 = new LatLng(0.0, 0.0);\n    const p2 = distance.offset(p1, distanceInMeter, 180);\n    \n    // LatLng(latitude:-45.219848, longitude:0.0)\n    console.log(p2.round());\n    \n    // 45° 13' 11.45\" S, 0° 0' 0.00\" O\n    console.log(p2.toSexagesimal());\n            \n```\n\n## Path smoothing\n```typescript\n    // zigzag is a list of coordinates\n    const path = new Path.from(zigzag);\n    \n    // Result is below\n    const steps = path.equalize(8,smoothPath: true);\n```\n\u003cp align=\"center\"\u003e \n    \u003cimg alt=\"Smooth path\" src=\"https://github.com/MikeMitterer/ts-latlong/raw/master/doc/images/smooth-path.jpg\"\u003e\n\u003c/p\u003e\n\nFor more - check out my tests\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemitterer%2Fts-latlong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikemitterer%2Fts-latlong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemitterer%2Fts-latlong/lists"}