{"id":16740473,"url":"https://github.com/flopp/go-coordsparser","last_synced_at":"2025-04-10T13:22:39.008Z","repository":{"id":57481938,"uuid":"51693040","full_name":"flopp/go-coordsparser","owner":"flopp","description":"A library for parsing (geographic) coordinates in go (golang)","archived":false,"fork":false,"pushed_at":"2025-03-11T18:44:26.000Z","size":18,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:08:33.076Z","etag":null,"topics":["coordinates","geospatial","gis","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/flopp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-14T12:05:20.000Z","updated_at":"2025-03-11T18:44:28.000Z","dependencies_parsed_at":"2024-06-19T11:26:16.838Z","dependency_job_id":"3803edd5-6f45-4726-9940-f315ddff843d","html_url":"https://github.com/flopp/go-coordsparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-coordsparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-coordsparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-coordsparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-coordsparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flopp","download_url":"https://codeload.github.com/flopp/go-coordsparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225664,"owners_count":21068078,"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":["coordinates","geospatial","gis","parser"],"created_at":"2024-10-13T00:58:45.774Z","updated_at":"2025-04-10T13:22:38.953Z","avatar_url":"https://github.com/flopp.png","language":"Go","readme":"[![PkgGoDev](https://pkg.go.dev/badge/github.com/flopp/go-coordsparser)](https://pkg.go.dev/github.com/flopp/go-coordsparser)\n[![Go Report Card](https://goreportcard.com/badge/flopp/go-coordsparser)](https://goreportcard.com/report/flopp/go-coordsparser)\n[![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/flopp/go-coordsparser)\n\n# go-coordsparser\nA library for parsing (geographic) coordinates in go (golang)\n\n# What?\n\ngo-coordsparser allows you to parse lat/lng coordinates from strings in various popular formats. Currently supported formats are:\n\n- **D** (decimal degrees), e.g. `40.76, -73.984`\n- **HD** (hemisphere prefix, decimal degrees), e.g. `N 40.76 W 73.984`\n- **HDM** (hemisphere prefix, integral degrees, decimal minutes), e.g. `N 40 45.600 W 73 59.040`\n- **HDMS** (hemisphere prefix, integral degrees, integral minutes, decimal seconds), e.g. `N 40 45 36.0 W 73 59 02.4`\n\n# How?\n\n### Installing\nInstalling the library is as easy as\n\n```bash\n$ go get github.com/flopp/go-coordsparser\n```\n\nThe package can then be used through an\n\n```go\nimport \"github.com/flopp/go-coordsparser\"\n```\n\n### Using\ngo-coordsparser provides several functions for parsing coordinate strings: a general parsing function `coordsparser.Parse`, which accepts all supported formats, as well as specialized functions `coordsparser.ParseD`, `coordsparser.ParseHD`, `coordsparser.ParseHDM`, `coordsparser.ParseHDMS` for the corresponding coordinate formats.\n\nEach function takes a single string as a parameter and returns an idiomatic `lat, lng, error` triple, where `lat` and `lng` are decimal degrees (`float64`) with -90 ≤ `lat` ≤ 90 and -180 ≤ `lng` ≤ 180.\n\n```go\n// parse any format\ns1 := \"...\"\nlat1, lng1, err := coordsparser.Parse(s1)\nif err != nil {\n    fmt.Errorf(\"Cannot parse coordinates string:\", s1)\n}\n\n// parse specific format, e.g. HDM\ns2 := \"...\"\nlat2, lng2, err = coordsparser.ParseHDM(s2)\nif err != nil {\n    fmt.Errorf(\"Cannot parse coordinates string:\", s2)\n}\n```\n\n# License\nCopyright 2016 Florian Pigorsch. All rights reserved.\n\nUse of this source code is governed by a MIT-style license that can be found in the LICENSE file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fgo-coordsparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflopp%2Fgo-coordsparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fgo-coordsparser/lists"}