geeViz.googleMapsLib

Google Maps Platform client for geeViz.

Provides functions for ground-truthing and enriching remote sensing analysis using Google Maps Platform APIs:

  • Geocoding — address to coordinates and reverse

  • Places — search, nearby, details, photos

  • Street View — static images, panoramas, AI interpretation

  • Elevation — terrain height at any location

  • Static Maps — basemap images for reports

  • Air Quality — current AQI and pollutants

  • Solar — rooftop solar potential

  • Roads — snap GPS traces to nearest roads

24 public functions:

  • Geocoding: geocode, reverse_geocode, validate_address

  • Places: search_places, search_nearby, get_place_photo

  • Street View: streetview_metadata, streetview_image, streetview_images_cardinal, streetview_panorama, streetview_html

  • AI Analysis: interpret_image, label_streetview, segment_image, segment_streetview

  • Elevation: get_elevation, get_elevations, get_elevation_along_path

  • Environment: get_air_quality, get_solar_insights, get_timezone

  • Maps: get_static_map

  • Roads: snap_to_roads, nearest_roads

Quick start:

import geeViz.googleMapsLib as gm

# Geocode an address
result = gm.geocode("4240 S Olympic Way, Salt Lake City, UT")

# Street View panorama + AI interpretation
pano = gm.streetview_panorama(-111.80, 40.68, fov=360)
analysis = gm.interpret_image(pano)

# Semantic segmentation (SegFormer)
seg = gm.segment_image(pano, model_variant="b4")

# Elevation, air quality, solar
elev = gm.get_elevation(-111.80, 40.68)
aq = gm.get_air_quality(-111.80, 40.68)
solar = gm.get_solar_insights(-111.80, 40.68)

Requires a GOOGLE_MAPS_PLATFORM_API_KEY in your environment or .env file. Gemini AI features use GEMINI_API_KEY.

Copyright 2026 Ian Housman

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Functions

geocode(address)

Geocode an address to coordinates using the Google Geocoding API.

get_air_quality(lon, lat)

Get current air quality conditions at a location.

get_elevation(lon, lat)

Get elevation in meters at a geographic location.

get_elevation_along_path(points[, samples])

Get elevation profile along a path.

get_elevations(points)

Get elevations for multiple locations in one request.

get_place_photo(photo_name[, max_width, ...])

Fetch a place photo by its resource name.

get_solar_insights(lon, lat[, quality])

Get rooftop solar potential for the nearest building.

get_static_map(lon, lat[, zoom, size, ...])

Get a static map image centered on a location.

get_timezone(lon, lat[, timestamp])

Get timezone information for a location.

interpret_image(image_bytes[, prompt, ...])

Interpret a Street View or satellite image using Google Gemini.

label_streetview(lon, lat[, prompt, ...])

Fetch a Street View panorama and label detected objects with bounding boxes.

nearest_roads(lon, lat)

Find the nearest road segments to a point.

reverse_geocode(lon, lat)

Convert coordinates to an address (reverse geocoding).

search_nearby(lat, lon[, radius, ...])

Search for places near a location using Nearby Search (New).

search_places(query[, lat, lon, radius, ...])

Search for places using the Google Places API (New) Text Search.

segment_image(image_bytes[, model_variant, ...])

Perform pixel-level semantic segmentation using SegFormer.

segment_streetview(lon, lat[, heading, fov, ...])

Fetch a Street View panorama and segment it with SegFormer.

snap_to_roads(points[, interpolate])

Snap GPS points to the nearest road segments.

streetview_html(lon, lat[, headings, pitch, ...])

Generate an HTML panel with embedded Street View images.

streetview_image(lon, lat[, heading, pitch, ...])

Fetch a Street View static image as JPEG bytes.

streetview_images_cardinal(lon, lat[, ...])

Fetch Street View images looking N, E, S, and W.

streetview_metadata(lon, lat[, radius, source])

Check if Street View imagery exists at a location.

streetview_panorama(lon, lat[, heading, ...])

Fetch a wide-angle or full 360° Street View panorama as a stitched image.

validate_address(address[, region_code])

Validate and standardize an address.