Skip to content

Commit

Permalink
Release 10.47.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Feb 12, 2024
1 parent 63ab988 commit 68530d3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
32 changes: 15 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
x.y.z Release notes (yyyy-MM-dd)
10.47.0 Release notes (2024-02-12)
=============================================================

### Enhancements

* Added initial support for geospatial queries on points.
There is no new dedicated type to store Geospatial points, instead points should
be stored as ([GeoJson-shaped](https://www.mongodb.com/docs/manual/reference/geojson/)) embedded object, as the example below.
be stored as ([GeoJson-shaped](https://www.mongodb.com/docs/manual/reference/geojson/))
embedded object, as the example below:
```swift
public class Location: EmbeddedObject {
@Persisted private var coordinates: List<Double>
Expand All @@ -18,49 +21,44 @@ x.y.z Release notes (yyyy-MM-dd)
coordinates.append(objectsIn: [longitude, latitude])
}
}
```
Geospatial queries (`geoWithin`) can only be executed in such a type of objects and
will throw otherwise.
The queries can be used to filter objects whose points lie within a certain area,
using the following pre-established shapes (`GeoBox`, `GeoPolygon`, `GeoCircle`).
```
Geospatial queries (`geoWithin`) can only be executed on such a type of
objects and will throw otherwise. The queries can be used to filter objects
whose points lie within a certain area, using the following pre-established
shapes (`GeoBox`, `GeoPolygon`, `GeoCircle`).
```swift
class Person: Object {
@Persisted var name: String
@Persisted var location: Location? // GeoJson embedded object
}

let realm = realmWithTestPath()
try realm.write {
realm.add(PersonLocation(name: "Maria", location: Location(latitude: 55.6761, longitude: 12.5683)))
}

let shape = GeoBox(bottomLeft: (55.6281, 12.0826), topRight: (55.6762, 12.5684))!
let locations = realm.objects(PersonLocation.self).where { $0.location.geoWithin(shape) })
```
A `filter` or `NSPredicate` can be used as well to perform a Geospatial query.
```swift
let shape = GeoPolygon(outerRing: [(-2, -2), (-2, 2), (2, 2), (2, -2), (-2, -2)], holes: [[(0, 0), (1, 1), (-1, 1), (0, 0)]])!
let locations = realm.objects(PersonLocation.self).filter("location IN %@", shape)

let locations = realm.objects(PersonLocation.self).filter(NSPredicate(format: "location IN %@", shape))
```

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-swift/issues/????), since v?.?.?)
* None.

<!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->

### Compatibility

* Realm Studio: 14.0.1 or later.
* APIs are backwards compatible with all previous releases in the 10.x.y series.
* Carthage release for Swift is built with Xcode 15.2.0.
* CocoaPods: 1.10 or later.
* Xcode: 14.2-15.2.0.

### Internal

* Migrated Release pipelines to Github Actions.
* Upgraded realm-core from ? to ?

10.46.0 Release notes (2024-01-23)
=============================================================
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription
import Foundation

let coreVersion = Version("13.26.0")
let cocoaVersion = Version("10.46.0")
let cocoaVersion = Version("10.47.0")

let cxxSettings: [CXXSetting] = [
.headerSearchPath("."),
Expand Down
4 changes: 2 additions & 2 deletions Realm/Realm-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>10.46.0</string>
<string>10.47.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>10.46.0</string>
<string>10.47.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014-2021 Realm. All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=10.46.0
VERSION=10.47.0
REALM_CORE_VERSION=13.26.0
STITCH_VERSION=8bf8ebcff6e804586c30a6ccbadb060753071a42

0 comments on commit 68530d3

Please sign in to comment.