ARGeoAnchor

Inherits: RefCounted < Object

A GPS-positioned anchor for geo-referenced AR content.

Description

Represents a world position defined by latitude, longitude, and altitude. Used with ARSession.run_geo_tracking(). iOS 14+ only. On visionOS and macOS, this type exists for API consistency but is never populated with real tracking data.

Properties

float

altitude

0.0

int

altitude_source

0

Vector2

coordinate

Vector2(0, 0)

String

identifier

""

Transform3D

transform

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

Methods

ARGeoAnchor

create(latitude: float, longitude: float, altitude: float) static

ARGeoAnchor

create_at_coordinate(latitude: float, longitude: float) static


Enumerations

enum AltitudeSource: 🔗

AltitudeSource UNKNOWN = 0

The altitude source is unknown.

AltitudeSource COARSE = 1

The altitude was estimated from a coarse data source.

AltitudeSource PRECISE = 2

The altitude was determined from a precise data source.

AltitudeSource USER_DEFINED = 3

The altitude value was provided explicitly by the user or app.


Property Descriptions

float altitude = 0.0 🔗

  • void set_altitude(value: float)

  • float get_altitude()

The anchor altitude in meters.


int altitude_source = 0 🔗

  • void set_altitude_source(value: int)

  • int get_altitude_source()

How the altitude value was determined. See AltitudeSource.


Vector2 coordinate = Vector2(0, 0) 🔗

  • void set_coordinate(value: Vector2)

  • Vector2 get_coordinate()

The geographic coordinate stored as Vector2(latitude, longitude).


String identifier = "" 🔗

  • void set_identifier(value: String)

  • String get_identifier()

A unique identifier for this geo anchor.


Transform3D transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 🔗

  • void set_transform(value: Transform3D)

  • Transform3D get_transform()

The anchor transform in world space once geo tracking has localized it.


Method Descriptions

ARGeoAnchor create(latitude: float, longitude: float, altitude: float) static 🔗

Creates a geo anchor at the given latitude, longitude, and altitude.


ARGeoAnchor create_at_coordinate(latitude: float, longitude: float) static 🔗

Creates a geo anchor at the given latitude and longitude, letting ARKit determine the altitude when possible.