14

How can I extract a satellite image from google maps given a Lat Long Rectangle? (or, two (lat,long) points that form a bounding box).

Kara
  • 6,115
  • 16
  • 50
  • 57
Vanush Vee
  • 426
  • 1
  • 3
  • 14

4 Answers4

12

Your question sounds to me like you want to extract the raw satellite tiles used on Google Maps. That's against the Terms of Use and if you insist in doing I'm pretty sure you'll get blocked out of the service, so... don't ;)

Instead, use the Static Maps API as Mano points out. If you don't want to compute the values from the center and zoom parameters, you can use the visible parameter like this:

http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=640x400&maptype=satellite&visible=29.64,-13.09&visible=27.38,-18.53&markers=color:red%7Ccolor:red%7Clabel:A%7C27.38,-18.53&markers=color:red%7Ccolor:red%7Clabel:B%7C29.64,-13.09

Bear in mind the visible parameter (of which you can provide more than two values) does not guarantee that the corners of the map will be on any of them. They will be visible, which often means the map will include some area around them, in addition to the area among them. Here's is the image:

Example with markers

miguev
  • 4,481
  • 21
  • 41
11

How to use Google maps static API to extract a Terrain(Satellite), Road,...etc map?

  1. You need a google account & an API_KEY to use the google maps static API

  2. Login to your google account

  3. After login open another tab and browse the google developer console. https://console.developers.google.com

  4. Create or use an existing API key

    4.1 Once you are in the console dashboard, navigate to “Enable APIs and get credentials like keys”

    4.2 In the API manager tab, select Credentials

    4.3 Once you are in the Credentials menu, select “Add credentials” and select API key in the drop down

    4.4 In the next menu select key type as Browser

    4.5 Provide a name to your key and click create.

    4.6 Copy the key value and use it in all request to google maps API

  5. Go to Google maps static API for google developers documentation.

    https://developers.google.com/maps/documentation/static-maps/intro?hl=en

    This documentation explains everything you need to know about the maps API

  6. The Google Maps API is a web service that we can call by using a URL shown in the following example. Use the URL with your API_KEY to get the map of New York city

  7. To find the parameters like “center” for your preferred location

G 1
  • 643
  • 7
  • 18
4

try with:

URL

https://maps.googleapis.com/maps/api/staticmap?center=17.053828,+-96.700116&zoom=17&scale=1&size=600x300&maptype=satellite&format=png&visual_refresh=true

Result

enter image description here

you can change lat, lng params in your app =).

Add your key API.

https://maps.googleapis.com/maps/api/staticmap?center=17.053828,+-96.700116&zoom=17&scale=1&size=600x300&maptype=satellite&format=png&visual_refresh=true&key=YOUR_KEY_API

Links:

fitorec
  • 4,257
  • 2
  • 24
  • 18
4

You can use the Google Static Maps API. You just need one Lat Long pair for the center and set the zoom and size of image. It's one URL that you can place in your web page.

Mano Marks
  • 8,761
  • 3
  • 27
  • 28