예제 #1
0
        protected int GetBucketCount()
        {
            if (!IsRuleFieldDefined)
            {
                return(m_coreSpatialElementManager.GetSpatialElementCount());
            }
            MapRuleDistributionType distributionType = GetDistributionType();
            ReportIntProperty       bucketCount      = m_mapRule.BucketCount;
            int num = m_defaultBucketCount;

            if (bucketCount != null)
            {
                num = (bucketCount.IsExpression ? m_mapRule.Instance.BucketCount : bucketCount.Value);
            }
            if (!IsRuleFieldScalar)
            {
                return(m_coreSpatialElementManager.GetDistinctValuesCount(m_coreRule.Field));
            }
            switch (distributionType)
            {
            case MapRuleDistributionType.Optimal:
            case MapRuleDistributionType.EqualDistribution:
                return(Math.Min(num, m_coreSpatialElementManager.GetDistinctValuesCount(m_coreRule.Field)));

            case MapRuleDistributionType.Custom:
                return((m_mapRule.MapBuckets ?? throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, m_mapRule.MapDef.Name, m_mapVectorLayer.Name, "MapBuckets"))).Count);

            default:
                return(num);
            }
        }
예제 #2
0
        protected DataGrouping GetDataGrouping(MapRuleDistributionType distributionType)
        {
            switch (distributionType)
            {
            case MapRuleDistributionType.EqualDistribution:
                return(DataGrouping.EqualDistribution);

            case MapRuleDistributionType.EqualInterval:
                return(DataGrouping.EqualInterval);

            default:
                return(DataGrouping.Optimal);
            }
        }
예제 #3
0
        protected void SetRuleDistribution(RuleBase coreRule)
        {
            MapRuleDistributionType distributionType = GetDistributionType();

            if (distributionType != MapRuleDistributionType.Custom)
            {
                coreRule.DataGrouping = GetDataGrouping(distributionType);
                coreRule.FromValue    = GetFromValue();
                coreRule.ToValue      = GetToValue();
            }
            else
            {
                coreRule.DataGrouping = DataGrouping.EqualInterval;
            }
        }