CAMA Land Dimension (Units) Computation
Overview
The purpose of the Land dimension compute is to update the table PC_LEGAL_INFO with the total land dimension information (from all land records) whenever a MA_LAND record is created or modified.
This compute is always the FIRST one called after a save and is always executed immediately from the client PC even if the daemon option is turned on.
Parameters
Registry and Constant
- USE_METRIC = system_registry (“General”, “use metric”) = (‘yes’ or ‘no’)
- FULL_SCALE_FORMAT = “Mass Appraisal”, “Land SF to Acres Full Precision” = (‘yes’ or ‘no’)
- SF_IN_ACRE = 43560 ‘ number of square feet in 1 acre
- SM_IN_ACRE = 4046. 85642 ‘ number of square meter in 1 acre
- FEET_IN_METER = 3.2808399 ‘ number of feet in 1 meter
Table Used
MA_LAND
- MA_LAND. LUSE_CODE -> MA_PARM_LANDUSE.LUSE_CODE
- MA_LAND.P_ID -> PC_LEGAL_INFO.P_ID
- MA_LAND.P_ID -> PC_PARCEL.P_ID (Only if the jurisdiction is part of the MA_PARM index)
- MA_LAND.P_ID -> PC_AREA.P_ID (Only if the neighborhood or commercial neighborhood is part of the MA_PARM index)
Compute Logic
Updates only occur when the columns use to compute the land dimensions have been modified by a user.
When this occurs the following logic is applied for ALL land records associated with a given P_ID in order to replace the existing information in PC_LEGAL_INFO.
Because land calculations can be based on the total dimension information, we need to make sure the MA_LAND.MODIF_STAMP is reset to NULL for all records associated with a given P_ID when update to PC_LEGAL_INFO are made.
The update logic is applied if one of the following situations is TRUE:
1) MA_PARM_LANDUSE.Agricultural = 0 (or NULL) AND MA_LAND.exclude_lot_size = 0 (or NULL) AND ( MA_LAND. lot_size or MA_LAND. lot_units_type ) has changed.
2) MA_PARM_LANDUSE.Agricultural = 0 (or NULL) AND MA_LAND. exclude_frontage = 0 (or NULL) AND (MA_LAND. Frontage or MA_LAND. lot_units_type ) has changed.
3) MA_PARM_LANDUSE.Agricultural = 0 (or NULL) AND MA_LAND. exclude_depth= 0 (or NULL) AND (MA_LAND. Depth or MA_LAND. lot_units_type) has changed.
If one of the above case is true, we perform this for each MA_LAND record.
We are updating up to 9 columns in PC_LEGAL_INFO. If no PC_LEGAL_INFO record exists for the combination P_ID, YEAR_ID and FROZEN_ID then a new record is created.
- PC_LEGAL_INFO.front_size
- PC_LEGAL_INFO.depth_size
- PC_LEGAL_INFO.front_size_unit
- PC_LEGAL_INFO.size_1
- PC_LEGAL_INFO.size_1_unit
- PC_LEGAL_INFO.size_2
- PC_LEGAL_INFO.size_2_unit
- PC_LEGAL_INFO.size_t
- PC_LEGAL_INFO.size_t_unit
USE_METRIC = “yes”
PC_LEGAL_INFO.front_size (2 decimals) =
sum of MA_LAND.frontage where MA_LAND. exclude_frontage = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘sm’ or MA_LAND.lot_units_type = ‘h’)
+
sum of ( MA_LAND.frontage / FEET_IN_METER) where MA_LAND. exclude_frontage = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘a’ or MA_LAND.lot_units_type = ‘sf’)
PC_LEGAL_INFO.depth_size (2 decimals) =
sum of MA_LAND.depth where MA_LAND. exclude_depth= 0 (or NULL) and ( MA_LAND.lot_units_type = ‘sm’ or MA_LAND.lot_units_type = ‘h’)
+
sum of ( MA_LAND. depth / FEET_IN_METER) where MA_LAND exclude_depth = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘a’ or MA_LAND.lot_units_type = ‘sf’)
If at least one value is calculated for front_size or depth_size then PC_LEGAL_INFO.front_size_unit = ‘m’
PC_LEGAL_INFO.size_1 (2 decimals) =
sum of MA_LAND.lot_size where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘sm’
+
sum of ( MA_LAND.lot_size X 10000 ) where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘h’
+
sum of ( MA_LAND.lot_size X SM_IN_ACRE ) where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘a’
+
sum of ( MA_LAND.lot_size / (FEET_IN_METER * FEET_IN_METER) ) where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘sf’
PC_LEGAL_INFO.size_2 = NULL
PC_LEGAL_INFO.size_t = PC_LEGAL_INFO.size_1
If at least one value is calculated for size_1 then PC_LEGAL_INFO.size_1_unit = ‘sm’ and PC_LEGAL_INFO.size_t_unit = ‘sm’
USE_METRIC = “no”
PC_LEGAL_INFO.front_size (2 decimals) =
sum of MA_LAND.frontage where MA_LAND. exclude_frontage = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘a’ or MA_LAND.lot_units_type = ‘sf’)
+
sum of ( MA_LAND.frontage X FEET_IN_METER) where MA_LAND. exclude_frontage = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘sm’ or MA_LAND.lot_units_type = ‘h’)
PC_LEGAL_INFO.depth_size (2 decimals) =
sum of MA_LAND.depth where MA_LAND. exclude_depth= 0 (or NULL) and ( MA_LAND.lot_units_type = ‘a’ or MA_LAND.lot_units_type = ‘sf’)
+
sum of ( MA_LAND. depth X FEET_IN_METER) where MA_LAND exclude_depth = 0 (or NULL) and ( MA_LAND.lot_units_type = ‘sm’ or MA_LAND.lot_units_type = ‘h’)
If at least one value is calculated for front_size or depth_size then PC_LEGAL_INFO.front_size_unit = ‘sf’
PC_LEGAL_INFO.size_1 (2 decimals)
sum of MA_LAND.lot_size where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘sf’
+
sum of ( MA_LAND.lot_size X FEET_IN_METER * FEET_IN_METER ) where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘sm’
PC_LEGAL_INFO.size_2 (2 decimals)
sum of MA_LAND.lot_size where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘a’
+
sum of ( MA_LAND.lot_size * 10000 / SM_IN_ACRES) where MA_LAND. exclude_lot_size = 0 (or NULL) and MA_LAND.lot_units_type = ‘h’
PC_LEGAL_INFO.size_t (2 decimals if FULL_SCALE_FORMAT = ‘no’ or 15 decimals if FULL_SCALE_FORMAT = ‘yes’) = ( PC_LEGAL_INFO.size_1 / SF_IN_ACRES ) + PC_LEGAL_INFO.size_2
If at least one value is calculated for size_1 then PC_LEGAL_INFO.size_1_unit = ‘sf’ and PC_LEGAL_INFO.size_t_unit = ‘a’
If at least one value is calculated for size_2 then PC_LEGAL_INFO.size_2_unit = ‘a’ and PC_LEGAL_INFO.size_t_unit = ‘a’
101-ma-compute-LandUnits