Разработка специализированной системы визуализации и анализа городской среды

Автор работы: Пользователь скрыл имя, 06 Января 2013 в 23:20, реферат

Краткое описание

Цель работы – анализ методов информационной визуализации и визуального анализа и применение их для разработки прототипа системы поддержки конечного пользователя.
В процессе работы проводился анализ возможностей географических информационных систем как средств визуализации и анализа данных, исследовались различные методы представления географических и семантических данных.

Вложенные файлы: 1 файл

Tekst.docx

— 2.90 Мб (Скачать файл)

            Raions.Symbology = scheme;

 

            IMapLabelLayer labelLayer = new MapLabelLayer();          

            ILabelCategory category = labelLayer.Symbology.Categories[0];

            category.Expression = "[name]";

            labelLayer.Symbolizer = lb;

            category.Symbolizer.Orientation = ContentAlignment.MiddleCenter;

            IMapLabelLayer labelLayer2 = labelLayer;

 

            PolygonSymbolizer style = new PolygonSymbolizer(color1);

            style.OutlineSymbolizer = new LineSymbolizer(Color.Black, 2);

 

           Raions.Symbolizer = style;

            Raions.LabelLayer = labelLayer;

            Raions.ShowLabels = true;

        }

 

        private void loadMainStreet()

        {

            PolygonSymbolizer water = new PolygonSymbolizer(Color.LightBlue);

            water.OutlineSymbolizer = new LineSymbolizer(Color.LightBlue, 1);

            Water = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\Water.shp", false, prog));

            mapLayers.Add(Water);

            Water.Symbolizer = water;

 

            LineSymbolizer ls = new LineSymbolizer(Color.Gray, 8);

 

            road_scheme = new LineScheme();

 

            Color color1 = Color.FromArgb(0, 0, 0);

            LineCategory traff1 = new LineCategory(color1, 6);

            traff1.FilterExpression = "[traffic] < 4";

 

 

            Color color2 = Color.FromArgb(108, 108, 108);

            LineCategory traff2 = new LineCategory(color2, 6);

            traff2.FilterExpression = "  [traffic] >= 4 ";

 

            Color color3 = Color.FromArgb(165, 165, 165);

            LineCategory traff3 = new LineCategory(color3, 6);

            traff3.FilterExpression = "  [traffic] > 5 ";

 

            Color color4 = Color.FromArgb(212, 212, 212);

            LineCategory traff4 = new LineCategory(color4, 6);

            traff4.FilterExpression = "  [traffic] > 8 ";

 

            road_scheme.ClearCategories();

            road_scheme.AddCategory(traff1);

            road_scheme.AddCategory(traff2);

            road_scheme.AddCategory(traff3);

            road_scheme.AddCategory(traff4);

 

            road_scheme2 = new LineScheme();

 

 

            LineCategory traff12 = new LineCategory(color1, 6);

            traff12.FilterExpression = "[quality] < 4";

    

            LineCategory traff22 = new LineCategory(color2, 6);

            traff22.FilterExpression = "  [quality] >= 4 ";

 

            LineCategory traff32 = new LineCategory(color3, 6);

            traff32.FilterExpression = "  [quality] > 5 ";

 

            LineCategory traff42 = new LineCategory(color4, 6);

            traff42.FilterExpression = "  [quality] > 8 ";

 

            road_scheme2.ClearCategories();

            road_scheme2.AddCategory(traff12);

            road_scheme2.AddCategory(traff22);

            road_scheme2.AddCategory(traff32);

            road_scheme2.AddCategory(traff42);

 

            MainStreet = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\MainStreet.shp", false, prog));

 

            mapLayers.Add(MainStreet);

          

            MainStreet.Symbology = road_scheme;

            MainStreet.Symbolizer = ls;

 

 

            MainStreetTraff = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\traff.shp", false, prog));

 

            LineSymbolizer ls2 = new LineSymbolizer(Color.Red, 5);

            MainStreetTraff.Symbolizer = ls2;

           

 

            PointSymbolizer icon = new PointSymbolizer(Color.Gray, PointShapes.Ellipse, 10);       

            MainStreetIco = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\MainStreetIco.shp", false, prog));

            MainStreetIco.Symbolizer = icon;

        }

 

        private void loadBigStreet()

        {

            BigStreet = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\BigStreet.shp", false, prog));

 

            BigStreet.Symbology = road_scheme;

            mapLayers.Add(BigStreet);

        }

 

        private void loadStreets()

        {

           Streets = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\Streets.shp", false, prog));

           Streets.Symbology = road_scheme;

           mapLayers.Add(Streets);

        }

 

        private void loadBuildings()

        {

            PolygonSymbolizer style = new PolygonSymbolizer(Color.LightGreen);

            style.OutlineSymbolizer = new LineSymbolizer(Color.Black, 2);

            Buildings = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\Buildings.shp", false, prog));

 

            mapLayers.Add(Buildings);

            IMapLabelLayer labelLayer = new MapLabelLayer();

            LabelSymbolizer lb = new LabelSymbolizer();

            lb.FontSize = 15;

            ILabelCategory category = labelLayer.Symbology.Categories[0];

            category.Expression = "[number]";

            labelLayer.Symbolizer = lb;

 

            Buildings.LabelLayer = labelLayer;

            Buildings.ShowLabels = true;

            Buildings.Symbolizer = style;

        }

 

 

        private void loadSvetofor()

        {

            PointSymbolizer sveto = new PointSymbolizer(Images.sveto, 20);

            Svetofor = map.Layers.Add(DataManager.DefaultDataManager.OpenVector(@"GisData\Svetofor.shp", false, prog));

            Svetofor.Symbolizer = sveto;

        }

 

        private void loadPeshehod()

        {

            PointSymbolizer pesh = new PointSymbolizer(Images.znak, 20);

            Peshehod = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\Peshehod.shp", false, prog));

            Peshehod.Symbolizer = pesh;

          

        }

 

        private void loadPlaces()

        {

            PointSymbolizer place = new PointSymbolizer(Images._4051, 20);

            Places = map.Layers.Add(DataManager.DefaultDataManager.OpenVector

(@"GisData\Places.shp", false, prog));

            Places.Symbolizer = place;

 

        }

 

        private void UncheckOtherButtonsButMe(ToolStripButton checkedButton)

        {

            foreach (ToolStripItem item in this.toolStrip1.Items)

            {

                ToolStripButton buttonItem = item as ToolStripButton;

                if (buttonItem != null)

                {

                    if (buttonItem.Name != checkedButton.Name)

                    {

                        buttonItem.Checked = false;

                    }

                }

            }

        }

 

        private void cmdZoomIn_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            if (cmdZoomIn.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdZoomIn);

                cmdZoomIn.Checked = true;

                foreach (IMapFunction gt in map.MapFunctions.Values)

                {

                    gt.Deactivate();

 

                    MyZoomInFunction zf = gt as MyZoomInFunction;

                    if (zf != null)

                    {

                        zf.Activate();

                        map.Cursor = Cursors.UpArrow;

 

                        this.mode = 1;

                        try

                        {

                            MemoryStream ms = new MemoryStream(Resource.cursorZoomIn);

                            map.Cursor = new Cursor(ms);

                        }

                        catch

                        {

                            map.Cursor = Cursors.Arrow;

                        }

                        continue;

                    }

                }

            }

        }

 

        private void cmdZoomOut_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            if (cmdZoomOut.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdZoomOut);

                cmdZoomOut.Checked = true;

                foreach (IMapFunction gt in map.MapFunctions.Values)

                {

                    gt.Deactivate();

 

                    MyZoomOutFunction zf = gt as MyZoomOutFunction;

                    if (zf != null)

                    {

                        zf.Activate();

                        map.Cursor = Cursors.UpArrow;

                        this.mode = 2;

                        try

                        {

                            MemoryStream ms = new MemoryStream(Resource.cursorZoomOut);

                            map.Cursor = new Cursor(ms);

                        }

                        catch

                        {

                            map.Cursor = Cursors.Arrow;

                        }

                        continue;

                    }

                }

            }

        }

 

        private void cmdMaxExtents_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            UncheckOtherButtonsButMe(cmdMaxExtents);

 

            map.ZoomToMaxExtent();

 

            map.FunctionMode = FunctionModes.None;

            mode = 0;

            zoomCount = 0;

            checkVisual.Enabled = false;

 

            InvisibleLayers();

            City.IsVisible = true;

            if (checkLabels.Checked) City.ShowLabels = true;

            else City.ShowLabels = false;

            City.SelectionEnabled = true;

 

            map.Invalidate();

 

            Rectangle r = map.MapFrame.View;

            int w = r.Width;

            int h = r.Height;

            r.Inflate((int)(r.Width / 4), (int)(r.Height / 4));

            map.MapFrame.View = r;

            map.MapFrame.ResetExtents();

        }

 

        private void cmdPan_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            if (cmdPan.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdPan);

                cmdPan.Checked = true;

                map.FunctionMode = FunctionModes.Pan;

                mode = 0;

            }           

        }

 

        private void cmdSelect_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            if (cmdSelect.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdSelect);

                cmdSelect.Checked = true;

                map.FunctionMode = FunctionModes.Info;

                foreach (IMapFunction gt in map.MapFunctions.Values)

                {

                    gt.Deactivate();

                    SelectInfoFunction zf = gt as SelectInfoFunction;

                    if (zf != null)

                    {

                        zf.Activate();

                        map.Cursor = Cursors.Hand;

                        mode = 0;

                        continue;

                    }

                }

            }

        }

 

        private void cmdCalc_Click(object sender, EventArgs e)

        {

            if (map == null) return;

 

            if (cmdCalc.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdCalc);

                cmdCalc.Checked = true;

 

                foreach (IMapFunction gt in map.MapFunctions.Values)

                {

                    gt.Deactivate();

                    MyMeasureFunction zf = gt as MyMeasureFunction;

                    if (zf != null)

                    {

                        zf.Activate();

                        map.Cursor = Cursors.Cross;

                        mode = 0;

                        continue;

                    }

                }

            }

 

            if (cmdCalc.Checked == false)

            {

                UncheckOtherButtonsButMe(cmdCalc);

                cmdCalc.Checked = true;

                map.FunctionMode = FunctionModes.Measure;

            }

        }

 

        private void map_click(object sender, EventArgs e)

        {

            if (this.mode == 1 && ((MouseEventArgs)e).Button == MouseButtons.Left)

            {

                this.zoomCount += 1;

                Console.Out.WriteLine(this.zoomCount);

            }

            else if (this.mode == 1 && ((MouseEventArgs)e).Button == MouseButtons.Right)

            {

                this.zoomCount -= 1;

                Console.Out.WriteLine(this.zoomCount);

            }

            else if (this.mode == 2 && ((MouseEventArgs)e).Button == MouseButtons.Right)

            {

                this.zoomCount += 1;

                Console.Out.WriteLine(this.zoomCount);

            }

            else if (this.mode == 2 && ((MouseEventArgs)e).Button == MouseButtons.Left)

            {

                this.zoomCount -= 1;

                Console.Out.WriteLine(this.zoomCount);

            }

 

            if (zoomCount == 1)

            {

                InvisibleLayers();

                City.IsVisible = true;

                selectedFalse();

                City.SelectionEnabled = true;

                if (checkLabels.Checked) City.ShowLabels = true;

                else City.ShowLabels = false;

 

                panel1.Visible = false;

                checkVisual.Enabled = false;

            }

 

            if (zoomCount >= 2)

            {

                InvisibleLayers();

                Raions.IsVisible = true;

                selectedFalse();

                editTrue();

                Raions.SelectionEnabled = true;

 

                checkVisual.Enabled = true;

                btnVis1.Text = "По населению";

                btnVis2.Text = "По площади";

 

            }

 

            if (zoomCount >= 3)

            {

                map.MapFrame.ClearSelection();

                InvisibleLayers();

                CityAsImage();

               

                Water.IsVisible = true;

                MainStreet.IsVisible = true;

                MainStreetIco.IsVisible = true;

                selectedFalse();

                editTrue();

              

                Water.SelectionEnabled = true;

                MainStreet.SelectionEnabled = true;

 

                btnVis1.Text = "По качеству полотна";

                btnVis2.Text = "По средней скорости";

            }

 

            if (zoomCount >= 6)

            {

                CityAsImage();

                Raions.IsVisible = false;

                MainStreet.IsVisible = true;

                MainStreetIco.EditMode = false;

                Water.IsVisible = true;

                BigStreet.IsVisible = true;

 

                selectedFalse();

 

                MainStreet.SelectionEnabled = true;

                Water.SelectionEnabled = true;

                BigStreet.SelectionEnabled = true;

 

                btnVis1.Text = "По уровню пробок";

                btnVis2.Text = "По качеству покрытия";

            }

 

            if (zoomCount >= 13)

            {

                CityAsImage();

                Raions.IsVisible = false;

                MainStreet.IsVisible = true;

                Water.IsVisible = true;

                BigStreet.IsVisible = true;

                Streets.IsVisible = true;

 

                selectedFalse();

                MainStreet.SelectionEnabled = true;

                Water.SelectionEnabled = true;

                BigStreet.SelectionEnabled = true;

                Streets.SelectionEnabled = true;

 

                btnVis1.Text = "По уровню пробок";

                btnVis2.Text = "По качеству покрытия";

            }

 

            if (zoomCount >= 15)

            {

                CityAsImage();

                Raions.IsVisible = false;

                MainStreet.IsVisible = true;

Информация о работе Разработка специализированной системы визуализации и анализа городской среды