Forum

Author Topic: Error 403 using google maps as basemap  (Read 1284 times)

PolarNick

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Error 403 using google maps as basemap
« on: June 07, 2023, 01:24:58 PM »
Hi, I wanted to use google satellite maps as basemap instead of the default one and found these two tutorials:

1) https://agisoft.freshdesk.com/support/solutions/articles/31000169660-configure-custom-basemap
2) https://www.youtube.com/watch?v=-WYJ1cdtmDI

I followed the first one using URL from the youtube video:
Code: [Select]
http://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
and everything was working fine, but sometimes google maps basemap isn't shown and there is a error in console:

Code: [Select]
Error: Error transferring http://mt1.google.com/vt/lyrs=s&x=1&y=1&z=1 - server replied: Forbidden (status code: 403)
But if I open this link in browser - image of small basemap tile opens.

How can I fix this?

PolarNick

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #1 on: June 07, 2023, 01:28:34 PM »
Problem solved, it is enough to open dialog Add Basemap (or Edit Basemap) like in tutorial https://agisoft.freshdesk.com/support/solutions/articles/31000169660-configure-custom-basemap

And in section HTTP Headers add line with Name = User-Agent and Value = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

PolarNick

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #2 on: June 07, 2023, 01:33:29 PM »
Also basemap became a bit more detailed if in Edit Basemap specify bigger Max zoom value - for example 21 (instead of 18)

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #3 on: June 07, 2023, 02:12:44 PM »
Hello PolarNick,

I tried your recipe and got error 400 from server when loading the Google stellite data as in following...

Any idea why^?
Best Regards,
Paul Pelletier,
Surveyor

PolarNick

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #4 on: June 07, 2023, 02:14:32 PM »
Hi Paulo,

try to change User-Agent field to Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #5 on: June 07, 2023, 02:28:14 PM »
PolarNick,

changed User-Agent and still got bad request error 400. Using Windows 10 as OS and Chrome Explorer....
« Last Edit: June 07, 2023, 02:57:41 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #6 on: June 07, 2023, 03:26:18 PM »
Looks strange. Same example works on my side both with and without additional HTTP header.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Error 403 using google maps as basemap
« Reply #7 on: June 07, 2023, 04:24:58 PM »
Looks strange. Same example works on my side both with and without additional HTTP header.
Removing HTTP Header did the trick for me.

Thanks a lot,
Best Regards,
Paul Pelletier,
Surveyor