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.
Try the sampleThe geospatial_java sample app demonstrates how to obtain and render Streetscape Geometries.
Set up the Geospatial APITo 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.
Enable Streetscape GeometryThe Geospatial API obtains Streetscape Geometry data when the GeospatialMode
is set to GeospatialMode.ENABLED
and StreetscapeGeometryMode
is set to StreetscapeGeometryMode.ENABLED
.
Config config = session.getConfig(); // Streetscape Geometry requires the Geospatial API to be enabled. config.setGeospatialMode(Config.GeospatialMode.ENABLED); // Enable Streetscape Geometry. config.setStreetscapeGeometryMode(Config.StreetscapeGeometryMode.ENABLED); session.configure(config);Kotlin
session.configure( session.config.apply { // Streetscape Geometry requires the Geospatial API to be enabled. geospatialMode = Config.GeospatialMode.ENABLED // Enable Streetscape Geometry. streetscapeGeometryMode = Config.StreetscapeGeometryMode.ENABLED } )Obtain Streetscape Geometry in an ARCore session
Use
Session.getAllTrackables()
and use
StreetscapeGeometry.class
to filter results.
Javasession.getAllTrackables(StreetscapeGeometry.class);Kotlin
session.getAllTrackables(StreetscapeGeometry::class.java)Understand
StreetscapeGeometry
StreetscapeGeometry
contains information about a building:
StreetscapeGeometry.getType()
StreetscapeGeometry.getMesh()
Mesh
that corresponds to this terrain or building.StreetscapeGeometry.getMeshPose()
Mesh
should be transformed by StreetscapeGeometry.getMeshPose()
.StreetscapeGeometry.getQuality()
StreetscapeGeometry.Quality.BUILDING_LOD_1
consists of building footprints extruded upwards to a flat top. Building heights may be inaccurate.
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.
Mesh
Mesh
is a polygon mesh representing a surface reconstruction of the Streetscape Geometry. Each Mesh
includes a vertex buffer and index buffer:
Mesh.getVertexListSize()
Mesh.getVertexList()
StreetscapeGeometry.getMeshPose()
.Mesh.getIndexListSize()
Mesh.getIndexList()
StreetscapeGeometry
There are two ways to attach AR content to Streetscape Geometry:
Trackable.createAnchor()
to create an anchor at a given pose attached to a StreetscapeGeometry
. This anchor will inherit its tracking state from the parent StreetscapeGeometry
.StreetscapeGeometry
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.
for (HitResult hit : frame.hitTest(singleTapEvent)) { if (hit.getTrackable() instanceof StreetscapeGeometry) { Pose hitPose = hit.getHitPose(); hit.getTrackable().createAnchor(hitPose); } }Kotlin
for (hit in frame.hitTest(singleTapEvent)) { if (hit.trackable is StreetscapeGeometry) { val hitPose = hit.hitPose hit.trackable.createAnchor(hitPose) } }Enable Geospatial Depth
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[[["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."],[[["The Streetscape Geometry APIs utilize Google Street View data to provide 3D geometry of terrain and buildings for use in AR experiences."],["Developers need to enable both the Geospatial API and Streetscape Geometry mode in their ARCore session configuration."],["`StreetscapeGeometry` objects contain mesh data, pose information, and quality level for representing the geometry."],["AR content can be attached to Streetscape Geometry using Geospatial Depth hit-tests or by creating anchors directly on the geometry."],["Geospatial Depth enhances depth data by combining Streetscape Geometry with sensor input, potentially improving pose accuracy."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4