예제 #1
0
        private String RasterAPuntos(string sRasterLayer, string sOutputFC, Geoprocessor gp)
        {
            string sCapaMpios_parques_cobertura = "mpios_parques_cobertura";
            string sFCCruce = _sigpi.Parametros.RutaGBD + "\\" + sCapaMpios_parques_cobertura;

            try
            {
                RasterToPoint raster2Pnt = new RasterToPoint(sRasterLayer, sOutputFC);
                raster2Pnt.raster_field = "VALUE";

                gp.Execute(raster2Pnt, null);

                Intersect intersect = new Intersect();
                intersect.in_features       = sOutputFC + " ; " + sFCCruce;
                intersect.out_feature_class = sOutputFC.Replace(".shp", "_intersect.shp");
                intersect.join_attributes   = "NO_FID";
                intersect.output_type       = "POINT";

                gp.Execute(intersect, null);
                return(intersect.out_feature_class.ToString());
            }
            catch (Exception ex)
            {
                throw new Exception("Verifique que exista información para el día seleccionado");
            }
        }
예제 #2
0
        /// <summary>
        /// 栅格转为点矢量
        /// </summary>
        /// <param name="inFile">输入栅格</param>
        /// <param name="selectField">选中字段</param>
        /// <param name="outFile">输出文件</param>
        public static void RasterToPoint(string inFile, string selectField, string outFile)
        {
            RasterToPoint rasterToPoint = new RasterToPoint
            {
                in_raster          = inFile,
                raster_field       = selectField,
                out_point_features = outFile
            };

            GeoprocessorHelper.GpExecute(rasterToPoint);
        }