# source: https://github.com/hadley/elevators

version: 0.1.0

tables:
  elevators:
    description: >
      Registered elevator devices in New York City, as provided by the NYC
      Department of Buildings in response to a September 2015 FOIL request.
      The data was received in November 2015 and covers ~76k devices.
      Includes elevators, escalators, dumbwaiters, and other vertical
      transportation devices.
    source:
      parquet: elevators.parquet
    columns:
      - name: dv_device_number
        type: string
        constraints: [primary_key]
        description: >
          Unique device number assigned by the NYC Department of Buildings.
          Can be used to look up a device on the DOB
          [Building Information Search](http://a810-bisweb.nyc.gov/bisweb/bispi00.jsp)
          (Field 26).
        examples: [1D1, 1P26114, 1P47998, 3P14044, 5T722]

      - name: device_status
        type: enum
        values: {A: active, D: dismantled, H: NYCHA, J: no jurisdiction, W: work in progress}
        constraints: [required]
        description: >
          Single-letter code for the device's registration status.

      - name: bin
        type: number(id)
        description: >
          Building Identification Number, a unique identifier assigned by
          the NYC Department of Buildings to each building. More reliable
          than street address for geolocation.
        examples: [1000003, 1044931, 2018006, 3329429, 5863656]

      - name: tax_block
        type: number(id)
        description: >
          Tax block number within the borough, part of the BBL.
        examples: [1, 1726, 3627, 6356, 16350]

      - name: tax_lot
        type: string
        description: >
          Tax lot number within the block, part of the BBL. Stored as a
          string because some lots have letter suffixes (e.g. `7501T`).
        examples: ["1", "276", "483", "992", "7501T"]

      - name: house_number
        type: string
        description: >
          Street number portion of the filed at address.
        examples: ["1", "55", "200", "521", "72-20"]

      - name: street_name
        type: string
        description: >
          Street name portion of the filed at address.
        examples: [BROADWAY, EAST 28 ST, FOOD CENTER DRIVE, HOWARD AVE, SEVENTH AVENUE]

      - name: zip_code
        type: string
        description: >
          Five-digit ZIP code for the filed at address.
        examples: ["10001", "10302", "11109", "11362", "99999"]

      - name: borough
        type: enum
        values: [Bronx, Brooklyn, Manhattan, Queens, Staten Island]
        description: >
          NYC borough where the device is located. A small number of rows
          have this field blank.

      - name: device_type
        type: enum
        values:
          - Passenger Elevator (P)
          - Freight (F)
          - Escalator (E)
          - Dumbwaiter (D)
          - Sidewalk (S)
          - Private Elevator (T)
          - Handicap Lift (H)
          - Manlift (M)
          - Public Elevator (L)
        description: >
          Type of elevator device.

      - name: dv_lastper_insp_date
        type: date
        range: [1988-08-19, 2015-10-13]
        description: >
          Date of the last periodic inspection by the NYC Department of
          Buildings. May be missing if the device has never been inspected.
          Because the data is from late 2015, these dates may no longer be
          current.

      - name: dv_lastper_insp_disp
        type: enum
        values: {DF: deficiency found, NV: no violation, PI: partial inspection, VF: violation filed}
        description: >
          Disposition code from the last periodic inspection.
          Missing if no inspection on record.

      - name: dv_approval_date
        type: date
        range: [1925-02-24, 2015-10-16]
        description: >
          Date the device was approved. Typically reflects when the device
          was first registered or last had a major approval action.

      - name: dv_manufacturer
        type: string
        description: >
          Name of the device manufacturer as entered by the filer.
          Free-text with many inconsistencies (e.g. `OTIS` and
          `OTIS ELEV CO` are the same company). Over 2,000 unique values.
          Some entries like `HOUSING AUTHORITY` or `PRIVATE RESIDENCE` describe
          ownership rather than manufacturer.
        examples: [OTIS, HOUSING AUTHORITY, PRIVATE RESIDENCE, MRL ELEVATOR, STALEY]

      - name: dv_travel_distance
        type: number(quantity)
        range: [0, 1300]
        description: >
          Vertical travel distance of the device in feet. Often omitted
          (~62% missing). Parsed from highly inconsistent raw strings.
          See travel-distance.qmd for details.

      - name: dv_speed_fpm
        type: number(quantity)
        range: [0, 1800]
        description: >
          Speed of the device in feet per minute. Common values include
          50, 100, 200, 350. Converted from string by extracting leading
          numeric values (e.g. `95UP` -> 95). 16 unparseable entries
          (e.g. `----`, `VAR`, `EX`) were set to missing.

      - name: dv_capacity_lbs
        type: number(quantity)
        range: [0, 20000]
        description: >
          Weight capacity of the device in pounds. Common values include
          2500, 3000, 3500 for passenger elevators. Converted from string
          by fixing `O`/`o` -> `0`, removing commas, and extracting leading
          numeric values. 6 unparseable entries (e.g. `ESC`, `NIUD`) were
          set to missing.

      - name: dv_car_buffer_type
        type: enum
        values: {S: spring, O: oil}
        description: >
          Type of car buffer. Often missing, particularly for non-elevator
          devices.

      - name: dv_governor_type
        type: enum
        values: {C: centrifugal, F: fly-ball, N: none}
        description: >
          Type of speed governor. Often missing for non-elevator devices.

      - name: dv_machine_type
        type: enum
        values: {OG: overhead geared, GL: gearless, OH: overhead, BG: basement geared, BD: basement drum, O: other, T: traction}
        description: >
          Type of hoisting machine. Missing for some devices.

      - name: dv_safety_type
        type: enum
        values: {I: instantaneous, F: flexible guide clamp, G: governor-operated}
        description: >
          Type of safety device. Missing for roughly half of all devices.

      - name: dv_mode_operation
        type: enum
        values: {A: automatic, P: push button, E: escalator, C: car-switch, D: dumbwaiter, S: signal control, H: handicap}
        description: >
          Mode of operation. Missing for some devices.

      - name: dv_status_date
        type: date
        range: [1940-07-18, 2015-10-17]
        description: >
          Date when the device status was last updated.

      - name: dv_floor_from
        type: string
        description: >
          Lowest floor served by the device. May be an integer (`1`), a
          standard letter code (`B` basement, `C` cellar, `L` lobby,
          `G` ground, `M` mezzanine, `SB` sub-basement, `SC`
          sub-cellar), or a comma-separated pair indicating two lobby
          entry levels (e.g. `B,1`). See floor.qmd for details.
        examples: [B, "1", C, SB, "B,1"]

      - name: dv_floor_to
        type: string
        description: >
          Highest floor served by the device. Uses the same notation as
          `dv_floor_from`. Common letter codes include `PH` (penthouse),
          `R` (roof), `T` (top), and `ST` (street). Subject to the same
          cleaning as `dv_floor_from`.
        examples: ["6", "12", PH, R, ST]

      - name: latitude
        type: number(quantity)
        range: [40.5, 40.9]
        description: >
          Approximate latitude of the device's building, obtained by
          geocoding the BIN, Borough-Block-Lot, or street address via
          the NYC Geoclient API. Not authoritative; some values may be
          in error.

      - name: longitude
        type: number(quantity)
        range: [-74.3, -73.7]
        description: >
          Approximate longitude of the device's building, obtained by
          geocoding. Not authoritative; some values may be in error.

glossary:
  BIN: >
    Building Identification Number. A unique numeric identifier assigned
    to each building by the NYC Department of Buildings.
  BBL: >
    Borough-Block-Lot. A three-part identifier (borough code, tax block,
    tax lot) used by NYC to uniquely identify a parcel of land for
    property tax purposes.
  DOB: >
    New York City Department of Buildings. The agency responsible for
    ensuring the safe and lawful use of buildings and properties.
  NYCHA: >
    New York City Housing Authority. The public housing authority for NYC,
    which manages its own elevator inspection program.
  periodic inspection: >
    A required inspection of elevator devices conducted by the NYC
    Department of Buildings on a regular cycle (typically annual or
    biennial depending on device type).
  manlift: >
    A continuous-loop conveyor with platforms or steps used to transport
    people between floors. Largely obsolete and rarely installed new.
  sidewalk elevator: >
    A freight elevator that opens at sidewalk level, used to move goods
    between the sidewalk and a building's basement or cellar.
  gearless traction: >
    An elevator machine type where the motor directly drives the sheave
    without a gearbox. Used in high-rise buildings for high speeds and
    smooth operation.
  governor: >
    A speed-limiting safety device on an elevator. If the car exceeds a
    set speed, the governor triggers the safety mechanism to stop the car.
  filed at: >
    The address where the elevator application or paperwork was filed with
    the Department of Buildings. This may differ from the actual physical
    location of the device. The BIN or Borough-Block-Lot is generally
    more reliable for geolocation.
  car buffer: >
    A shock-absorbing device at the bottom of the elevator shaft that
    cushions the car in the event of an overrun. Spring buffers are used
    for lower speeds; oil buffers for higher speeds.
