Getting information of a panoram in google street view python - python

I'm using the following url to get important information of one latitud-longitud coordinate points in google street view.
http://maps.google.com/cbk?output=xml&ll=....
Specifically I need to know what is the real coordinates for google street view for a GIVEN pair of coordinates.
In the Python API there is not how to access to this information.
For example:
http://maps.google.com/cbk?output=xml&ll=46.414382,10.013988
For the (latitud,longitud)=(46.414382,10.013988)
This is the only way I found to do it in Python.
My question is, is it legal to use this url to get this information?
Thank you so much

From the Google Maps API TOS: 10.4d
No use of Content without a Google map. Unless the Maps APIs Documentation expressly permits you to do so, you will not use the Content in a Maps API Implementation without a corresponding Google map. For example, you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation expressly permits this use.
I'm not sure if the endpoint you mention is explicitly documented and use without a map is allowed somewhere in the API docs, if not, I think 10.4d applies and you are not allowed to use it.

Related

API to get all pincodes inside a radius

I'm working on a python application where we need to get all the pincodes within a specific radius.
We have a base location and a radius of 10Km is drawn from this base pincode.
Do we have any API where this can be achieved?
FYA - Mainly looking for Indian PostalCodes.
First thing that comes to my mind is the Google Maps API, under this link you can find the relevant guide for it: https://developers.google.com/maps/web-services/client-library
I guess that you will need to sign up for google maps api key and enable the place search feature for your key. I think this Place Search feature is all you need for your task.

in Google Maps API, can you code a multi-line string (e.g. representing a specific zone on a map) and ask for directions which avoid that zone? [duplicate]

I want to get the route between 2 points using google maps api but I want also avoid some coordinates between them.
I have been investigating this feature but I do not know if it is possible to get this done. See these threads:
Is there a way to avoid a specific road or coordinate in Google Directions?
Avoid some coordinates in routes using Google Directions API Android
Anyone know if it is possible?
Thanks
Avoid feature has been introduced in Google Maps Distance Matrix API, however it can only be used to avoid Tolls, Highways, Ferries, and Indoor.
you can check this on its documentation page.
https://developers.google.com/maps/documentation/distance-matrix/intro
This feature is pretty popular and has been formerly requested in Google Issue Tracker. If you really need it you can go ahead and support it by starring it.
https://issuetracker.google.com/issues/35816642

How to obtain google map images "satellite view without labels" using python

I know about Google map static API which can return map as an image. But it returns static view and I need satellite view of google map without labels for my system. I've been searching for solution for so long but couldn't find any.
any help would really be appreciated.
If your intention is to get static maps satellite imagery via official service and hide all labels on it (except Google logo and copyrights) you can set map type to satellite and apply styles that hide all labels with Static Maps API. For example,
https://maps.googleapis.com/maps/api/staticmap?center=39.279117%2C-89.881745&zoom=18&size=600x400&maptype=satellite&style=feature%3Aall%7Celement%3Alabels%7Cvisibility%3Aoff&key=YOUR_API_KEY
Otherwise if you want download and store images for your needs, stitch them or remove copyright labels the solution might be not compliant with Google Maps API Terms of Service.
Look at the following sections of Terms of Service.
Paragraph 10.1 (a)
No access to APIs or Content except through the Service. You will not access the Maps API(s) or the Content except through the Service. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).
That means you cannot scrap satellite imagery for your needs and store it in your storage.
Paragraph 10.5 (g)
No removing, obscuring, or altering terms of service, links, or proprietary rights notices. You will not:
remove, obscure, or alter any Google terms of service or any links to or notices of those terms, or any copyright, trademark, or other proprietary rights notices; or
falsify or delete any author attributions, legal notices, or other labels of the origin or source of material.
Finally, paragraph 10.5 (b)
No derivative works. You will not modify or create a derivative work based on any Content unless expressly permitted to do so under these Terms. For example, the following are prohibited: (i) creating server-side modification of map tiles; (ii) stitching multiple static map images together to display a map that is larger than permitted in the Maps APIs Documentation; or (iii) tracing or copying the copyrightable elements of Google’s maps or building outlines and creating a new work, such as a new mapping or navigation dataset.
I hope my answer addresses your question.

Python Flask-GoogleMaps where to change default region?

I am using flask google maps to display a google map.
I noticed that the default preferenced region is USA and that it can be changed in script. I need the region to be germany:
When you load the Google Maps JavaScript API from maps.googleapis.com it applies a default bias for application behavior towards the United States. If you want to alter your application to serve different map tiles or bias the application (such as biasing geocoding results towards the region), you can override this default behavior by adding a region parameter to the tag when loading the Maps JavaScript API code.
This needs to be changed because there are cities with the same name and for example the input "Potsdam" shows a city in the USA instead the city in germany.
As far as I understand the region argument has to be added here, my map in python:
mymap = Map(
identifier="view-side",
lat=location.latitude,
lng=location.longitude,
infobox=[],
markers=[],
zoom = 11
)
I tried to add region = "Germany" but nothing happened.
There is no example in the documentation.
Flask-GoogleMaps should be just a wrapper around the Google Maps API.
The location documentation from the google maps api states:
Language localization
By default, the Google Maps JavaScript API uses the user's preferred
language setting as specified in the browser, when displaying textual
information such as the names for controls, copyright notices, driving
directions and labels on maps. In most cases, it's preferable to
respect the browser setting. However, if you want the Maps JavaScript
API to ignore the browser's language setting, you can force it to
display information in a particular language by adding a language
parameter to the tag when loading the Maps JavaScript API
code.
The following example displays a map in Japanese and sets the region
to Japan:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&language=ja&region=JP">
So you could define the region in the javascript script tag where you load the google libary in your template.
A google region code is a IANA language region subtag
According to this page the region code for Germany should be DE
Sadly adding the ?region=DE argument to the script did not work aswell, so I managed to solve it with a trick.
I simply added germany "Deutschland" to the location which the user searches.
Solution:
location = geolocator.geocode("Deutschland, " + findroomcity)
Currently it seems googlemaps API do not provide the feature that you require.
But, in my opinion you should include country/region name in the search query so that it returns correct result. Correct search query (eg. Potsdam, Germany) is the solution here

Mapping service and API

I am building an application that will need to use a mapping service to locate a set of addresses, and include said map with its reporting features. Meaning that it would be beneficial if there was an easy way to convert the map into something printable.
I haven't started designing the application yet, but I will probably write it in Python. I am aware of Google static maps, and it looks promising, especially the method of assigning waypoints (it is exactly what I need), but the map is limited to 640x640, so I was wondering if there are other options that would work well.
Thank you for your input.
You could try and create your own 640x640 tiles, then do some post-cleaning up before stitching them together. Or, generate a kml file of the addresses and use another mapping service?
I know this post is a bit old, but the MapQuest Static Maps Web Service might be worth a look for anyone else who has a similar need. The maximum dimensions of a static map request are 2048X2048, so a bit bigger than 640X640. If you have any questions, check out the forums on the MapQuest Developer Network.

Categories

Resources