Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between viewport and bounds in google geocoding

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.

like image 360
Ivan Kochurkin Avatar asked Feb 21 '13 15:02

Ivan Kochurkin


People also ask

What is viewport location?

In virtual desktops, the viewport is the visible portion of a 2D area which is larger than the visualization device. When viewing a document in a web browser, the viewport is the region of the browser window which contains the visible portion of the document.

What happens when you exceed the Google geocoding API rate limit 1 point?

If you exceed the per-day limit or otherwise abuse the service, the Google Maps Geocoding API may stop working for you temporarily. If you continue to exceed this limit, your access to the Google Maps Geocoding API may be blocked.

How does Google geocoding work?

Stay organized with collections Save and categorize content based on your preferences. Geocoding is the process of converting addresses (like a street address) into geographic coordinates (latitude and longitude), which you can use to place markers on a map, or position the map.

How do I see Geocodes on Google Maps?

Go to the Google Cloud Console. Click the Select a project button, then select the same project you set up for the Maps JavaScript API and click Open. From the list of APIs on the Dashboard, look for Geocoding API. If you see the API in the list, you're all set.


2 Answers

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/intro#Results

like image 138
Soliyappan Avatar answered Oct 03 '22 17:10

Soliyappan


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.

like image 45
Nicolas Tonneau Avatar answered Oct 03 '22 19:10

Nicolas Tonneau