示例#1
0
        private IFeatureBuffer SetFLine2Feature(IFeatureBuffer fb, FLine_EDGES model, long lineNum)
        {
            if (model.WKT.Contains("\""))
            {
                model.WKT = model.WKT.Replace("\"", "");
            }
            data = model.WKT.Split(splitWKT_EDGES, StringSplitOptions.None);
            if (data.Length != 3)
            {
                Log("行号[" + lineNum.ToString() + "],WKT未能正确分割,结果为:" + data.ToString());
                return(null);
            }
            type = data[0];
            cood = data[1];

            if (type.ToUpper() != "LINESTRING")
            {
                Log("行号[" + lineNum.ToString() + "],WKT类型指示的值错误,错误值为:" + type);
                return(null);
            }

            xys = cood.Split(',');
            if (xys.Length < 2)
            {
                Log("行号[" + lineNum.ToString() + "],坐标点太少。" + xys.Length.ToString());
                return(null);
            }

            string    message  = "";
            IGeometry geometry = WKTCoordinateInfo2PolyLine(cood, out message);

            if (geometry == null)
            {
                Log("行号[" + lineNum.ToString() + "]." + message + "----------" + model.WKT);
            }
            fb.Shape = geometry;

            #region
            fieldIndex = fields.FindField("ARTPATH");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.ARTPATH;
            }
            fieldIndex = fields.FindField("COUNTYFP");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.COUNTYFP;
            }
            fieldIndex = fields.FindField("DECKEDROAD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.DECKEDROAD;
            }
            fieldIndex = fields.FindField("DIVROAD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.DIVROAD;
            }
            fieldIndex = fields.FindField("EXTTYP");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.EXTTYP;
            }
            fieldIndex = fields.FindField("FEATCAT");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.FEATCAT;
            }
            fieldIndex = fields.FindField("FULLNAME");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.FULLNAME;
            }
            fieldIndex = fields.FindField("GCSEFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.GCSEFLG;
            }
            fieldIndex = fields.FindField("HYDROFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.HYDROFLG;
            }
            fieldIndex = fields.FindField("LFROMADD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.LFROMADD;
            }
            fieldIndex = fields.FindField("LTOADD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.LTOADD;
            }
            fieldIndex = fields.FindField("MTFCC");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.MTFCC;
            }
            fieldIndex = fields.FindField("OFFSETL");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.OFFSETL;
            }
            fieldIndex = fields.FindField("OFFSETR");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.OFFSETR;
            }
            fieldIndex = fields.FindField("OLFFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.OLFFLG;
            }
            fieldIndex = fields.FindField("PASSFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.PASSFLG;
            }
            fieldIndex = fields.FindField("PERSIST");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.PERSIST;
            }
            fieldIndex = fields.FindField("RAILFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.RAILFLG;
            }
            fieldIndex = fields.FindField("RFROMADD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.RFROMADD;
            }
            fieldIndex = fields.FindField("ROADFLG");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.ROADFLG;
            }
            fieldIndex = fields.FindField("RTOADD");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.RTOADD;
            }
            fieldIndex = fields.FindField("SMID");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.SMID;
            }
            fieldIndex = fields.FindField("STATEFP");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.STATEFP;
            }
            fieldIndex = fields.FindField("TFIDL");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TFIDL;
            }
            fieldIndex = fields.FindField("TFIDR");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TFIDR;
            }
            fieldIndex = fields.FindField("TLID");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TLID;
            }
            fieldIndex = fields.FindField("TNIDF");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TNIDF;
            }
            fieldIndex = fields.FindField("TNIDT");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TNIDT;
            }
            fieldIndex = fields.FindField("TTYP");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.TTYP;
            }
            //index = f.Fields.FindField("WKT");
            //if (index >= 0)
            //{
            //    f.Value[index] = model.WKT;
            //}
            fieldIndex = fields.FindField("ZIPL");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.ZIPL;
            }
            fieldIndex = fields.FindField("ZIPR");
            if (fieldIndex >= 0)
            {
                fb.Value[fieldIndex] = model.ZIPR;
            }
            #endregion

            return(fb);
        }
示例#2
0
 private FLine_EDGES Line2Model(FLine_EDGES FModel, string[] line)
 {
     FModel.WKT = line[0]; FModel.STATEFP = line[1]; FModel.COUNTYFP = line[2]; FModel.TLID = line[3]; FModel.TFIDL = line[4]; FModel.TFIDR = line[5]; FModel.MTFCC = line[6]; FModel.FULLNAME = line[7]; FModel.SMID = line[8]; FModel.LFROMADD = line[9]; FModel.LTOADD = line[10]; FModel.RFROMADD = line[11]; FModel.RTOADD = line[12]; FModel.ZIPL = line[13]; FModel.ZIPR = line[14]; FModel.FEATCAT = line[15]; FModel.HYDROFLG = line[16]; FModel.RAILFLG = line[17]; FModel.ROADFLG = line[18]; FModel.OLFFLG = line[19]; FModel.PASSFLG = line[20]; FModel.DIVROAD = line[21]; FModel.EXTTYP = line[22]; FModel.TTYP = line[23]; FModel.DECKEDROAD = line[24]; FModel.ARTPATH = line[25]; FModel.PERSIST = line[26]; FModel.GCSEFLG = line[27]; FModel.OFFSETL = line[28]; FModel.OFFSETR = line[29]; FModel.TNIDF = line[30]; FModel.TNIDT = line[31];
     return(FModel);
 }