HeavyRF Table Functions

Summary of parameters for base and optional versions

The HeavyRF package provides the following system table functions:

tf_rf_prop_max_signal (Directional Antennas and Terrain Attenuation)

Taking a set of point elevations and a set of signal source locations as input, tf_rf_prop_max_signal executes line-of-sight 2.5D RF signal propagation from the provided sources over a binned 2.5D elevation grid derived from the provided terarin locations, calculating the max signal in dBm at each grid cell, using the formula for free-space power loss. The terrain should contain columns for ground elevation, terrain elevation (which should be greater than or equal to the ground elevation height), and terrain attenuation in dbm per meter, specifying the degree to which signal will be attenuated if it passes between the terrain and ground elevations (i.e. through a tree or building). The RF source ID contributing the strongest signal is also outputted.

When geographic_coords is set to true, x and y input coordinates are assumed to be lon/lat degrees. A best-fit conversion to a meters coordinate system is executed using the change in meters per lon/lat degree at the centroid of the input terrain, using the haversine distance formula. For convenience and optimal performance, tf_rf_prop_max_signal enables filter push-down by default, such that filters on the outputs rf_source_id, x, y, and elevation_amsl_meters are pushed down to the respective inputs in the rf_sources and terrain_elevations Cursor subqueries.

SELECT * FROM TABLE(
   tf_rf_prop_max_signal(
      rf_sources => CURSOR(
         SELECT 
            rf_source_id,
            rf_source_x,
            rf_source_y, 
            rf_source_z,
            rf_source_signal_strength_watts,
            rf_source_signal_frequency_mhz,
            rf_source_antenna_azimuth_degrees,
            rf_source_antenna_downtilt_degrees,
            rf_source_antenna_type
         FROM
            rf_sources_table
      ),
      terrain_elevations => CURSOR(
         SELECT
             x,
             y,
             ground_elevation_amsl_meters,
             terrain_elevation_amsl_meters,
             terrain_attenuation_dbm_per_meter 
          FROM
             terrain_table
      ),
      antenna_patterns => CURSOR(
         SELECT
             antenna_type,
             antenna_gain,
             antenna_horizontal_degrees,
             antenna_horizontal_attenuation,
             antenna_vertical_degrees,
             antenna_vertical_attenuation
          FROM
             antennas_table
      ),
      rf_source_z_is_relative_to_terrain => <rf_source_is_relative_to_terrain>, 
      geographic_coords => <geographic_coords>,
      bin_dim_meters => <bin_dim_meters>, 
      assumed_receiver_height_agl => <assumed_receiver_height_agl>,
      max_ray_travel_meters => <max_ray_travel_meters>, 
      initial_rays_per_source => <initial_rays_per_source>,
      rays_per_bin_autosplit_threshold => <rays_per_bin_autosplit_threshold>,
      min_receiver_signal_strength_dbm => <min_receiver_signal_strength_dbm>,
      default_source_height_agl_meters => <default_source_height_agl_meters>,
      ray_step_bin_multiple => <ray_step_bin_multiple>,
      loop_grain_size => <loop_grain_size>, 
   )
)

Input Arguments

Output Columns

Example

SELECT
  rf_source_id,
  ST_X(
    ST_TRANSFORM(
      ST_SETSRID(
        ST_POINT(x, y),
        32610
      ),
      4326
    )
  ) as lon,
  ST_Y(
    ST_TRANSFORM(
      ST_SETSRID(
        ST_POINT(x, y),
        32610
      ),
      4326
    )
  ) as lat,
  CAST(
    CASE
      WHEN max_rf_signal_strength_dbm IS NULL THEN -130.0
      ELSE max_rf_signal_strength_dbm
    END AS FLOAT
  ) AS rf_signal_strength_dbm
FROM
  TABLE(
    tf_rf_prop_max_signal(
      rf_sources => CURSOR (
        SELECT
          id,
          x,
          y,
          z,
          power_watts,
          freq_mhz,
          antenna_azimuth,
          antenna_downtilt,
          antenna_type
        FROM
          seattle_rf_sources
      ),
      terrain_elevations => CURSOR (
        SELECT
          CAST(x_utm AS FLOAT) AS x,
          CAST(y_utm AS FLOAT) AS y,
          CAST(z + 0.0001 AS float) AS elevation
        FROM
          seattle_expanded_lidar_tiled
      ),
      antenna_patterns => CURSOR (
        SELECT
          antenna_type,
          antenna_gain,
          antenna_horizontal_degrees,
          antenna_horizontal_attenuations,
          antenna_vertical_degrees,
          antenna_vertical_attenuations
        FROM
          seattle_antenna_types
      ),
      rf_source_z_is_relative_to_terrain => FALSE,
      geographic_coords => FALSE,
      bin_dim_meters => 2.0,
      assumed_receiver_height_agl => 2.0,
      max_ray_travel_meters => 2500,
      initial_rays_per_source => 64,
      rays_per_bin_autosplit_threshold => 1.5,
      min_receiver_signal_strength_dbm => -130.0,
      default_source_height_agl_meters => 20.0,
      ray_step_bin_multiple => 1.0,
      loop_grain_size => 8
    )
  )

tf_rf_prop_max_signal (Isotropic Antennas)

SELECT * FROM TABLE(
   tf_rf_prop(
      rf_sources => CURSOR(
         SELECT 
            rf_source_id, x, y, z_meters
      ),
      rf_source_z_is_relative_to_terrain, 
      rf_source_signal_strength_dbm, 
      rf_source_signal_frequency_mhz   
      terrain => CURSOR(
         SELECT 
            x, y, elevation_amsl_meters
      ),
      geographic_coords,
      bin_dim_meters, 
      max_ray_travel_meters, 
      num_rays_per_source, 
      min_receiver_signal_strength_dbm,
      default_source_height_agl_meters,
      ray_step_bin_multiple,
      loop_grain_size
   )
)

Taking a set of point elevations and a set of signal source locations as input, tf_rf_prop_max_signal executes line-of-sight 2.5D RF signal propagation from the provided sources over a binned 2.5D elevation grid derived from the provided point locations, calculating the max signal in dBm at each grid cell, using the formula for free-space power loss. The RF source ID contributing the strongest signal is also outputted.

For the short version, where geographic_coords defaults to true, or for the long version where geographic_coords is explicitly set to true, x and y input coordinates are assumed to be lon/lat degrees. A best-fit conversion to a meters coordinate system is executed using the change in meters per lon/lat degree at the centroid of the input terrain, using the haversine distance formula. For convenience and optimal performance, tf_rf_prop_max_signal enables filter push-down by default, such that filters on the outputs rf_source_id, x, y, and elevation_amsl_meters are pushed down to the respective inputs in the rf_sources and terrain_elevations cursor subqueries.

Input Arguments

Outputs

A table of grid cells of width and height bin_dim_meters along with the maximum signal strength from any one repeater at that cell, and the ID of the repeater with the strongest signal.

tf_rf_prop

Used for generating top-k signals where 'k' represents the maximum number of antennas to consider at each geographic location. The full relevant parameter name is strongest_k_sources_per_terrain_bin. For example, if k is set to 3, the function will return up to three overlapping antenna signals based on their strength. In that case, if only 2 signals are present, they will be returned. and if 5 signals are actually present, only the strongest 3 will be recorded.

This version of the RF function can be used in optimizing antenna placements use cases or to minimize interference. For example, you might simulate repeater antenna placements on every lampost across an area, but then only plan to keep the top-performing ones. By allowing overlaps in the initial simulation, you avoid introducing coverage gaps when dropping out antennas, while also avoiding the requirement of multiple simulations.

SELECT * FROM TABLE(
   tf_rf_prop(
      data => CURSOR(
         SELECT 
            rf_source_id, x, y, repeater_height_meters
      ),
      rf_source_z_is_relative_to_terrain, 
      rf_source_signal_strength_dbm, 
      rf_source_signal_frequency_mhz   
      data => CURSOR(
         SELECT 
            x, y, elevation_amsl_meters
      ),
      bin_dim_meters, 
      strongest_k_sources_per_terrain_bin
      max_ray_travel_meters, 
      num_rays_per_source, 
      min_receiver_signal_strength_dbm
      default_source_height_agl_meters
      ray_step_bin_multiple
      loop_grain_size
   )
)

Input Arguments

Outputs

A table of grid cells of width and height bin_dim_meters along with the maximum signal strength from any one repeater at that cell, and the ID of the repeater with the strongest signal.

Last updated