def sub_rule_for_0_30_area(geom): from lingcod.intersection.models import OrganizationScheme, FeatureMapping from report.models import construct_0_30_poly replicate = False all_0_30 = OrganizationScheme.objects.get(name='shallow030').featuremapping_set.filter(name='shallow030')[0].transformed_results(geom).values()[0]['result'] theoretical_0_30 = area_in_display_units( construct_0_30_poly(geom) ) if all_0_30 < theoretical_0_30 * AREA_PROPORTION_THRESHOLD: reason = 'Area problems. In addition to containing the 0-30m proxy line, the shape must contain a corresponding amount of 0-30m depth zone area.' return replicate, reason else: reason = 'Sufficient 0-30m proxy and sufficient 0-30m depth range area.' replicate = True return replicate, reason
def sub_rule_for_0_30_area(geom): from lingcod.intersection.models import OrganizationScheme, FeatureMapping from report.models import construct_0_30_poly replicate = False all_0_30 = OrganizationScheme.objects.get( name='shallow030').featuremapping_set.filter( name='shallow030')[0].transformed_results( geom).values()[0]['result'] theoretical_0_30 = area_in_display_units(construct_0_30_poly(geom)) if all_0_30 < theoretical_0_30 * AREA_PROPORTION_THRESHOLD: reason = 'Area problems. In addition to containing the 0-30m proxy line, the shape must contain a corresponding amount of 0-30m depth zone area.' return replicate, reason else: reason = 'Sufficient 0-30m proxy and sufficient 0-30m depth range area.' replicate = True return replicate, reason
def area_sq_mi(self): """ WARNING: This method assumes that the native units of the geometry are meters. Returns the area of the study region in sq_mi """ return area_in_display_units(self.geometry.area)