Difference between viewport and bounds in google geocoding
Asked Answered
C

2

17

What the difference between viewport and bounds rects in google geocoding api?

For big countries (USA, Russia) viewport differs from bounds (sample request for Canada: http://maps.googleapis.com/maps/api/geocode/xml?address=Canada&sensor=false, but for smaller countries, regions and cities they are equal.

Congo answered 21/2, 2013 at 15:35 Comment(0)
F
8

I think that if the viewport and the bounds are not the same for big countries is just because they can not be display with the default zoom. So the bounds are correct for the current view but the whole country will not be displayed.

For the viewport, it's just the minimum bound to display the whole country.

Hope i answer your question.

Finney answered 21/2, 2013 at 15:43 Comment(0)
L
29

Viewport contains the recommended viewport for displaying the returned result, specified as two latitude, longitude values defining the southwest and northeast corner of the viewport bounding box. Generally the viewport is used to frame a result when displaying it to a user.

Bounds stores the bounding box which can fully contain the returned result. Note that these bounds may not match the recommended viewport. (For example, San Francisco includes the Farallon islands, which are technically part of the city, but probably should not be returned in the viewport)

For more info: https://developers.google.com/maps/documentation/geocoding/requests-geocoding#results

Lymphoma answered 4/11, 2016 at 6:35 Comment(0)
F
8

I think that if the viewport and the bounds are not the same for big countries is just because they can not be display with the default zoom. So the bounds are correct for the current view but the whole country will not be displayed.

For the viewport, it's just the minimum bound to display the whole country.

Hope i answer your question.

Finney answered 21/2, 2013 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.