Skip to content

Commit 7ac7456

Browse files
committed
Added visualization app
1 parent afefb8c commit 7ac7456

File tree

11 files changed

+3544
-0
lines changed

11 files changed

+3544
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.9-slim
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the current directory contents into the container at /app
8+
COPY . /app
9+
10+
# Install any needed packages specified in requirements.txt
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Make port 8080 available to the world outside this container
14+
EXPOSE 8080
15+
16+
# Define environment variable
17+
ENV PORT 8080
18+
19+
# Run app.py when the container launches
20+
CMD ["python", "app.py"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Street View Visualization App
2+
3+
This application provides an interactive visualization of geographic data from the `ga_sample.json` file. It allows users to explore the data in a split-screen view, with a map on one side and a Google Street View panorama on the other.
4+
5+
## Overview
6+
7+
The application is a Flask web server that serves a single-page web application. The frontend is built with HTML, CSS, and JavaScript, and it uses the Google Maps API to display the map and Street View imagery.
8+
9+
The application has the following features:
10+
* **Split-screen view**: A map on the left and a Street View panorama on the right.
11+
* **Data navigation**: "Previous" and "Next" buttons to navigate through the data points.
12+
* **Camera pose controls**: A "Use Camera Pose" toggle to switch between the observation's location and the camera's location. When enabled, individual toggles for "Heading", "Pitch", and "Roll" allow for fine-grained control over the camera's orientation.
13+
* **Photographer POV**: A "Load Photographer POV" toggle to load the location and marker using the `StreetViewPanorama.getPhotographerPov()` method.
14+
* **3D map viewer**: A separate 3D map viewer to display all the data points as pins on a 3D map.
15+
16+
## Deployment
17+
18+
To build and deploy this application, you can use the following `gcloud` command from your terminal, after navigating into the `streetview_visualization_app` directory:
19+
20+
```bash
21+
gcloud run deploy imagery-insights-visualization \
22+
--source=. \
23+
--region=us-central1 \
24+
--platform=managed \
25+
--allow-unauthenticated \
26+
--port=8080 \
27+
--project=imagery-insights-sandbox
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from flask import Flask, render_template, jsonify, send_from_directory
16+
import json
17+
import os
18+
19+
app = Flask(__name__, static_folder='static', template_folder='templates')
20+
app.config['TEMPLATES_AUTO_RELOAD'] = True
21+
22+
@app.route('/')
23+
def index():
24+
return render_template('index.html')
25+
26+
@app.route('/3d_view')
27+
def three_d_view():
28+
return render_template('3d_view.html')
29+
30+
@app.route('/data/<filename>')
31+
def get_data(filename):
32+
return send_from_directory('data', filename)
33+
34+
35+
if __name__ == '__main__':
36+
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))

0 commit comments

Comments
 (0)