コード例 #1
0
ファイル: ucMapImport.cs プロジェクト: haizhizhong/NewDemo
        void ExportOnePoint(DataRow row, int oldLinkId, List <Feature> list)
        {
            string    sql       = $"select * from Geo_Point where id={oldLinkId}";
            DataTable geoTable  = _hmCon.SQLExecutor.ExecuteDataAdapter(sql, _hmCon.TRConnection);
            double    longitude = double.Parse(geoTable.Rows[0]["Longitude"].ToString());
            double    latitude  = double.Parse(geoTable.Rows[0]["Latitude"].ToString());

            var attr = AttrInfo.GenAttr(MatchAttr, row[ColumnNames.Key]);

            attr.Add(ColumnNames.TimeStamp, geoTable.Rows[0][ColumnNames.TimeStamp].ToString());

            list.Add(new Feature(new Point(new Position(latitude, longitude)), AttrInfo.GenAttr(MatchAttr, row[ColumnNames.Key])));
        }
コード例 #2
0
ファイル: ucMapImport.cs プロジェクト: haizhizhong/NewDemo
        void ExportOneRowEvents(DataRow row, List <Feature> list)
        {
            string    sql      = $"select * from Geo_Event where EventTypeId={_layer.ConvertTo<MapEventLayer>().TypeId} and LinkCode='{row[ColumnNames.Key]}'";
            DataTable geoTable = _hmCon.SQLExecutor.ExecuteDataAdapter(sql, _hmCon.TRConnection);

            foreach (DataRow geo in geoTable.Rows)
            {
                double longitude = double.Parse(geo["Longitude"].ToString());
                double latitude  = double.Parse(geo["Latitude"].ToString());

                var attr = AttrInfo.GenAttr(MatchAttr, row[ColumnNames.Key]);
                attr.Add(ColumnNames.Description, geo[ColumnNames.Description].ToString());
                attr.Add(ColumnNames.EventDate, geo[ColumnNames.EventDate].ToString());
                list.Add(new Feature(new Point(new Position(latitude, longitude)), attr));
            }
        }
コード例 #3
0
ファイル: ucMapImport.cs プロジェクト: haizhizhong/NewDemo
        void ExportOnePolyline(DataRow row, int oldLinkId, List <Feature> list)
        {
            string            sql      = $"select * from Geo_Polyline where PolylineId={oldLinkId}";
            DataTable         geoTable = _hmCon.SQLExecutor.ExecuteDataAdapter(sql, _hmCon.TRConnection);
            var               groups   = geoTable.Select().GroupBy(x => x["LineId"]);
            List <LineString> lineList = new List <LineString>();

            foreach (var group in groups)
            {
                List <Position> pointList = new List <Position>();
                group.ToList().ForEach(geo => pointList.Add(new Position(double.Parse(geo["Latitude"].ToString()), double.Parse(geo["Longitude"].ToString()))));
                lineList.Add(new LineString(pointList));
            }

            list.Add(new Feature(lineList.Count == 1 ? lineList[0] as IGeometryObject : new MultiLineString(lineList), AttrInfo.GenAttr(MatchAttr, row[ColumnNames.Key])));
        }