Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Buildings in space, sun in time

Buildings in space, sun in time

Short talk @ GeoMonday 2

Avatar for Jan Marsch

Jan Marsch

June 21, 2013

Other Decks in Technology

Transcript

  1. OSM Buildings Default mode Sketch mode • Layer for web

    maps • Dynamic perspective • No installation required • Fast, simple, small
  2. Calculation function getSunPosition(date, lat, lon) { var lw = rad*-lon,

    phi = rad*lat, M = getSolarMeanAnomaly(date), C = getEquationOfCenter(M), L = getEclipticLongitude(M, C), D = getDeclination(L, 0), A = getRightAscension(L, 0), t = getSiderealTime(date, lw), H = t-A; return { azimuth: getAzimuth(H, phi, D), altitude: getAltitude(H, phi, D) }; }
  3. Integration var sun = getSunPosition(date, lat, lon); var shadowLen =

    1/tan(sun.altitude); var v = { x: cos(sun.azimuth) * shadowLen, y: sin(sun.azimuth) * shadowLen }; function project(x, y, z) { return { x2: x + v.x * z, y2: y + v.y * z }; }
  4. Optimization • Same vector for all points • No shadows

    on other objects • Rendering layers • Face combining
  5. Links • OSM Buildings osmbuildings.org • Mourner‘s Suncalc github.com/mourner/suncalc •

    Astronomy Answers aa.quae.nl/en/reken/zonpositie.html • GeoNames geonames.org