{"id":19873964,"url":"https://github.com/bose/worldmagneticmodel","last_synced_at":"2026-06-10T11:31:53.586Z","repository":{"id":56927724,"uuid":"166106834","full_name":"Bose/WorldMagneticModel","owner":"Bose","description":"World Magnetic Model wrapper library for iOS","archived":false,"fork":false,"pushed_at":"2019-05-03T19:46:40.000Z","size":6568,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-11T16:50:14.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T20:27:21.000Z","updated_at":"2022-05-25T13:21:39.000Z","dependencies_parsed_at":"2022-08-21T05:50:45.665Z","dependency_job_id":null,"html_url":"https://github.com/Bose/WorldMagneticModel","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bose%2FWorldMagneticModel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bose%2FWorldMagneticModel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bose%2FWorldMagneticModel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bose%2FWorldMagneticModel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bose","download_url":"https://codeload.github.com/Bose/WorldMagneticModel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241301726,"owners_count":19940696,"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":"2024-11-12T16:20:43.785Z","updated_at":"2026-06-10T11:31:53.540Z","avatar_url":"https://github.com/Bose.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# World Magnetic Model\n\nThis project provides a native iOS framework that wraps the World Magnetic Model.\n\nThe World Magnetic Model is a joint product of the United States’ National Geospatial-Intelligence Agency (NGA) and the United Kingdom’s Defence Geographic Centre (DGC). The WMM was developed jointly by the National Geophysical Data Center (NGDC, Boulder CO, USA) (now the National Centers for Environmental Information (NCEI)) and the British Geological Survey (BGS, Edinburgh, Scotland).\n\nThe World Magnetic Model is the standard model used by the U.S. Department of Defense, the U.K. Ministry of Defence, the North Atlantic Treaty Organization (NATO) and the International Hydrographic Organization (IHO), for navigation, attitude and heading referencing systems using the geomagnetic field. It is also used widely in civilian navigation and heading systems. The model, associated software, and documentation are distributed by NCEI on behalf of NGA. The model is produced at 5-year intervals, with the current model expiring on December 31, 2019.\n\nFurther information about the World Magnetic Model is available [here](https://www.ngdc.noaa.gov/geomag/WMM/).\n\nThe WMM source and coefficients distribution, as downloaded from the WMM website, are included in the `WMM2015v2` directory. These are included here for reference purposes only. Any files used by the iOS wrapper library are also committed under the `Source/WMM` directory.\n\n## Installation\n\nThis framework can be installed via [CocoaPods](https://cocoapods.org). Add the following to your `Podfile`:\n\n```ruby\npod 'WorldMagneticModel', '~\u003e 1'\n```\n\n## Usage\n\n```swift\nimport CoreLocation\nimport WorldMagneticModel\n\n// Step 1: Create the model.\nlet model = try? WMMModel()\n\n// Step 2: Get the current location of the device. This is left as an exercise\n// for the reader.\nlet location: CLLocation = getCurrentLocation()\n\n// Step 3: Compute the magnetic field elements for the current location at the\n// current time.\nlet elements = model?.elements(for: location)\n\n// Step 4: Get the current heading of the device. This is left as an exercise\n// for the reader. The value should be in degrees as the declination value\n// (found in WMMElements.decl) is in degrees.\nlet magneticHeading: Double = getCurrentMagneticHeading()\n\n// Step 5: Use the declination (found in WMMElements.decl) to convert the\n// magnetic heading (relative to magnetic north) into a true heading (relative\n// to the geographic north).\nlet trueHeading = magneticHeading + elements.decl\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbose%2Fworldmagneticmodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbose%2Fworldmagneticmodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbose%2Fworldmagneticmodel/lists"}