You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# FlitsGeohash
2
2
3
-
`FlitsGeohash` is a Swift package for working with geohashes on Apple platforms. It wraps a small C implementation with a Swift-friendly API for encoding coordinates, finding adjacent cells, collecting neighbors, and generating the geohashes that cover a region.
3
+
`FlitsGeohash` is a Swift package for working with geohashes on Apple platforms and Linux. It wraps a small C implementation with a Swift-friendly API for encoding coordinates, finding adjacent cells, collecting neighbors, and generating the geohashes that cover a region.
4
4
5
5
## Features
6
6
@@ -9,12 +9,15 @@
9
9
- Fetch all 8 neighboring geohashes
10
10
- Generate the geohashes that cover a map region
11
11
- Use strongly typed fixed-length geohashes for common lengths
12
+
- Use the same coordinate API on Linux without depending on `CoreLocation`
12
13
13
14
## Requirements
14
15
15
16
- Swift 6.0+
16
-
-`CoreLocation`
17
17
- Apple platforms where `CoreLocation` is available
18
+
- Linux
19
+
20
+
When `CoreLocation` is unavailable, `FlitsGeohash` provides compatible `CLLocationCoordinate2D`, `CLLocationDegrees`, and `CLLocationCoordinate2DIsValid` definitions so the public API stays the same across platforms.
18
21
19
22
## Installation
20
23
@@ -44,7 +47,9 @@ targets: [
44
47
### Encode a coordinate
45
48
46
49
```swift
50
+
#ifcanImport(CoreLocation)
47
51
importCoreLocation
52
+
#endif
48
53
importFlitsGeohash
49
54
50
55
let coordinate =CLLocationCoordinate2D(
@@ -61,6 +66,8 @@ let shortHash = coordinate.geohash(length: 5)
61
66
62
67
The string-based API accepts geohash lengths from `1...22`.
63
68
69
+
On Linux, the snippet above works unchanged. `FlitsGeohash` exposes a compatible coordinate type when `CoreLocation` is not available.
70
+
64
71
### Adjacent cells and neighbors
65
72
66
73
```swift
@@ -120,7 +127,7 @@ let regionHashes = Geohash3.hashesForRegion(
120
127
swift test
121
128
```
122
129
123
-
The test suite includes correctness checks and performance-oriented coverage for encoding, adjacency, neighbors, and region generation.
130
+
The test suite includes correctness checks and performance-oriented coverage for encoding, adjacency, neighbors, and region generation, and CI runs on both macOS and Ubuntu.
0 commit comments