Beispiel #1
0
        private DynamicGridFeatureLayer GetDynamicGridFeatureLayer()
        {
            DynamicGridFeatureLayer dynamicGridFeatureLayer = new DynamicGridFeatureLayer(wellDepthPointData);

            dynamicGridFeatureLayer.CellHeightInPixel = Map1.ActualHeight / double.Parse(txtDynamicIsoLineCellRowCount.Text);
            dynamicGridFeatureLayer.CellWidthInPixel  = Map1.ActualWidth / double.Parse(txtDynamicIsoLineCellColumnCount.Text);

            Collection <double> isoLineBreaks = GridIsoLineLayer.GetIsoLineLevels(wellDepthPointData, Convert.ToInt32(txtGridIsoLineLevelCount.Text));

            //Create a series of colors from blue to red that we will use for the breaks
            Collection <GeoColor> colors = GeoColor.GetColorsInQualityFamily(GeoColor.StandardColors.Blue, GeoColor.StandardColors.Red, isoLineBreaks.Count, ColorWheelDirection.CounterClockwise);

            //Create a class break style
            ClassBreakStyle classBreakLineStyle = new ClassBreakStyle(dynamicGridFeatureLayer.DataValueColumnName);

            //Setup a class break style based on the isoline levels and the colors
            AreaStyle firstStyle = new AreaStyle(new GeoPen(GeoColor.FromArgb(50, colors[0]), 1), new GeoSolidBrush(GeoColor.FromArgb(50, colors[0])));

            classBreakLineStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, firstStyle));
            for (int i = 1; i < colors.Count - 1; i++)
            {
                AreaStyle style = new AreaStyle(new GeoPen(GeoColor.FromArgb(50, colors[i]), 1), new GeoSolidBrush(GeoColor.FromArgb(50, colors[i])));
                classBreakLineStyle.ClassBreaks.Add(new ClassBreak(isoLineBreaks[i], style));
            }

            dynamicGridFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(classBreakLineStyle);
            dynamicGridFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            return(dynamicGridFeatureLayer);
        }
Beispiel #2
0
        private InMemoryGridFeatureLayer GetGridFeatureLayer()
        {
            //Get the line breaks
            Collection <double> isoLineBreaks = GridIsoLineLayer.GetIsoLineLevels(wellDepthPointData, Convert.ToInt32(txtGridIsoLineLevelCount.Text));

            //Load a new GridFeatureLayer based on the current grid file
            InMemoryGridFeatureLayer gridFeatureLayer = new InMemoryGridFeatureLayer(gridCellMatrix);

            //Create a series of colors from blue to red that we will use for the breaks
            Collection <GeoColor> colors = GeoColor.GetColorsInQualityFamily(GeoColor.StandardColors.Blue, GeoColor.StandardColors.Red, isoLineBreaks.Count, ColorWheelDirection.CounterClockwise);

            //Create a class break style
            ClassBreakStyle classBreakLineStyle = new ClassBreakStyle(gridFeatureLayer.DataValueColumnName);

            //Setup a class break style based on the isoline levels and the colors
            AreaStyle firstStyle = new AreaStyle(new GeoPen(GeoColor.FromArgb(50, colors[0]), 1), new GeoSolidBrush(GeoColor.FromArgb(50, colors[0])));

            classBreakLineStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, firstStyle));
            for (int i = 1; i < colors.Count - 1; i++)
            {
                AreaStyle style = new AreaStyle(new GeoPen(GeoColor.FromArgb(50, colors[i]), 1), new GeoSolidBrush(GeoColor.FromArgb(50, colors[i])));
                classBreakLineStyle.ClassBreaks.Add(new ClassBreak(isoLineBreaks[i], style));
            }

            gridFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(classBreakLineStyle);
            gridFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            return(gridFeatureLayer);
        }
Beispiel #3
0
        private DynamicIsoLineLayer GetDynamicIsoLineLayer()
        {
            Collection <double> isoLineLevels = GridIsoLineLayer.GetIsoLineLevels(wellDepthPointData, Convert.ToInt32(txtGridIsoLineLevelCount.Text));

            //Create the new dynamicIsoLineLayer using the well data and the number of isoline levels from
            //the screen
            DynamicIsoLineLayer dynamicIsoLineLayer;

            if (rdoLinesOnlyType.IsChecked.Value.Equals(true))
            {
                dynamicIsoLineLayer = new DynamicIsoLineLayer(wellDepthPointData, isoLineLevels, new InverseDistanceWeightedGridInterpolationModel(2, double.MaxValue), IsoLineType.LinesOnly);
            }
            else if (rdoClosedLinesAsPolygonsType.IsChecked.Value.Equals(true))
            {
                dynamicIsoLineLayer = new DynamicIsoLineLayer(wellDepthPointData, isoLineLevels, new InverseDistanceWeightedGridInterpolationModel(2, double.MaxValue), IsoLineType.ClosedLinesAsPolygons);
            }
            else
            {
                dynamicIsoLineLayer = new DynamicIsoLineLayer(wellDepthPointData, isoLineLevels, new InverseDistanceWeightedGridInterpolationModel(2, double.MaxValue), IsoLineType.LinesOnly);
            }
            dynamicIsoLineLayer.CellHeightInPixel = (int)(Map1.ActualHeight / int.Parse(txtDynamicIsoLineCellRowCount.Text));
            dynamicIsoLineLayer.CellWidthInPixel  = (int)(Map1.ActualWidth / int.Parse(txtDynamicIsoLineCellColumnCount.Text));

            //Create a series of colors from blue to red that we will use for the breaks
            Collection <GeoColor> colors = GeoColor.GetColorsInQualityFamily(GeoColor.StandardColors.Blue, GeoColor.StandardColors.Red, isoLineLevels.Count, ColorWheelDirection.Clockwise);

            //Setup a class break style based on the isoline levels and the colors
            ClassBreakStyle classBreakStyle = new ClassBreakStyle(dynamicIsoLineLayer.DataValueColumnName);

            Collection <ThinkGeo.MapSuite.Styles.Style> firstStyles = new Collection <ThinkGeo.MapSuite.Styles.Style>();

            firstStyles.Add(new LineStyle(new GeoPen(colors[0], 3)));
            firstStyles.Add(new AreaStyle(new GeoPen(GeoColor.SimpleColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[0]))));
            classBreakStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, firstStyles));
            for (int i = 0; i < colors.Count - 1; i++)
            {
                Collection <ThinkGeo.MapSuite.Styles.Style> styles = new Collection <ThinkGeo.MapSuite.Styles.Style>();
                styles.Add(new LineStyle(new GeoPen(colors[i + 1], 3)));
                styles.Add(new AreaStyle(new GeoPen(GeoColor.SimpleColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[i + 1]))));
                classBreakStyle.ClassBreaks.Add(new ClassBreak(isoLineLevels[i], styles));
            }
            dynamicIsoLineLayer.CustomStyles.Add(classBreakStyle);

            //Create the text styles to label the lines
            TextStyle textStyle = TextStyles.CreateSimpleTextStyle(dynamicIsoLineLayer.DataValueColumnName, "Arial", 8, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, 0, 0);

            textStyle.HaloPen               = new GeoPen(GeoColor.StandardColors.White, 2);
            textStyle.OverlappingRule       = LabelOverlappingRule.NoOverlapping;
            textStyle.SplineType            = SplineType.StandardSplining;
            textStyle.DuplicateRule         = LabelDuplicateRule.UnlimitedDuplicateLabels;
            textStyle.TextLineSegmentRatio  = 9999999;
            textStyle.FittingLineInScreen   = true;
            textStyle.SuppressPartialLabels = true;
            dynamicIsoLineLayer.CustomStyles.Add(textStyle);

            return(dynamicIsoLineLayer);
        }
Beispiel #4
0
        private InMemoryGridIsoLineLayer GetGridIsoLineLayer()
        {
            //Create a grid cell matrix based on the textboxes and the current extent
            CreateGridCellMatrix();

            //Load the grid we just created into the GridIsoLineLayer using the number of breaks defines
            //on the screen
            Collection <double>      isoLineLevels = GridIsoLineLayer.GetIsoLineLevels(wellDepthPointData, Convert.ToInt32(txtGridIsoLineLevelCount.Text));
            InMemoryGridIsoLineLayer isoLineLayer  = new InMemoryGridIsoLineLayer(gridCellMatrix, isoLineLevels);

            if (rdoLinesOnlyType.IsChecked.Value.Equals(true))
            {
                isoLineLayer.IsoLineType = IsoLineType.LinesOnly;
            }
            else if (rdoClosedLinesAsPolygonsType.IsChecked.Value.Equals(true))
            {
                isoLineLayer.IsoLineType = IsoLineType.ClosedLinesAsPolygons;
            }
            else
            {
                isoLineLayer.IsoLineType = IsoLineType.LinesOnly;
            }

            //Create a series of colors from blue to red that we will use for the breaks
            Collection <GeoColor> colors = GeoColor.GetColorsInQualityFamily(GeoColor.StandardColors.Blue, GeoColor.StandardColors.Red, isoLineLevels.Count, ColorWheelDirection.CounterClockwise);

            //Setup a class break style based on the isoline levels and the colors
            ClassBreakStyle classBreakStyle = new ClassBreakStyle(isoLineLayer.DataValueColumnName);

            Collection <ThinkGeo.MapSuite.Styles.Style> firstStyles = new Collection <ThinkGeo.MapSuite.Styles.Style>();

            firstStyles.Add(new LineStyle(new GeoPen(colors[0], 3)));
            firstStyles.Add(new AreaStyle(new GeoPen(GeoColor.SimpleColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[0]))));
            classBreakStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, firstStyles));
            for (int i = 0; i < colors.Count - 1; i++)
            {
                Collection <ThinkGeo.MapSuite.Styles.Style> styles = new Collection <ThinkGeo.MapSuite.Styles.Style>();
                styles.Add(new LineStyle(new GeoPen(colors[i + 1], 3)));
                styles.Add(new AreaStyle(new GeoPen(GeoColor.SimpleColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[i + 1]))));
                classBreakStyle.ClassBreaks.Add(new ClassBreak(isoLineLevels[i], styles));
            }
            isoLineLayer.CustomStyles.Add(classBreakStyle);

            //Create the text styles to label the lines
            TextStyle textStyle = TextStyles.CreateSimpleTextStyle(isoLineLayer.DataValueColumnName, "Arial", 8, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, 0, 0);

            textStyle.HaloPen               = new GeoPen(GeoColor.StandardColors.White, 2);
            textStyle.OverlappingRule       = LabelOverlappingRule.NoOverlapping;
            textStyle.SplineType            = SplineType.StandardSplining;
            textStyle.DuplicateRule         = LabelDuplicateRule.UnlimitedDuplicateLabels;
            textStyle.TextLineSegmentRatio  = 9999999;
            textStyle.FittingLineInScreen   = true;
            textStyle.SuppressPartialLabels = true;
            isoLineLayer.CustomStyles.Add(textStyle);

            return(isoLineLayer);
        }
Beispiel #5
0
        private DynamicIsoLineLayer GetDynamicIsoLineLayer(Dictionary <PointShape, double> csvPointData)
        {
            // We use this method to generate the values for the lines based on the data values and how many breaks we want.
            Collection <double> isoLineLevels = GridIsoLineLayer.GetIsoLineLevels(csvPointData, 25);

            //Create the new dynamicIsoLineLayer
            DynamicIsoLineLayer dynamicIsoLineLayer = new DynamicIsoLineLayer(csvPointData, isoLineLevels, new InverseDistanceWeightedGridInterpolationModel(), IsoLineType.LinesOnly);

            // Set the cell height and width dynamically based on the map view size
            //dynamicIsoLineLayer.CellHeightInPixel = (int)(mapView.ActualHeight / 80);
            //dynamicIsoLineLayer.CellWidthInPixel = (int)(mapView.ActualWidth / 80);

            //Create a series of colors from blue to red that we will use for the breaks based on the number of iso line levels we want.
            Collection <GeoColor> colors = GeoColor.GetColorsInQualityFamily(GeoColors.Blue, GeoColors.Red, isoLineLevels.Count, ColorWheelDirection.Clockwise);

            //Setup a class break style based on the isoline levels and the colors and add it to the iso line layer
            ClassBreakStyle classBreakStyle = new ClassBreakStyle(dynamicIsoLineLayer.DataValueColumnName);

            dynamicIsoLineLayer.CustomStyles.Add(classBreakStyle);

            // Create a collection of styles that we use we will use for the minimum value
            Collection <Core.Style> firstStyles = new Collection <ThinkGeo.Core.Style>();

            firstStyles.Add(new LineStyle(new GeoPen(colors[0], 3)));
            firstStyles.Add(new AreaStyle(new GeoPen(GeoColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[0]))));
            classBreakStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, firstStyles));

            // Loop through all the colors we created as they will be class breaks
            for (int i = 0; i < colors.Count - 1; i++)
            {
                // Create the style collection for this break based on the colors we generated
                Collection <Core.Style> styles = new Collection <Core.Style>();
                styles.Add(new LineStyle(new GeoPen(colors[i + 1], 3)));
                styles.Add(new AreaStyle(new GeoPen(GeoColors.LightBlue, 3), new GeoSolidBrush(new GeoColor(150, colors[i + 1]))));

                // Add the class break with the styles
                classBreakStyle.ClassBreaks.Add(new ClassBreak(isoLineLevels[i], styles));
            }

            //Create the text styles to label the lines and add it to the iso line layer
            TextStyle textStyle = TextStyle.CreateSimpleTextStyle(dynamicIsoLineLayer.DataValueColumnName, "Arial", 10, DrawingFontStyles.Bold, GeoColors.Black, 0, 0);

            textStyle.HaloPen               = new GeoPen(GeoColors.White, 2);
            textStyle.OverlappingRule       = LabelOverlappingRule.NoOverlapping;
            textStyle.SplineType            = SplineType.StandardSplining;
            textStyle.DuplicateRule         = LabelDuplicateRule.UnlimitedDuplicateLabels;
            textStyle.TextLineSegmentRatio  = 9999999;
            textStyle.FittingLineInScreen   = true;
            textStyle.SuppressPartialLabels = true;
            dynamicIsoLineLayer.CustomStyles.Add(textStyle);

            return(dynamicIsoLineLayer);
        }