How to obtain google map images "satellite view without labels" using python - 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.

Related

How can I modify a Google Slides presentation's aspect ratio through the Slides API?

I am trying to use the Google Slides API for Python to allow users to add presentations to a project.
The presentations must fit a 4:3 aspect ratio due to display limitations. How can I verify a presentation is in this format?
#authentication...
service = build('slides', 'v1', credentials=creds)
presentation = service.presentations().get(
presentationId=PRESENTATION_ID).execute()
presentation.get(...) #what goes here?
Please be noted that the Slides API might refactor your values:
When you create a page element, you can specify a size and transform
that provide a certain visual result. However, the API may replace
your provided values with other ones that yield the same visual
appearance. In general, if you write a size using the API, you are not
guaranteed to be returned the same size. However, you should get the
same results if you take the transform into account.
However, there's another solution wherein you can use Google Apps Script to modify the page size of your Slides. You can check this SO post for more details.

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

Getting information of a panoram in google street view 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.

Using Django as a map source for openlayer UI

I am thinking of creating a web application that shows a map of a city (from openstreetmaps data). I would like to create a layer on top which represents markers. I foresee that I will have a database of numerous markers, which will be shown on the map as layer. I have come across openstreetmap, openlayers, geodjango etc but am unable to figure out how to make all these fit together to solve my issue. I am comfortable using Django and Python. Can someone help me understand the following:
How to host OSM data on my own server using Django and acting as a Mapserver (or map source) for openlayers?
How to ask openlayer to talk to this server to render the map or overlays?
I'm sorry if some part of my question does not make sense; it is because my understanding how these components is quite hazy at the moment.
Displaying markers at coordinates is the easy part. The harder part is hosting your own base map. Here is one way I think you could do it:
Obtain the OpenStreetMap data for the area you are interested in.
Develop a stylesheet for your map, or use an existing one. Mapnik is an option.
Use Tilecache to serve cached image tiles of the map at various scale levels. This would have to run in addition to your django app.
Another option would be to use Tiledrawer to set up an Amazon EC2 server serving your base map without having to manually configure everything.
Stack Overflow is only letting me post two links, so you will have to search for the websites of Tilecache and Mapnik, but they are easy to find.
References:
https://gis.stackexchange.com/questions/10162/how-to-set-up-an-osm-server-with-tilecache-and-mapnik

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