{"id":36464982,"url":"https://github.com/umpc/go-bbox","last_synced_at":"2026-01-12T00:01:52.994Z","repository":{"id":96259517,"uuid":"132536367","full_name":"umpc/go-bbox","owner":"umpc","description":"This package calculates and returns one or more bounding boxes using a coordinate point and radius in kilometers.","archived":false,"fork":false,"pushed_at":"2018-05-20T20:03:45.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T12:35:34.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umpc.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":"2018-05-08T01:27:57.000Z","updated_at":"2018-05-20T20:03:46.000Z","dependencies_parsed_at":"2023-05-28T22:30:49.227Z","dependency_job_id":null,"html_url":"https://github.com/umpc/go-bbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/umpc/go-bbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umpc%2Fgo-bbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umpc%2Fgo-bbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umpc%2Fgo-bbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umpc%2Fgo-bbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umpc","download_url":"https://codeload.github.com/umpc/go-bbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umpc%2Fgo-bbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28328680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-12T00:01:52.316Z","updated_at":"2026-01-12T00:01:52.988Z","avatar_url":"https://github.com/umpc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-bbox\n\n[![Build Status](https://travis-ci.org/umpc/go-bbox.svg?branch=master)](https://travis-ci.org/umpc/go-bbox)\n[![Coverage Status](https://codecov.io/github/umpc/go-bbox/badge.svg?branch=master)](https://codecov.io/github/umpc/go-bbox?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/umpc/go-bbox)](https://goreportcard.com/report/github.com/umpc/go-bbox)\n[![GoDoc](https://godoc.org/github.com/umpc/go-bbox?status.svg)](https://godoc.org/github.com/umpc/go-bbox)\n\nThis package is an implementation of a geospatial bounding box algorithm located [here](https://web.archive.org/web/20180508002202/http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates#UsingIndex).\n\n```sh\ngo get -u github.com/umpc/go-bbox\n```\n\n* Earth's equatorial radius of 6,378,137 meters is used for compatibility\nwith online mapping services such as:\n  * Google Maps\n  * Bing Maps\n  * Mapbox\n* Bounds that cross the antimeridian are represented using two bounding boxes.\n* Bounds that cross the poles are represented using a single bounding box that has:\n  * a min longitude of -180 degrees\n  * a max longitude of 180 degrees\n\n## Example usage\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/umpc/go-bbox\"\n)\n\nfunc main() {\n  // Finds the min/max points for a rectangular area, which will be 276.49km\n  // southwest and northeast of the center point.\n  bboxes := bbox.New(276.494742, bbox.Point{\n    Latitude:  -14.2436432,\n    Longitude: -178.1795257,\n  })\n  for _, bbox := range bboxes {\n    fmt.Printf(\"%+v\\n\", bbox)\n  }\n}\n```\n\n## Example output\n\n```\n{Min:{Latitude:-16.727437727172838 Longitude:179.2578499517392} Max:{Latitude:-11.759848672827163 Longitude:180}}\n{Min:{Latitude:-16.727437727172838 Longitude:-180} Max:{Latitude:-11.759848672827163 Longitude:-175.61690135173924}}\n```\n\nThis example shows how bounds that cross the antimeridian are represented.\n\n## Benchmark results\n\n```sh\n$ go test -bench=.\ngoos: linux\ngoarch: amd64\npkg: github.com/umpc/go-bbox\nBenchmarkNewEmpty-8             10000000               181 ns/op\nBenchmarkNYC-8                   5000000               263 ns/op\nBenchmarkLondon-8                5000000               267 ns/op\nBenchmarkMontevideo-8            5000000               268 ns/op\nBenchmarkToloke-8                5000000               320 ns/op\nBenchmarkSuva-8                  5000000               322 ns/op\nBenchmarkNorthPole-8            10000000               200 ns/op\nBenchmarkSouthPole-8            10000000               202 ns/op\nPASS\nok      github.com/umpc/go-bbox 15.109s\n```\n\n* CPU: Intel Core i7-4790k\n* Memory: DDR3-1600\n* Go: 1.10.2\n\n## References:\n\n* Bronshtein, Semendyayev, Musiol, Mühlig: Handbook of Mathematics. Springer, Berlin. ISBN-13: 978-3817120079.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumpc%2Fgo-bbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumpc%2Fgo-bbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumpc%2Fgo-bbox/lists"}