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
TheGeospatial sample 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.
BuildingLOD1consists of building footprints extruded upwards to a flat top. Building heights may be inaccurate.
Building LOD 2
BuildingLOD2will 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.
Meshis a polygon mesh representing a surface reconstruction of the Streetscape Geometry.
SeeMeshandMeshRenderer. Note that the normals are not calculated by default;
seeMesh.RecalculateNormals()to calculate them.
Geospatial Depthcombines Streetscape Geometry
with local sensor input to enhance depth data. When Geospatial Depth is enabled,
the output depth and raw depth images are modified to include rasterized Streetscape Geometry in addition to locally observed depth.
This may improve the accuracy of poses using Depth.
[[["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 utilize Google Street View data to provide 3D geometry of terrain and buildings for use in AR experiences.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can obtain and render Streetscape Geometries by enabling the Geospatial and Streetscape Geometry modes within the Geospatial API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eARStreetscapeGeometry\u003c/code\u003e objects contain mesh data, geometry type (terrain or building), and quality level, enabling developers to interact with the geometry.\u003c/p\u003e\n"],["\u003cp\u003eAR content can be attached to or hit-tested against Streetscape Geometry using provided methods for anchoring and raycasting.\u003c/p\u003e\n"],["\u003cp\u003eEnabling Geospatial Depth can enhance depth data by combining Streetscape Geometry with local sensor input for improved accuracy.\u003c/p\u003e\n"]]],["Streetscape Geometry APIs provide terrain and building geometry from Google Street View imagery for AR applications. To use it, enable the Geospatial API and set both `GeospatialMode` and `StreetscapeGeometryMode` to `Enabled`. An `ARStreetscapeGeometryManager` component obtains the data, triggering an event when geometries change. The data, provided as meshes, can be used for occlusion, rendering and placing AR content with anchors. Geometry quality varies from basic (`BuildingLOD1`) to high fidelity (`BuildingLOD2`). Hit-tests against geometry can return the point of contact. Geospatial Depth combines sensor input with Streetscape geometry to improve depth data.\n"],null,["# Use buildings and terrain around you on Unity\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 [Geospatial sample app](https://github.com/google-ar/arcore-unity-extensions/tree/master/Samples~/Geospatial) 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/unity-arf/geospatial/enable) to set up the Geospatial API.\n\nEnable Streetscape Geometry\n---------------------------\n\nThe Geospatial API obtains Streetscape Geometry data when the [`GeospatialMode`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#geospatialmode) is set to [`GeospatialMode.Enabled`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#geospatialmode_enabled) and [`StreetscapeGeometryMode`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#streetscapegeometrymode) is set to [`StreetscapeGeometryMode.Enabled`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#streetscapegeometrymode_enabled).\n\nObtain Streetscape Geometry in an ARCore session\n------------------------------------------------\n\nAdd an [`ARStreetscapeGeometryManager`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometryManager) component to a `GameObject`. When Streetscape Geometries are added, updated, or removed, the [`ARStreetscapeGeometryManager.StreetscapeGeometriesChanged`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometryManager#streetscapegeometrieschanged) event is triggered.\n\n\u003cbr /\u003e\n\n public Material streetscapeGeometryMaterial;\n\n List\u003cARStreetscapeGeometry\u003e _addedStreetscapeGeometries = new List\u003cARStreetscapeGeometry\u003e();\n List\u003cARStreetscapeGeometry\u003e _updatedStreetscapeGeometries = new List\u003cARStreetscapeGeometry\u003e();\n List\u003cARStreetscapeGeometry\u003e _removedStreetscapeGeometries = new List\u003cARStreetscapeGeometry\u003e();\n\n public void OnEnable()\n {\n StreetscapeGeometryManager.StreetscapeGeometriesChanged +=\n GetStreetscapeGeometry;\n }\n\n public void Update() {\n foreach (ARStreetscapeGeometry streetscapegeometry in _addedStreetscapeGeometries)\n {\n GameObject renderObject = new GameObject(\n \"StreetscapeGeometryMesh\", typeof(MeshFilter), typeof(MeshRenderer));\n\n if (renderObject)\n {\n renderObject.transform.position = streetscapegeometry.pose.position;\n renderObject.transform.rotation = streetscapegeometry.pose.rotation;\n renderObject.GetComponent\u003cMeshFilter\u003e().mesh = streetscapegeometry.mesh;\n renderObject.GetComponent\u003cMeshRenderer\u003e().material = streetscapeGeometryMaterial;\n }\n }\n }\n\n public void OnDisable()\n {\n StreetscapeGeometryManager.StreetscapeGeometriesChanged -=\n GetStreetscapeGeometry;\n }\n\n private void GetStreetscapeGeometry(ARStreetscapeGeometriesChangedEventArgs eventArgs)\n {\n _addedStreetscapeGeometries = eventArgs.Added;\n _updatedStreetscapeGeometries = eventArgs.Updated;\n _removedStreetscapeGeometries = eventArgs.Removed;\n }\n\nUnderstand [`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry)\n--------------------------------------------------------------------------------------------------------------------\n\n[`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry) contains information about a building:\n\n- [`ARStreetscapeGeometry.streetscapeGeometryType`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry#streetscapegeometrytype) \n Identifies the StreetscapeGeometry as either terrain or a building.\n- [`ARStreetscapeGeometry.mesh`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry#mesh) \n Obtain a polygon [`Mesh`](https://docs.unity3d.com/ScriptReference/Mesh.html) that corresponds to this terrain or building.\n- [`ARStreetscapeGeometry.quality`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry#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[`BuildingLOD1`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#streetscapegeometryquality_buildinglod1) consists of building footprints extruded upwards to a flat top. Building heights may be inaccurate.\n\n### Building LOD 2\n\n[`BuildingLOD2`](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#streetscapegeometryquality_buildinglod2) 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 [`Mesh`](https://docs.unity3d.com/ScriptReference/Mesh.html)\n-----------------------------------------------------------------------\n\n[`Mesh`](https://docs.unity3d.com/ScriptReference/Mesh.html) is a polygon mesh representing a surface reconstruction of the Streetscape Geometry.\n\nSee [`Mesh`](https://docs.unity3d.com/ScriptReference/Mesh.html) and [`MeshRenderer`](https://docs.unity3d.com/Manual/class-MeshRenderer.html). Note that the normals are not calculated by default;\nsee [`Mesh.RecalculateNormals()`](https://docs.unity3d.com/ScriptReference/Mesh.RecalculateNormals.html) to calculate them.\n\nAttach AR content to a [`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry)\n--------------------------------------------------------------------------------------------------------------------------------\n\nUse [`ARAnchorManager.AddAnchor()`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARAnchorManager.html#UnityEngine_XR_ARFoundation_ARAnchorManager_AddAnchor_UnityEngine_Pose_) to create an anchor at a given pose near vertices in [`ARStreetscapeGeometry.mesh`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry#mesh). This anchor will inherit its tracking state from the parent [`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry).\n\n\u003cbr /\u003e\n\n### Perform a hit-test against [`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry)\n\n[`ARRaycastManagerExtensions.RaycastStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARRaycastManagerExtensions#raycaststreetscapegeometry) can be used to hit-test against Streetscape Geometry. If intersections are found, [`XRRaycastHit`](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRRaycastHit.html) contains pose information about the hit location as well as a reference to the [`ARStreetscapeGeometry`](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARStreetscapeGeometry) which was hit. This Streetscape Geometry can be passed to [`ARAnchorManager.AddAnchor()`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARAnchorManager.html#UnityEngine_XR_ARFoundation_ARAnchorManager_AddAnchor_UnityEngine_Pose_) to create an anchor attached to it. \n\n Vector2 screenTapPosition = Input.GetTouch(0).position;\n List\u003cXRRaycastHit\u003e hitResults = new List\u003cXRRaycastHit\u003e();\n if (RaycastManager.RaycastStreetscapeGeometry(screenTapPosition, ref hitResults)){\n ARStreetscapeGeometry streetscapegeometry =\n StreetscapeGeometryManager.GetStreetscapeGeometry(hitResults[0].trackableId);\n if (streetscapegeometry != null)\n {\n ARAnchor anchor = StreetscapeGeometryManager.AttachAnchor(streetscapegeometry, hitResults[0].pose);\n }\n }\n\nEnable Geospatial Depth\n-----------------------\n\n[Geospatial Depth](/ar/develop/unity-arf/depth/geospatial-depth) combines Streetscape Geometry\nwith local sensor input to enhance depth data. When Geospatial Depth is enabled,\nthe output depth and raw depth images are modified to include rasterized Streetscape Geometry in addition to locally observed depth.\nThis may improve the accuracy of poses using Depth."]]