Building outlines and entrances

A building outline is a set of latitude/longitude coordinate pairs that define a 2D polygon representing the surface area of the earth covered by the building. You can use this polygon to draw the outline of a building on a map. An entrance is a single latitude/longitude coordinate pair that defines the location of an entry and exit point into a place; for example, the door of a building.

Additional parameters

Include extra_computations=BUILDING_AND_ENTRANCES in a geocoding request, reverse geocoding request, or a places geocoding request to receive entrances and building outlines in your response.

Example request

The following query enables building outlines and entrances for a restaurant in Mountain View, California, United States:

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ4TTDdzS3j4AR78EQgu5EADA&extra_computations=BUILDING_AND_ENTRANCES&key=YOUR_API_KEY

Example response

The response from the query above is as follows:

{
  "entrances": [
    {
      "location": {
        "lat": 37.3925065,
        "lng": -122.0799465
      },
      "building_place_id": "ChIJVeHddzS3j4ARFZJVu4Cf27o"
    }
  ],
  "buildings" : [
    {
      "building_outlines" : [
        {
          "display_polygon" : {
            "coordinates" : [
              [
                [
                    -122.080188246116,
                    37.3926407183216
                ],
                [
                    -122.080281351765,
                    37.3924887558601
                ],
                [
                    -122.080023707261,
                    37.392390122414
                ],
                [
                    -122.079926266852,
                    37.3925369491992
                ],
                [
                    -122.080188246116,
                    37.3926407183216
                ]
              ]
            ],
            "type" : "Polygon"
          }
        }
      ],
      "place_id" : "ChIJVeHddzS3j4ARFZJVu4Cf27o"
    }
  ],
}

There are 2 arrays that can be returned when this feature is enabled: buildings[] and entrances[].

Each entrances result has the following fields:

  • location is the latitude/longitude coordinates of the entrance.
  • building_place_id is the place ID of the building that contains the entrance. Note that this is parameter won't always be populated.

Each buildings result has the following fields:

  • place_id is the unique identifier of the building. See the place ID overview for more details.
  • building_outlines[] is an array of outlines associated with the building. As of now this array will only have one entry. Each object in building_outlines[] has the following fields:
    • display_polygon is the GeoJSON encoding of the polygon that approximates the surface area of the earth covered by the building, using the RFC 7946 format. Note that the RFC 7946 format supports multi-polygons, so one display_polygon object can represent multiple polygons.

Coverage

This feature is available in all regions; however not all buildings will have outlines or entrances, and coverage will vary by region. In addition, you should expect to receive API responses that contain a building outline but no entrances. Entrance coverage is expected to improve over time.

Feedback

This is an experimental feature. We would appreciate feedback at buildings-in-geocoding-feedback-channel@google.com.