GPS Geofencing for Venue Blocking: Accuracy and Privacy
Whistl's GPS geofencing detects when you approach gambling venues and automatically activates protective measures. This technical guide explains geofence accuracy, battery optimisation, privacy safeguards, and how location-based blocking prevents impulses in the critical moments before they happen.
How GPS Geofencing Works
Geofencing creates virtual boundaries around physical locations. When you cross these boundaries, Whistl triggers protective actions:
- Venue database: 5,000+ gambling venues mapped across Australia
- Geofence creation: 500m radius around each venue
- Location monitoring: Background GPS tracking
- Boundary detection: Entry/exit event triggers
- Protection activation: Automatic blocking + intervention
Venue Database
Whistl maintains a comprehensive database of gambling venues:
Venue Categories
| Category | Examples | Count |
|---|---|---|
| Casinos | Crown Melbourne, Star Sydney, Treasury Brisbane | 14 |
| TAB Agencies | Tabcorp retail locations | 1,200+ |
| Pubs with Pokies | Registered clubs with gaming machines | 2,500+ |
| Sports Betting Shops | Sportsbet, Ladbrokes, Bet365 stores | 800+ |
| Racing Venues | Flemington, Randwick, Eagle Farm | 150+ |
| Bingo Halls | Community bingo centres | 350+ |
Data Sources
- Government registers: State liquor and gaming commissions
- OpenStreetMap: Community-mapped venue locations
- Google Places API: Verified business locations
- User submissions: Crowdsourced venue additions
Geofence Configuration
Each venue has configurable geofence parameters:
Default Settings
{
"venue_id": "crown_melbourne",
"coordinates": {"lat": -37.8225, "lng": 144.9586},
"geofence_radius": 500, // meters
"trigger_on_entry": true,
"trigger_on_exit": true,
"dwell_time_threshold": 300, // 5 minutes
"accuracy_threshold": 50, // meters
"priority": "high"
}
Radius Selection
500m radius balances accuracy with battery life:
- 100m: Too late—user already inside venue
- 500m: Optimal—early warning, time to intervene
- 1000m: Too early—false positives from passing by
Research shows 500m provides 3-5 minutes advance warning at walking speed.
Location Monitoring Implementation
Whistl uses native location services for efficient background monitoring:
iOS Core Location
import CoreLocation
class VenueGeofenceManager: NSObject, CLLocationManagerDelegate {
private let locationManager = CLLocationManager()
private var monitoredGeofences: Set = []
func startMonitoring() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
locationManager.distanceFilter = 100 // Update every 100m
// Request background permission
locationManager.requestAlwaysAuthorization()
locationManager.allowsBackgroundLocationUpdates = true
locationManager.pausesLocationUpdatesAutomatically = false
locationManager.startUpdatingLocation()
startMonitoringVenues()
}
private func startMonitoringVenues() {
let venues = loadNearbyVenues()
for venue in venues {
let region = CLCircularRegion(
center: venue.coordinates,
radius: 500,
identifier: venue.id
)
region.notifyOnEntry = true
region.notifyOnExit = true
locationManager.startMonitoring(for: region)
monitoredGeofences.insert(venue.id)
}
}
func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
guard let circularRegion = region as? CLCircularRegion else { return }
handleVenueEntry(venueId: circularRegion.identifier)
}
func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
guard let circularRegion = region as? CLCircularRegion else { return }
handleVenueExit(venueId: circularRegion.identifier)
}
}
Android Geofencing API
import android.location.Location
import com.google.android.gms.location.*
class VenueGeofenceManager(private val context: Context) {
private val geofencingClient = LocationServices.getGeofencingClient(context)
private val geofenceList = mutableListOf()
private val geofencePendingIntent: PendingIntent by lazy {
val intent = Intent(context, GeofenceBroadcastReceiver::class.java)
PendingIntent.getBroadcast(
context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
}
fun startMonitoring(venues: List) {
for (venue in venues) {
val geofence = Geofence.Builder()
.setRequestId(venue.id)
.setCircularRegion(venue.lat, venue.lng, 500f)
.setExpirationDuration(Geofence.NEVER_EXPIRE)
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER or Geofence.GEOFENCE_TRANSITION_EXIT)
.setLoiteringDelay(300000) // 5 minutes
.build()
geofenceList.add(geofence)
}
val geofencingRequest = GeofencingRequest.Builder()
.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER)
.addGeofences(geofenceList)
.build()
geofencingClient.addGeofences(geofencingRequest, geofencePendingIntent)
.addOnSuccessListener { /* Monitoring started */ }
.addOnFailureListener { e -> /* Handle error */ }
}
}
Accuracy and Reliability
GPS accuracy varies based on conditions:
Accuracy Levels
| Condition | Typical Accuracy | Geofence Reliability |
|---|---|---|
| Open sky (outdoors) | 5-10m | Excellent (99%+) |
| Urban canyon (city streets) | 15-30m | Good (95%+) |
| Indoor (near windows) | 30-50m | Moderate (85%+) |
| Indoor (deep inside) | 50-100m+ | Poor (rely on WiFi) |
Accuracy Enhancement Techniques
- WiFi positioning: Supplement GPS with nearby WiFi networks
- Cell tower triangulation: Use cellular signal for coarse location
- Sensor fusion: Combine accelerometer, gyroscope for dead reckoning
- Map matching: Snap locations to known roads/paths
False Positive Prevention
To avoid triggering when simply passing by:
- Dwell time threshold: Must remain in geofence for 5+ minutes
- Heading analysis: Check if moving toward or away from venue
- Speed filtering: Ignore if moving at vehicle speed (>30 km/h)
- Historical patterns: Skip if this is regular commute route
Battery Optimisation
Continuous GPS monitoring drains battery. Whistl implements multiple optimisations:
Adaptive Location Updates
func calculateUpdateInterval() -> TimeInterval {
let nearbyVenues = countVenuesWithin(distance: 2000)
switch nearbyVenues {
case 0:
return 300 // 5 minutes (no venues nearby)
case 1...3:
return 60 // 1 minute (few venues)
case 4...10:
return 30 // 30 seconds (moderate density)
default:
return 10 // 10 seconds (high density area)
}
}
Significant Location Change Monitoring
iOS provides low-power significant change monitoring:
- Power consumption: ~1% battery per day
- Update trigger: ~500m movement
- Use case: Background monitoring when app not active
Region Monitoring vs. Continuous GPS
| Method | Battery Impact | Accuracy | Latency |
|---|---|---|---|
| Region monitoring (geofences) | Low (2-3%/day) | 100m | 30-90 seconds |
| Significant changes | Very low (1%/day) | 500m | 2-5 minutes |
| Continuous GPS | High (15-20%/day) | 5-10m | Real-time |
| Adaptive (Whistl) | Moderate (5-7%/day) | 50m | 10-60 seconds |
Privacy Safeguards
Location data is highly sensitive. Whistl implements strict privacy protections:
On-Device Processing
- Local geofence checks: All venue detection happens on device
- No location transmission: Coordinates never sent to servers
- Encrypted storage: Location history stored in secure enclave
- Automatic deletion: History purged after 30 days
User Controls
- Granular permissions: "Always Allow" required for background monitoring
- Temporary disable: Pause location tracking for set duration
- Venue whitelist: Exclude specific venues (e.g., work location)
- Export/delete data: Full control over location history
Permission Transparency
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>Whistl monitors your location to detect when you're near gambling venues and activate protective blocking. Your location data never leaves your device.</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Whistl uses your location to identify nearby gambling venues and provide context-aware support.</string>
Protection Activation
When a geofence is triggered, Whistl activates multiple protective measures:
Immediate Actions
- SpendingShield elevation: Risk level jumps to ORANGE/RED
- VPN activation: DNS blocking enabled immediately
- Push notification: "You're near [Venue]. Your risk is elevated."
- Partner alert: Optional notification to accountability partner
- AI intervention: Neural impulse predictor recalculates with venue proximity
Intervention Message
"We noticed you're near Crown Casino. Your risk is elevated right now. Remember your Bali goal—you're $840 away. Want to call your sponsor instead?"
Edge Cases and Handling
Real-world usage presents challenges:
Multi-Venue Complexes
Some locations have multiple venues (e.g., Crown Entertainment Complex):
- Solution: Treat as single large geofence
- Radius: Extended to 800m for complexes
- Notification: Generic "entertainment complex" message
Temporary Venues
Pop-up betting shops during major events:
- Solution: Dynamic venue database updates
- Source: Event calendars + user reports
- Expiration: Auto-remove after event ends
GPS Spoofing
Users may attempt to fake location:
- Detection: Check for mock location flags
- Response: Disable location features, notify user
- Alternative: Fall back to DNS-only protection
Performance Metrics
Geofencing performance from 10,000+ users:
| Metric | Result |
|---|---|
| Geofence Entry Detection Rate | 97.3% |
| False Positive Rate | 2.1% |
| Average Detection Latency | 23 seconds |
| Battery Impact (daily) | 5.4% average |
| Intervention Acceptance | 68% when near venue |
| User Satisfaction | 4.6/5.0 |
User Testimonials
"I walked past the TAB on my way home and my phone buzzed. Whistl knew before I even thought about going in. That's wild." — Jake, 31
"The geofencing saved me at Crown. I was about to walk in, got the notification, and turned around. Best feature by far." — Marcus, 28
"I was worried about battery drain but it's maybe 5% per day. Totally worth it for the protection." — Sarah, 34
Conclusion
GPS geofencing provides powerful location-based protection while respecting privacy and battery life. By detecting venue proximity early, Whistl intervenes at the critical moment—before the impulse becomes action.
All location processing happens on-device, ensuring your movements remain private while still enabling life-saving intervention.
Get Location-Based Protection
Whistl's geofencing detects gambling venues and activates protection automatically. Download free and experience intelligent location-based blocking.
Download Whistl FreeRelated: DNS Filtering Implementation | 27 Risk Signals | Biometric Spending Protection