Exemple #1
0
        //-------------------------------------------------------------------------

        public static bool GenerateVisibilityData(
            string rasterSource,
            string observerObjectsFeatureClass,
            VisibilityAnalysisTypesEnum analyzeType,
            string outRasterName,
            IEnumerable <string> messages,
            VisibilityCurvatureCorrectionEnum curvatureCorrection = VisibilityCurvatureCorrectionEnum.FLAT_EARTH,
            string outAglRaster = null,
            int innerRadius     = 0,
            int outerRadius     = 0
            )
        {
            Geoprocessor gp = new Geoprocessor();

            Visibility visibility = new Visibility();

            visibility.analysis_type        = analyzeType.ToString().ToUpper();
            visibility.in_raster            = rasterSource;
            visibility.in_observer_features = observerObjectsFeatureClass;
            visibility.out_raster           = outRasterName;
            if (!string.IsNullOrWhiteSpace(outAglRaster))
            {
                visibility.out_agl_raster = outAglRaster;
            }

            visibility.nonvisible_cell_value = NonvisibleCellValue;

            visibility.horizontal_start_angle = VisibilityFieldsEnum.AzimuthB.ToString();
            visibility.horizontal_end_angle   = VisibilityFieldsEnum.AzimuthE.ToString();
            visibility.vertical_lower_angle   = VisibilityFieldsEnum.AnglMinH.ToString();
            visibility.vertical_upper_angle   = VisibilityFieldsEnum.AnglMaxH.ToString();

            if (innerRadius > 0)
            {
                visibility.inner_radius = innerRadius.ToString();
            }
            if (outerRadius > 0)
            {
                visibility.outer_radius = outerRadius.ToString();
            }

            visibility.curvature_correction = curvatureCorrection.ToString();

            GeoProcessorResult gpResult = new GeoProcessorResult();

            gp.SetEnvironmentValue(environmentName, temporaryWorkspace);;

            return(RunTool(gp, visibility, null, messages));
        }
Exemple #2
0
        //-------------------------------------------------------------------------

        public static bool GenerateVisibilityData(
            string rasterSource,
            string observerPointsFeatureClass,
            VisibilityAnalysisTypesEnum analyzeType,
            string outRasterName,
            out IEnumerable <string> messages,
            VisibilityCurvatureCorrectionEnum curvatureCorrection = VisibilityCurvatureCorrectionEnum.FLAT_EARTH,
            string outAglRaster = null
            )
        {
            Visibility visibility = new Visibility
            {
                analysis_type        = analyzeType.ToString().ToUpper(),
                in_raster            = rasterSource,
                in_observer_features = observerPointsFeatureClass,
                out_raster           = outRasterName
            };

            if (!string.IsNullOrWhiteSpace(outAglRaster))
            {
                visibility.out_agl_raster = outAglRaster;
            }

            visibility.nonvisible_cell_value = NonvisibleCellValue;

            visibility.horizontal_start_angle = VisibilityFieldsEnum.AzimuthB.ToString();
            visibility.horizontal_end_angle   = VisibilityFieldsEnum.AzimuthE.ToString();
            visibility.vertical_lower_angle   = VisibilityFieldsEnum.AnglMinH.ToString();
            visibility.vertical_upper_angle   = VisibilityFieldsEnum.AnglMaxH.ToString();
            visibility.surface_offset         = "";
            visibility.observer_elevation     = "";
            visibility.observer_offset        = VisibilityFieldsEnum.HRel.ToString();
            visibility.inner_radius           = VisibilityFieldsEnum.InnerRadius.ToString();
            visibility.outer_radius           = VisibilityFieldsEnum.OuterRadius.ToString();

            visibility.curvature_correction = curvatureCorrection.ToString();


            return(RunTool(visibility, null, out messages));
        }