{"id":26690329,"url":"https://github.com/sobakasu/jpm_geo","last_synced_at":"2025-07-02T13:40:31.867Z","repository":{"id":56879274,"uuid":"211737354","full_name":"sobakasu/jpm_geo","owner":"sobakasu","description":"Finds points within a distance of a latitude/longitude point using bounding coordinates","archived":false,"fork":false,"pushed_at":"2020-02-29T20:34:27.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-27T12:58:43.823Z","etag":null,"topics":["bounding-boxes","coordinates","gem","geospatial","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/sobakasu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-29T23:05:53.000Z","updated_at":"2020-02-29T20:34:20.000Z","dependencies_parsed_at":"2022-08-20T23:10:50.645Z","dependency_job_id":null,"html_url":"https://github.com/sobakasu/jpm_geo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sobakasu/jpm_geo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobakasu%2Fjpm_geo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobakasu%2Fjpm_geo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobakasu%2Fjpm_geo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobakasu%2Fjpm_geo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sobakasu","download_url":"https://codeload.github.com/sobakasu/jpm_geo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobakasu%2Fjpm_geo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263149283,"owners_count":23421346,"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":["bounding-boxes","coordinates","gem","geospatial","ruby"],"created_at":"2025-03-26T15:27:42.266Z","updated_at":"2025-07-02T13:40:31.841Z","avatar_url":"https://github.com/sobakasu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JpmGeo\r\n\r\nComputes the bounding coordinates of all points on the surface of a sphere that have a great circle distance to the given point. This code was ported to ruby directly from http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates, and is owned by Jan Philip Matuschek.\r\n\r\n## Installation\r\n\r\nAdd this line to your application's Gemfile:\r\n\r\n```ruby\r\ngem 'jpm_geo'\r\n```\r\n\r\nAnd then execute:\r\n\r\n    $ bundle\r\n\r\nOr install it yourself as:\r\n\r\n    $ gem install jpm_geo\r\n\r\n## Usage\r\n\r\n### Configuration\r\n\r\n```\r\n# use miles as a distance unit (default is kilometers)\r\nJpmGeo.units = 'm'\r\n\r\n# specify default radius (default is Earth kilometers)\r\nJpmGeo.radius = 3389.5 # Mars radius (km)\r\n```\r\n\r\n### Creating points\r\n```\r\n# lonlat is an object that responds to 'lon' and 'lat' methods\r\npoint = JpmGeo::Point.from_lonlat(lonlat) \r\n\r\n# from degrees\r\npoint = JpmGeo::Point.from_degrees(lat: 51.50853, lon: -0.12574) # London\r\n\r\n# from radians\r\npoint = JpmGeo::Point.from_radians(lat: 0.8990, lon: -0.0022) # London (ish)\r\n\r\n# converting to/from radians/degrees\r\npoint = point.to_radians\r\npoint = point.to_degrees\r\n```\r\n\r\n### Finding distance between points\r\n\r\n```\r\n# distance is in the same units as radius\r\ndistance = point.distance_to(point2)\r\n```\r\n\r\n### Finding bounding coordinates\r\n\r\n```\r\nbounds = point.bounds(100) # km\r\np [bounds[0].lat, bounds[0].lon, bounds[1].lat, bounds[1].lon]\r\n```\r\n\r\n## Contributing\r\n\r\nBug reports and pull requests are welcome on GitHub at https://github.com/sobakasu/jpm_geo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\r\n\r\n## License\r\n\r\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\r\n\r\n## Code of Conduct\r\n\r\nEveryone interacting in the JpmGeo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sobakasu/jpm_geo/blob/master/CODE_OF_CONDUCT.md).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobakasu%2Fjpm_geo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsobakasu%2Fjpm_geo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobakasu%2Fjpm_geo/lists"}