Projects
/ project/Geospatial Tool

Solar Rooftop Calculator

Rooftop solar and home-energy estimator using satellite mapping, NASA POWER data, local tariffs, and scenario modeling.

Status
Selected project
Type
Geospatial Tool
Link
Open Watt If

2026 update: Watt If

I revisited the original calculator as Watt If, a more complete and location-flexible home-energy checkup. It keeps the roof-tracing and solar-resource foundation while adding local tariffs and equipment prices, bill-driven system sizing, adjustable roof direction and shading, monthly energy-flow estimates, backup-battery scenarios, and a ten-year payback comparison.

Watt If guided rooftop search, tracing, and electricity-bill setup

The shared example uses a San Francisco home and a $150 monthly bill to show the recommendation, energy and bill offsets, estimated installation cost, savings, and payback period.

Watt If energy offset, monthly savings, installation cost, and payback results

The idea

Estimate the solar potential of a specific rooftop instead of asking somebody to reason from a rough address or property description.

Solar calculator map, selected roof, and AI assistant context

How it works

Users draw a rooftop polygon on satellite imagery. The app calculates area, fetches location-specific solar radiation data from NASA POWER, applies pvlib models, and estimates annual energy production and financial savings.

Short loop of selecting a rooftop and generating the estimate

What it combines

  • Mapbox satellite imagery and polygon drawing
  • Geospatial area calculations with Turf.js
  • NASA POWER irradiance data
  • Solar modeling with pvlib
  • A Python and Flask backend with cached calculations

The main calculation converts hourly irradiance into plane-of-array estimates, then applies panel efficiency, system-loss, and usable-roof assumptions. Results are cached by rounded coordinates and year so nearby repeat calculations do not keep hitting the upstream API.

Implementation detail

The backend keeps the API small: the browser sends GeoJSON and measured area, the server finds the polygon centroid, calls the solar model for that coordinate, and scales the result by usable roof area.

centroid = shape(geometry).centroid
area_m2 = float(data["area"])

kwh_per_m2, pkr_per_m2 = power_hourly(centroid.y, centroid.x)

total_kwh = round(kwh_per_m2 * area_m2, 1)
total_pkr = round(pkr_per_m2 * area_m2)

Graceful fallback

If the upstream irradiance request or the full model fails, the app falls back to a simpler latitude-based estimate instead of leaving the user without a result.

Installer assistant

The prototype also passes available roof area, location, and savings context into an installer-recommendation assistant. It can query a small local knowledge base for region-aware recommendations and market information without asking the user to repeat details already captured by the map.

The project is specific to Pakistan, where a practical estimate in local currency is more useful than a generic solar calculator.