How to visualize the year of construction using an overlay

From Tygron Support wiki
Jump to navigation Jump to search
How to visualize the year of construction using an overlay:
  1. Open your project in the editor
  2. Hover over Overlays, Grid Calculation under Add New and select Combo.
  3. With the Combo Overlay selected, select the Input Tab
  4. Make sure Select input is configured with Attribute:Specific Layer and BUILDINGS as its layer.
  5. Click on the select button next to Attribute A and select the attribute named CONSTRUCTION_FINISH_DATE
  6. Select the general tab
  7. Click on the enlarge link above the formula field to open the Edit Formula panel.
  8. Write the following formula: ADD(1970, FLOOR(DIV(@A, MUL(1000, 60, 60, 24, 365.25))))
  9. Close the panel to save the formula.
  10. Click on the Update Now link to calculate the overlay.

Notes

  • The CONSTRUCTION FINISH DATE represents the number of milliseconds after the epoch UTC date 01-01-1970 00:00:00.
  • The formula is an approximation, but will suffice for year of construction for buildings.
  • The multiplication is: number of milliseconds times seconds times minutes times hours times number of days in a year (on average). The multiplication can also be replaced by its resulting value: 31557600000.
  • Instead of flooring the year of construction, you can also round it.
  • To make buildings without a CONSTRUCTION_FINISH_DATE transparent, change the formula to:
    IF(EQ(@A, 0), NO_DATA, ADD(1970, FLOOR(DIV(@A, MUL(1000, 60, 60, 24, 365.25)))))
    The attribute is rarely 0 when set. If necessary, see the image above of the Edit multiple attributes' panel configuration to verify it.

See also