4. Quantifying the shade provision of street trees using Google Street View and Building height model.

It is important to assess the shading service provided by street trees. Traditionally, remote sensing data have been widely used to evaluate the amount of urban greenery. However, the two-dimensional cover information cannot fully reflect the shading service of street trees, because the top-down view satellite imagery cannot reflect how the solar radiation reaching the street canyons. Recently, I have developed a method based on Google Street View panorama and building height model to quantify the exact shade provision of street trees in Boston. (Read more)

3. Using Google Street View to Map the openness of street canyons of Boston (Sky View Factor).

City streets are a focal point of human activity in urban centers. Citizens interact with the urban environment through its streetscape and it is imperative to, not only map city streetscapes, but quantify those interactions in terms of human well-being. Researchers now have access to fully digitized representation of streetscapes through Google Street View (GSV), which captures the profile view of streetscapes and, thus, shares equivalent viewing angles with those of the citizen. Here I present how to use Google Street View to quantify and map the openness of street canyons. (Read more)

2. Create Shapefiles using Fiona + Shapely.

The combination of Fiona and shapely provide a great tool for spatial data manipulating. Recently, I realized how convenient it is to use Fiona and Shapely for spatial data manipulation and spatial analysis. Here is a very simple example for creating a new point feature class (shapefile) based on series of longitudes and latitudes. Using Fiona and shapely, you can also do spatial analyses, such as buffer analysis, intersection, etc.

        
from shapely.geometry import Point, mapping
import pandas as pd
import fiona
# prepare the schema and crs of the output shapefile
schema = {
    'geometry': 'Point',
    'properties': {
        'id': 'str: 20',
        'name': 'str: 20',
    }
}
# Using WGS84 projection type
crs = {'init': u'epsg:4326'}
# read the csv file and create shapefile
coffee_shop_csv = 'sample-data/cambridge_coffee_shops.csv'
coffee_shop_sheet = pd.read_csv(coffee_shop_csv)

# The output shapefile
coffee_shop_shp = 'sample-data/cambridge_coffee_shops2.shp' 
with fiona.open(coffee_shop_shp, 'w', driver = "ESRI Shapefile",
    crs = crs, schema=schema) as output:
    for row in coffee_shop_sheet.iterrows():
        lon = row[1][7]
        lat = row[1][6]
        id_ = row[1][0]
        name = row[1][1]
        point = Point(float(lon), float(lat))
        output.write({'properties':{'id': id_,
                                    'name': name
                                    },
                      'geometry': mapping(point)
                     })
          
        

1. Download Google Street View static Images using Python

Google Street View (GSV) images (which have view angles similar to those of pedestrians and open access) for assessing street-level, profile urban greenery. GSV, first introduced in 2007, is a library of video footage captured by cars driven down streets. GSV creates what feels like a seamless (if pixelated) tour of city streets and it can give one the feeling of "being there". It is quite similar to what you or I see exploring a city by car, bike, or foot. GSV images provide an important tool in urban studies. Let see how to download GSV images.

          
import time
import requests
import numpy as np
from PIL import Image
from StringIO import StringIO
import matplotlib.pyplot as plt

key='' # get you key from Google account
URL = r"http://maps.googleapis.com/maps/api/streetview?size=400x400\
      &pano=%s&fov=60&heading=0&pitch=0&sensor=false&key=%s"%(panoid, key)

# let the code to pause by 1s, in order to not go over data limitation of Google quota
time.sleep(1)

# classify the GSV images and calcuate the GVI
response = requests.get(URL)
im = np.array(Image.open(StringIO(response.content)))
plt.imshow(im)