Stay organized with collectionsSave and categorize content based on your preferences.
The Streetscape Geometry APIs provide the geometry of terrain, buildings, or other structures in a scene. The geometry can be used for occlusion, rendering, or placing AR content via hit-test APIs. Streetscape Geometry data is obtained through Google Street View imagery.
Try the sample
TheGeospatialExample appdemonstrates how to obtain and render Streetscape Geometries.
Set up the Geospatial API
To use Streetscape Geometry, you'll need to set up the Geospatial API in your project.
Follow instructions onEnabling the Geospatial APIto set up the Geospatial API.
GARStreetscapeGeometryQualityBuildingLOD_2will have higher fidelity geometry. Mesh walls and roofs will more closely match the building's shape. Smaller features like chimneys or roof vents may still poke outside of the mesh.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eThe Streetscape Geometry APIs use Google Street View data to provide 3D geometry of terrain and buildings for use in AR experiences.\u003c/p\u003e\n"],["\u003cp\u003eEnable the Geospatial and Streetscape Geometry modes in your ARCore session configuration to access this data.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGARStreetscapeGeometry\u003c/code\u003e objects represent terrain or buildings, providing mesh data and quality information for rendering.\u003c/p\u003e\n"],["\u003cp\u003eYou can attach AR content to Streetscape Geometry using anchors, ensuring the content is anchored to real-world structures.\u003c/p\u003e\n"],["\u003cp\u003eHit-testing against Streetscape Geometry allows you to interact with and place AR objects on real-world surfaces represented by the geometry.\u003c/p\u003e\n"]]],[],null,["# Use buildings and terrain around you on iOS\n\nThe Streetscape Geometry APIs provide the geometry of terrain, buildings, or other structures in a scene. The geometry can be used for occlusion, rendering, or placing AR content via hit-test APIs. Streetscape Geometry data is obtained through Google Street View imagery.\n\nTry the sample\n--------------\n\nThe [GeospatialExample app](https://github.com/google-ar/arcore-ios-sdk/tree/master/Examples/GeospatialExample) demonstrates how to obtain and render Streetscape Geometries.\n\nSet up the Geospatial API\n-------------------------\n\nTo use Streetscape Geometry, you'll need to set up the Geospatial API in your project.\nFollow instructions on [Enabling the Geospatial API](/ar/develop/ios/geospatial/enable) to set up the Geospatial API.\n\nEnable Streetscape Geometry\n---------------------------\n\nThe Geospatial API obtains Streetscape Geometry data when the [`GARGeospatialMode`](/ar/reference/ios/group/GARGeospatialMode) is set to [`GARGeospatialModeEnabled`](/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodeenabled) and [`GARStreetscapeGeometryMode`](/ar/reference/ios/group/GARStreetscapeGeometryMode) is set to [`GARStreetscapeGeometryModeEnabled`](/ar/reference/ios/group/GARStreetscapeGeometryMode#garstreetscapegeometrymodeenabled). \n\n GARSessionConfiguration *configuration = [[GARSessionConfiguration alloc] init];\n configuration.geospatialMode = GARGeospatialModeEnabled;\n configuration.streetscapeGeometryMode = GARStreetscapeGeometryModeEnabled;\n [garSession setConfiguration:configuration error:&error];\n\nObtain Streetscape Geometry in an ARCore session\n------------------------------------------------\n\nUse [`GARFrame.streetscapeGeometries`](/ar/reference/ios/category/GARFrame(Geospatial)#streetscapegeometries) to obtain all [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry) objects.\n\n\u003cbr /\u003e\n\nUnderstand [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry)\n-----------------------------------------------------------------------------------------\n\n[`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry) contains information about a building:\n\n- [`GARStreetscapeGeometry.type`](/ar/reference/ios/interface/GARStreetscapeGeometry#type) \n Identifies the StreetscapeGeometry as either terrain or a building.\n- [`GARStreetscapeGeometry.mesh`](/ar/reference/ios/interface/GARStreetscapeGeometry#mesh) \n Obtain a polygon [`GARMesh`](/ar/reference/ios/interface/GARMesh) that corresponds to this terrain or building.\n- [`GARStreetscapeGeometry.meshTransform`](/ar/reference/ios/interface/GARStreetscapeGeometry#meshtransform) \n Describes the origin of the geometry. All points in the [`GARMesh`](/ar/reference/ios/interface/GARMesh) should be transformed by [`GARStreetscapeGeometry.meshTransform`](/ar/reference/ios/interface/GARStreetscapeGeometry#meshtransform).\n- [`GARStreetscapeGeometry.quality`](/ar/reference/ios/interface/GARStreetscapeGeometry#quality) \n Provides the quality of the mesh data. Levels of detail are described in the [CityGML 2.0 standard](https://portal.ogc.org/files/?artifact_id=16675).\n\n### Building LOD 1\n\n[`GARStreetscapeGeometryQualityBuildingLOD_1`](/ar/reference/ios/group/GARStreetscapeGeometryQuality#garstreetscapegeometryqualitybuildinglod_1) consists of building footprints extruded upwards to a flat top. Building heights may be inaccurate.\n\n### Building LOD 2\n\n[`GARStreetscapeGeometryQualityBuildingLOD_2`](/ar/reference/ios/group/GARStreetscapeGeometryQuality#garstreetscapegeometryqualitybuildinglod_2) will have higher fidelity geometry. Mesh walls and roofs will more closely match the building's shape. Smaller features like chimneys or roof vents may still poke outside of the mesh.\n\nUnderstand [`GARMesh`](/ar/reference/ios/interface/GARMesh)\n-----------------------------------------------------------\n\n[`GARMesh`](/ar/reference/ios/interface/GARMesh) is a polygon mesh representing a surface reconstruction of the Streetscape Geometry.\n\nEach [`GARMesh`](/ar/reference/ios/interface/GARMesh) includes a vertex buffer and index buffer:\n\n- [`GARMesh.vertexCount`](/ar/reference/ios/interface/GARMesh#vertexcount) \n Retrieves the number of vertices in this mesh.\n- [`GARMesh.vertices`](/ar/reference/ios/interface/GARMesh#vertices) \n Obtain the concatenated positions of mesh vertices, in coordinates relative to [`GARStreetscapeGeometry.meshTransform`](/ar/reference/ios/interface/GARStreetscapeGeometry#meshtransform).\n- [`GARMesh.triangleCount`](/ar/reference/ios/interface/GARMesh#trianglecount) \n Retrieves the number of indices in this mesh.\n- [`GARMesh.triangles`](/ar/reference/ios/interface/GARMesh#triangles) \n Obtain the indexes of vertices that make up a face.\n\nAttach AR content to a [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry)\n-----------------------------------------------------------------------------------------------------\n\nUse [`GARSesssion.createAnchorOnStreetscapeGeometry:transform:error:`](/ar/reference/ios/category/GARSession(Geospatial)#createanchoronstreetscapegeometry:transform:error:) to create an anchor at a given pose near [`GARStreetscapeGeometry.meshTransform`](/ar/reference/ios/interface/GARStreetscapeGeometry#meshtransform). This anchor will inherit its tracking state from the parent [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry).\n\n\u003cbr /\u003e\n\n### Perform a hit-test against [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry)\n\n[`GARSession.raycastStreetscapeGeometry:direction:error:`](/ar/reference/ios/category/GARSession(Geospatial)#raycaststreetscapegeometry:direction:error:) can be used to hit-test against Streetscape Geometry. If intersections are found, [`GARStreetscapeGeometryRaycastResult`](/ar/reference/ios/interface/GARStreetscapeGeometryRaycastResult) contains pose information about the hit location as well as a reference to the [`GARStreetscapeGeometry`](/ar/reference/ios/interface/GARStreetscapeGeometry) which was hit. This Streetscape Geometry can be passed to [`GARSesssion.createAnchorOnStreetscapeGeometry:transform:error:`](/ar/reference/ios/category/GARSession(Geospatial)#createanchoronstreetscapegeometry:transform:error:) to create an anchor attached to it. \n\n NSArray\u003cGARStreetscapeGeometryRaycastResult *\u003e *results =\n [session raycastStreetscapeGeometry:arRaycastQuery.origin\n direction:arRaycastQuery.direction\n error:&error];\n [session createAnchorOnStreetscapeGeometry:results[0].streetscapeGeometry\n transform:results[0].worldTransform\n error:&error];"]]