<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 8.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutRouteQueryDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:9HealthKit29HKWorkoutRouteQueryDescriptorV"
  },
  "title" : "HKWorkoutRouteQueryDescriptor"
}
-->

# HKWorkoutRouteQueryDescriptor

A query interface that reads the location data stored in a workout route using Swift concurrency.

```
struct HKWorkoutRouteQueryDescriptor
```

## Overview

Use [`HKWorkoutRouteQueryDescriptor`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor) to access the individual <doc://com.apple.documentation/documentation/CoreLocation/CLLocation> objects stored in an [`HKWorkoutRoute`](/documentation/HealthKit/HKWorkoutRoute) sample. To read the individual locations, create a workout route query descriptor using the desired route, and then call the descriptor’s [`results(for:)`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/results(for:)) method.

```swift
// Create the descriptor.
let routeQueryDescriptor = HKWorkoutRouteQueryDescriptor(myRoute)

// Get the AsyncSequence that returns individual locations.
let locations = routeQueryDescriptor.results(for: store)

// Access each location.
for try await location in locations {
    
    // Process the results here.
    print(location.coordinate)
    print(location.timestamp)
}
```

While this method returns an <doc://com.apple.documentation/documentation/Swift/AsyncSequence>, unlike the long-running queries, this sequence has a finite size. Iterating over the sequence asynchronously returns the route’s locations, automatically terminating after you receive all the locations.

## Topics

### Creating workout route query descriptors

[`init(HKWorkoutRoute)`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/init(_:))

Creates a query descriptor that reads locations from the provided workout route sample.

### Running queries

[`func results(for: HKHealthStore) -> HKWorkoutRouteQueryDescriptor.Results`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/results(for:))

Runs a one-shot query that returns an asynchronous sequence of data representing individual locations.

[`struct Results`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/Results)

An asynchronous sequence that emits data about individual locations from a workout route sample.

### Accessing query properties

[`var workoutRoute: HKWorkoutRoute`](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/workoutRoute)

A workout route sample that contains locations.

### Default Implementations

[HKAsyncSequenceQuery Implementations](/documentation/HealthKit/HKWorkoutRouteQueryDescriptor/HKAsyncSequenceQuery-Implementations)

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`HKAsyncSequenceQuery`](/documentation/HealthKit/HKAsyncSequenceQuery)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)