This project helps you publish and view Google StreetView photosphere/360 photos onto Google Maps using the StreetView API.
Unlike the Google Maps app (RIP StreetView App), publishing photospheres without an associated listing is possible, and if you do choose a listing, it won't snap the blue dot to that location.
Features include:
- Local web server presenting a web GUI to interact with the API
- Publish photosphere photos to Google Maps
- Verify if a photo contains valid XMP photosphere metadata
- Optionally add a Listing/PlaceID to a 360 photo whilst maintaining blue dot GPS position
- View all your photospheres, showing their viewcount, publish and capture dates, and place names
- Edit existing 360 photos by changing their location and placeID
- Delete your 360 photos
You will need to (full insructions below):
- Run this Python script within a venv environment on your local machine
- Create a Google Cloud Developer Project
- Create an API Key and OAuth 2.0 Client ID
- Add a credit card within your Google Cloud Developer project for API billing. (I don't think you will be changed because interacting with your own photos doesn't cost anything, and Google lets you spend up to $200 for free a month anyway. Don't hold me to this though!)
You can set up your Google Developer environment with a different Google account to what you use for publishing photospheres.
I wrote this whole project with ChatGPT's assistance! I'm a techie but not a programmer, so chatGPT helped me write all the python, HTML, and javascript code from scratch. This wouldn't have been possible without it!
Before you start, you should have Homebrew installed on your macOS. If it's not installed, open a terminal window and paste the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Open Terminal: You can open a Terminal window from Applications > Utilities > Terminal.
- Update Homebrew: Before you install anything with Homebrew, you should always update it to get the latest packages. You can do this with the command:
brew update
- Install Python: After updating Homebrew, you can install Python with the command:
brew install python
- Verify Installation: To check that Python was installed correctly, you can use the command:
python3 --version
- Install Git: You can install Git with the command:
brew install git
- Verify Installation: To check that Git was installed correctly, you can use the command:
git --version
Remember to periodically update Homebrew and the packages installed through it with the command:brew update && brew upgrade
- Open your Terminal
- Navigate to Your Project Directory: Use the
cd
command to navigate to the directory where you want to create the virtual environment. The default location of your home folder will be fine. - Clone the repository:
git clone https://github.com/jarrah31/Google-StreetView-Publish-WebGUI.git
- Navigate to the project directory:
cd Google-StreetView-Publish-WebGUI
To update the code with a new version, simply run "git pull" from within the Google-StreetView-Publish-WebGUI folder.
- Open your terminal
- Navigate to the project directory:
cd ~/Google-StreetView-Publish-WebGUI
- Check your Python version:
python3 --version
This command should return Python 3.5 or higher. If not, you'll need to install a more recent version of Python. - Create a virtual environment:
python3 -m venv streetview
- Activate Virtual Environment: To start using the virtual environment, you need to activate it. In the command prompt, type
source streetview/bin/activate
. Your command prompt should now show(streetview)
at the beginning of the line, indicating that the virtual environment is active. - Install Required Python Libraries:
pip install requests google-auth-oauthlib Flask google-auth
Remember to always activate the virtual environment whenever you're running this app. When you're done, you can leave the virtual environment with the deactivate
command.
-
Download Python Installer: Go to the official Python website here. Click on the link for the latest Python version.
-
Run Installer: Once the installer is downloaded, run it.
-
Choose Install Options: On the first page of the installer, check the box that says
Add Python.exe to PATH
, then click onInstall Now
. -
Wait for Installation to Complete: The installer will display a progress bar. Once it's finished, click
Close
. -
Verify Installation: Open a new command prompt (press
Win + R
, typecmd
, then pressEnter
). In the command prompt, typepython --version
. If Python is installed correctly, this command should print the Python version number.
-
Download Git Installer: Go to the official Git website here and select
Click here to download
. -
Run Installer: Once the installer is downloaded, run it.
-
Choose Install Options: You can leave the defaults checked for most of the installation, except for
Choosing the default editor for git
. Instead, select your preferred editor from the drop-down list. -
Wait for Installation to Complete: The installer will display a progress bar. Once it's finished, click
Finish
. -
Verify Installation: From the Start menu, select
Git
->Git Cmd
. In the command prompt, typegit --version
. If Git is installed correctly, this command should print the Git version number.
-
Open Git Cmd: From the Start menu, select
Git
->Git Cmd
. -
Navigate to Your Project Directory: Use the
cd
command to navigate to the directory where you want to create the virtual environment. The default location of your home folder will be fine. -
Git Clone the Project: Run this command:
git clone https://github.com/jarrah31/Google-StreetView-Publish-WebGUI.git
-
Navigate to the Git Repository folder:
cd Google-StreetView-Publish-WebGUI
-
Create Virtual Environment: Type
python -m venv streetview
. This creates a new virtual environment in a directory calledstreetview
. -
Activate Virtual Environment: To start using the virtual environment, you need to activate it. In the command prompt, type
.\streetview\Scripts\activate
. Your command prompt should now show(streetview)
at the beginning of the line, indicating that the virtual environment is active. -
Install Packages: You can now install Python packages that will only be available in this virtual environment.
pip install requests google-auth-oauthlib Flask google-auth
-
Deactivate Virtual Environment: When you're done working in the virtual environment, you can deactivate it by typing
deactivate
in the command prompt. This returns you to your regular system Python environment.
-
Visit the Google Cloud Console.
-
Click on "Create or select a project" below Welcome, then click on "New Project".
-
In the New Project window, enter a project name (like "StreetView") and optionally select a location for the project. Click "Create".
-
After the project is created, click "SELECT PROJECT".
-
In your project dashboard, hover over "APIs and Services" in the left-hand menu bar and click on "Enabled APIs and Services". If you can't see the menu bar, press the hamburger icon top-left (three horizontal lines) which is named the Navigation Menu.
-
Click the blue "+ ENABLE APIS AND SERVICES" link from the bar along the top.
-
Search for "Street View Publish API" and enable it.
-
Go back to the API library and enable "Places API" as well (not the "new" one though).
-
At this point you may need to go through a 2-step process to verify your account with a credit card and address details. It says that you won't be charged until you manually upgrade to a paid account. Once done, click "Start my free trial".
-
After filling in a short survey, you will be given your API key. Copy this somewhere safe.
-
Untick the "Enable all Google Maps APIs for this project", and leave the "Create budget alerts" option enabled. Next click "Go to Google Maps Platform"
-
Navigate to the Credentials page by clicking the Navigation (hamburger) menu -> APIs and Services -> Enabled APIs and Services -> Crendentials
-
Click on "+ CREATE CREDENTIALS" from the top bar and select "OAuth client ID".
-
To create OAuth client ID, you need to configure the OAuth consent screen. Click on "CONFIGURE CONSENT SCREEN".
-
On the Consent screen, select "External" and click "Create".
-
Fill out the necessary details like App name (e.g. StreetViewApp), User support email (your gmail account), Developer contact information (just the mandatory fields). Click "Save and Continue".
-
In the (2)Scopes section, click on "Save and Continue".
-
In the (3)Test Users section, if you use another Google account for publishing 360 photos, enter that account's email address by pressing "+ Add Users". Click "Save and Continue" when done.
-
On the Summary page, click "Back to Dashboard".
-
Go back to "Credentials", click on "+ CREATE CREDENTIALS", select "OAuth client ID".
-
Select "Web application" as the Application type and give it a name such as "StreetViewOAuth"
-
Within "Authorized redirect URIs" click "+ADD URI" and paste in "http://127.0.0.1:5000/oauth2callback" (without the quotes)
-
Click "Create"
-
Your client ID and client secret will be created and shown to you. Note these down as you will need them for the project. Once done, press Ok.
Now your Google Cloud Developer Project is set up with an API Key and OAuth 2.0 Client IDs, and you have a billing account for API usage.
(for Windows, activate venv as described in the Windows instructions, and use notepad to edit the json files)
-
Navigate to Your Project Directory:
cd Google-StreetView-Publish-WebGUI
-
Create a new file called "client_secrets.json": (same place where app.py is located)
macOS:
nano client_secrets.json
Windows: Create a new text file using notepad.
Caution on Windows If you create a text file on Windows via File Explorer, it may actually be called
client_secrets.json.txt
even if it displaysclient_secrets.json
. To check, find the option to show filename extensions, and correct if necessary. -
Paste in the json below and replace the following text within the quotes (keeping the quotes)
YOUR_OAUTH_CLIENT ID YOUR_OAUTH_CLIENT_SECRET YOUR_API_KEY
{ "web": { "client_id": "YOUR_OAUTH_CLIENT ID", "client_secret": "YOUR_OAUTH_CLIENT_SECRET", "api_key": "YOUR_API_KEY", "redirect_uris": "http://127.0.0.1:5000/oauth2callback", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token" } }
-
Create a new file called "config.json" and paste in the following:
{ "SECRET_KEY": "REPLACE_THIS_WITH_RANDOM_LETTERS" }
-
Navigate to Your Project Directory:
cd Google-StreetView-Publish-WebGUI
-
Start venv:
macOS:
source streetview/bin/activate
Windows:
.\streetview\Scripts\activate
-
Start the app:
python app.py
-
This should start the Flask web server and will look like this:
* Serving Flask app 'app' * Debug mode: on WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:5000 Press CTRL+C to quit * Restarting with stat * Debugger is active! * Debugger PIN: 200-769-643
-
In your browser, navigate to:
http://127.0.0.1:5000
. You should see now see the icons! -
Click "View Photos". You will be redirected to "Sign in with Google"
-
Select or sign into the account you use for publishing StreetView 360 photos
-
Click "Continue" if it says Google hasn't verified this app.
-
Click "Continue" to allow access to the StreetViewApp
-
You should now be authenticated!