{"id":987,"url":"https://github.com/mhergon/RealmGeoQueries","last_synced_at":"2025-07-30T20:30:41.849Z","repository":{"id":47700602,"uuid":"47457558","full_name":"mhergon/RealmGeoQueries","owner":"mhergon","description":"Realm GeoQueries made easy","archived":false,"fork":false,"pushed_at":"2020-01-09T17:05:57.000Z","size":2215,"stargazers_count":143,"open_issues_count":0,"forks_count":28,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-21T07:31:30.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhergon.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":"2015-12-05T13:52:55.000Z","updated_at":"2023-07-20T11:18:52.000Z","dependencies_parsed_at":"2022-09-23T17:11:52.267Z","dependency_job_id":null,"html_url":"https://github.com/mhergon/RealmGeoQueries","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/mhergon/RealmGeoQueries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FRealmGeoQueries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FRealmGeoQueries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FRealmGeoQueries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FRealmGeoQueries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhergon","download_url":"https://codeload.github.com/mhergon/RealmGeoQueries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FRealmGeoQueries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267935131,"owners_count":24168267,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-01-05T20:15:36.349Z","updated_at":"2025-07-30T20:30:41.398Z","avatar_url":"https://github.com/mhergon.png","language":"Swift","funding_links":[],"categories":["Database","Swift"],"sub_categories":["Getting Started","\u003ca name=\"swift-libs\"\u003e\u003c/a\u003eSwift Libraries and Components","Other free courses","Linter"],"readme":"\u003cp align=\"center\" \u003e\n\u003cimg src=\"https://raw.github.com/mhergon/RealmGeoQueries/assets/logo.png\" alt=\"RealmGeoQueries\" title=\"Logo\" height=300\u003e\n\u003c/p\u003e\n\n![cocoapods](https://img.shields.io/cocoapods/v/RealmGeoQueries.svg?style=flat)\n![carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)\n![issues](https://img.shields.io/github/issues/mhergon/RealmGeoQueries.svg)\n![stars](https://img.shields.io/github/stars/mhergon/RealmGeoQueries.svg)\n![license](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)\n\nRealmGeoQueries simplifies spatial queries with [Realm Cocoa][1]. In the absence of and official functions, this library provide the possibility to do proximity search.\nIt's not necessary to include Geohash or other types of indexes in the model class as it only needs latitude and longitude properties.\n\n## How To Get Started\n\n### Installation with CocoaPods\n\n```ruby\nplatform :ios, '9.0'\npod \"RealmGeoQueries\"\n```\n\n### Installation with Carthage\n\nAdd to `mhergon/RealmGeoQueries` project to your `Cartfile`\n```ruby\ngithub \"mhergon/RealmGeoQueries\"\n```\n\nDrag `GeoQueries.framework`, `RealmSwift.framework` and `Realm.framework` from Carthage/Build/ to the “Linked Frameworks and Libraries” section of your Xcode project’s “General” settings.\n\nOnly on **iOS/tvOS/watchOS**: On your application targets \"Build Phases\" settings tab, click the \"+\" icon and choose \"New Run Script Phase\". Create a Run Script with the following contents:\n```ruby\n/usr/local/bin/carthage copy-frameworks\n```\nand add the paths to the frameworks you want to use under \"Input Files\", e.g.:\n```ruby\n$(SRCROOT)/Carthage/Build/iOS/GeoQueries.framework\n$(SRCROOT)/Carthage/Build/iOS/Realm.framework\n$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework\n```\n\n### Swift Package Manager\n\nOnce you have your Swift package set up, adding RealmGeoQueries as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/mhergon/RealmGeoQueries.git\", from: \"1.4.0\")\n]\n```\n\n### Manually installation\n\n[Download](https://github.com/mhergon/RealmGeoQueries/raw/master/GeoQueries.swift) (right-click) and add to your project.\n\n### Requirements\n\n| Version | Language | Minimum iOS Target |\n|:--------------------:|:---------------------------:|:---------------------------:|\n|          1.4         |            Swift 5.x / Realm 5.x            |            iOS 9            |\n|          1.3         |            Swift 4.x / Realm 3.x            |            iOS 9            |\n|          1.2         |            Swift 3.0 / Realm 2.x            |            iOS 9            |\n|          1.1         |            Swift 2.x / Realm 2.x            |            iOS 8            |\n\n### Usage\n\nFirst, import module;\n```swift\nimport GeoQueries\n```\n\nModel must have a latitude and longitude keys, that have to be named \"lat\" and \"lng\" respectively. You can use another property names (use \"latitudeKey\" and \"longitudeKey\" parameters).\n\n\u003cbr\u003e\n\nSearch with MapView MKCoordinateRegion;\n```swift\nlet results = try! Realm()\n    .findInRegion(type: YourModelClass.self, region: mapView.region)\n```\n\u003cbr\u003e\n\nSearch around the center with radius in meters;\n```swift\nlet results = try! Realm()\n    .findNearby(type: YourModelClass.self, origin: mapView.centerCoordinate, radius: 500, sortAscending: nil)\n```\n\u003cbr\u003e\n\nFilter Realm results with radius in meters;\n```swift\nlet results = try! Realm()\n    .objects(YourModelClass.self)\n    .filter(\"type\", \"restaurant\")\n    .filterGeoRadius(center: mapView.centerCoordinate, radius: 500, sortAscending: nil)\n```\n\u003cbr\u003e\n\nSee ```GeoQueries.swift``` for more options.\n\n## Contact\n\n- [Linkedin][2]\n- [Twitter][3] (@mhergon)\n\n[1]: http://www.realm.io\n[2]: https://es.linkedin.com/in/marchervera\n[3]: http://twitter.com/mhergon \"Marc Hervera\"\n\n## License\n\nLicensed under Apache License v2.0.\n\u003cbr\u003e\nCopyright 2020 Marc Hervera.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhergon%2FRealmGeoQueries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhergon%2FRealmGeoQueries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhergon%2FRealmGeoQueries/lists"}