Azavea.NijPredictivePolicing.ACSAlchemistLibrary.Transfer.AcsDataManager.GetGeometryRowKeyGenerator C# (CSharp) Method

GetGeometryRowKeyGenerator() public method

public GetGeometryRowKeyGenerator ( ) : GetGeometryRowKey
return GetGeometryRowKey
        public GetGeometryRowKey GetGeometryRowKeyGenerator()
        {
            GetGeometryRowKey keyDelegate = null;

            if ((this.SummaryLevel == "140") || (this.SummaryLevel == "150"))
            {
                keyDelegate = (DataRow row) =>
                {
                    string county = Utilities.GetAs<string>(row["COUNTY"], "-1");
                    string tract = Utilities.GetAs<string>(row["TRACT"], "-1");
                    string blkgroup = Utilities.GetAs<string>(row["BLKGROUP"], "-1");
                    if (tract.Trim().Length != 6)
                        tract += "00";

                    return string.Format("{0}_{1}_{2}", county, tract, blkgroup);
                };
            }
            else if (this.SummaryLevel == "060")
            {
                keyDelegate = (DataRow row) =>
                {
                    string county = Utilities.GetAs<string>(row["COUNTY"], "-1");
                    string cousub = Utilities.GetAs<string>(row["COUSUB"], "-1");

                    return string.Format("{0}_{1}", county, cousub);
                };
            }
            else if (this.SummaryLevel == "050")
            {
                keyDelegate = (DataRow row) =>
                {
                    return Utilities.GetAs<string>(row["COUNTY"], "-1");
                };
            }

            return keyDelegate;
        }