Use buildings and terrain around you on Android SDK (Kotlin/Java)
Stay organized with collections
Save 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.
To use Streetscape Geometry, you'll need to set up the Geospatial API in your project.
Follow instructions on Enabling the Geospatial API to set up the Geospatial API.
StreetscapeGeometry.Quality.BUILDING_LOD_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.
Frame.hitTest() can be used to hit-test against Streetscape Geometry. If intersections are found, HitResult contains pose information about the hit location as well as a reference to the StreetscapeGeometry which was hit. This Streetscape Geometry can be passed to Trackable.createAnchor() to create an anchor attached to it.
Geospatial Depth combines 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 need to enable both the Geospatial API and Streetscape Geometry mode in their ARCore session configuration.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eStreetscapeGeometry\u003c/code\u003e objects contain mesh data, pose information, and quality level for representing the geometry.\u003c/p\u003e\n"],["\u003cp\u003eAR content can be attached to Streetscape Geometry using Geospatial Depth hit-tests or by creating anchors directly on the geometry.\u003c/p\u003e\n"],["\u003cp\u003eGeospatial Depth enhances depth data by combining Streetscape Geometry with sensor input, potentially improving pose accuracy.\u003c/p\u003e\n"]]],[],null,["# Use buildings and terrain around you on Android SDK (Kotlin/Java)\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_java sample app](https://github.com/google-ar/arcore-android-sdk/tree/master/samples/geospatial_java) 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/java/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/java/com/google/ar/core/Config.GeospatialMode) is set to [`GeospatialMode.ENABLED`](/ar/reference/java/com/google/ar/core/Config.GeospatialMode#ENABLED) and [`StreetscapeGeometryMode`](/ar/reference/java/com/google/ar/core/Config.StreetscapeGeometryMode) is set to [`StreetscapeGeometryMode.ENABLED`](/ar/reference/java/com/google/ar/core/Config.StreetscapeGeometryMode#ENABLED). \n\n### Java\n\n```java\nConfig config = session.getConfig();\n// Streetscape Geometry requires the Geospatial API to be enabled.\nconfig.setGeospatialMode(Config.GeospatialMode.ENABLED);\n// Enable Streetscape Geometry.\nconfig.setStreetscapeGeometryMode(Config.StreetscapeGeometryMode.ENABLED);\nsession.configure(config);\n```\n\n### Kotlin\n\n```kotlin\nsession.configure(\n session.config.apply {\n // Streetscape Geometry requires the Geospatial API to be enabled.\n geospatialMode = Config.GeospatialMode.ENABLED\n // Enable Streetscape Geometry.\n streetscapeGeometryMode = Config.StreetscapeGeometryMode.ENABLED\n }\n)\n```\n\nObtain Streetscape Geometry in an ARCore session\n------------------------------------------------\n\nUse [`Session.getAllTrackables()`](/ar/reference/java/com/google/ar/core/Session#getAllTrackables-filterType) and use [`StreetscapeGeometry.class`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry) to filter results.\n\n\u003cbr /\u003e\n\n### Java\n\n```java\nsession.getAllTrackables(StreetscapeGeometry.class);\n```\n\n### Kotlin\n\n```kotlin\nsession.getAllTrackables(StreetscapeGeometry::class.java)\n```\n\nUnderstand [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry)\n---------------------------------------------------------------------------------------------\n\n[`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry) contains information about a building:\n\n- [`StreetscapeGeometry.getType()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getType-) \n Identifies the StreetscapeGeometry as either terrain or a building.\n- [`StreetscapeGeometry.getMesh()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getMesh-) \n Obtain a polygon [`Mesh`](/ar/reference/java/com/google/ar/core/Mesh) that corresponds to this terrain or building.\n- [`StreetscapeGeometry.getMeshPose()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getMeshPose-) \n Describes the origin of the geometry. All points in the [`Mesh`](/ar/reference/java/com/google/ar/core/Mesh) should be transformed by [`StreetscapeGeometry.getMeshPose()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getMeshPose-).\n- [`StreetscapeGeometry.getQuality()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getQuality-) \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[`StreetscapeGeometry.Quality.BUILDING_LOD_1`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry.Quality#building_lod_1) consists of building footprints extruded upwards to a flat top. Building heights may be inaccurate.\n\n### Building LOD 2\n\n[`StreetscapeGeometry.Quality.BUILDING_LOD_2`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry.Quality#building_lod_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 [`Mesh`](/ar/reference/java/com/google/ar/core/Mesh)\n---------------------------------------------------------------\n\n[`Mesh`](/ar/reference/java/com/google/ar/core/Mesh) is a polygon mesh representing a surface reconstruction of the Streetscape Geometry.\n\nEach [`Mesh`](/ar/reference/java/com/google/ar/core/Mesh) includes a vertex buffer and index buffer:\n\n- [`Mesh.getVertexListSize()`](/ar/reference/java/com/google/ar/core/Mesh#getVertexListSize-) \n Retrieves the number of vertices in this mesh.\n- [`Mesh.getVertexList()`](/ar/reference/java/com/google/ar/core/Mesh#getVertexList-) \n Obtain the concatenated positions of mesh vertices, in coordinates relative to [`StreetscapeGeometry.getMeshPose()`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry#getMeshPose-).\n- [`Mesh.getIndexListSize()`](/ar/reference/java/com/google/ar/core/Mesh#getIndexListSize-) \n Retrieves the number of indices in this mesh.\n- [`Mesh.getIndexList()`](/ar/reference/java/com/google/ar/core/Mesh#getIndexList-) \n Obtain the indexes of vertices that make up a face.\n\nAttach AR content to a [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry)\n---------------------------------------------------------------------------------------------------------\n\nThere are two ways to attach AR content to Streetscape Geometry:\n\n\u003cbr /\u003e\n\n- Enable [Geospatial Depth](/ar/develop/java/depth/geospatial-depth) and use a [Depth hit-test](/ar/develop/java/depth/developer-guide#depth_hit-test). This is the recommended and easier method.\n- Use [`Trackable.createAnchor()`](/ar/reference/java/com/google/ar/core/Trackable#createAnchor-pose) to create an anchor at a given pose attached to a [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry). This anchor will inherit its tracking state from the parent [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry).\n\n### Perform a hit-test against [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry)\n\n[`Frame.hitTest()`](/ar/reference/java/com/google/ar/core/Frame#hitTest-motionEvent) can be used to hit-test against Streetscape Geometry. If intersections are found, [`HitResult`](/ar/reference/java/com/google/ar/core/HitResult) contains pose information about the hit location as well as a reference to the [`StreetscapeGeometry`](/ar/reference/java/com/google/ar/core/StreetscapeGeometry) which was hit. This Streetscape Geometry can be passed to [`Trackable.createAnchor()`](/ar/reference/java/com/google/ar/core/Trackable#createAnchor-pose) to create an anchor attached to it. \n\n### Java\n\n```java\nfor (HitResult hit : frame.hitTest(singleTapEvent)) {\n if (hit.getTrackable() instanceof StreetscapeGeometry) {\n Pose hitPose = hit.getHitPose();\n hit.getTrackable().createAnchor(hitPose);\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nfor (hit in frame.hitTest(singleTapEvent)) {\n if (hit.trackable is StreetscapeGeometry) {\n val hitPose = hit.hitPose\n hit.trackable.createAnchor(hitPose)\n }\n}\n```\n\nEnable Geospatial Depth\n-----------------------\n\n[Geospatial Depth](/ar/develop/java/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."]]