Select to view content in your preferred language

Couldn't show GPResultImageLayer

714
2
Jump to solution
12-19-2013 10:59 PM
dingkaichen
New Contributor II
Hi all,
I tried to use GPProcessor to do Kriging Interpolation and the GPResultImageLayer just couldn't show.
I used fiddler to get the response from arcgis server. The result is shown in the attachment. Notice that there is a url and I used that url and was able to get a gif which is the result of the interpolation.
Hope any one can help.Thanks a lot!

Code:
        private void Raster()
        {
            GraphicsLayer ggg = _myMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

            int x = 421682;
            int y = 4871092;
            Random rd = new Random();
            List<Graphic> _graphics = new List<Graphic>();
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Graphic _graphic = new Graphic();
                    _graphic.Geometry = new MapPoint()
                    {
                        X = x + i * 5,
                        Y = y + j * 5,
                        SpatialReference = _myMap.SpatialReference
                    };
                    _graphic.Symbol = _mySelectedSymbol;
                    _graphic.Attributes.Add("PollutionC", rd.NextDouble());

                    _graphics.Add(_graphic);
                    ggg.Graphics.Add(_graphic);
                }
            }

            Geoprocessor _gpTask = new Geoprocessor("http://124.16.166.229:8080/ArcGIS/rest/services/RasterService/GPServer/KrigingRaster");
            List<GPParameter> _parameters = new List<GPParameter>();
            FeatureSet _featureSet = new FeatureSet(_graphics);
            _parameters.Add(new GPFeatureRecordSetLayer("Input_point_features", _featureSet));

            HttpWebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.ClientHttp);

            _gpTask.SubmitJobAsync(_parameters);
            _gpTask.JobCompleted += new EventHandler<JobInfoEventArgs>(_gpTask_JobCompleted);
           
        }

        void _gpTask_JobCompleted(object sender, JobInfoEventArgs e)
        {
            Geoprocessor _gpTask = sender as Geoprocessor;
            _gpTask.GetResultImageLayerAsync(e.JobInfo.JobId, "Kriging_1");
            _gpTask.GetResultImageLayerCompleted += new EventHandler<GetResultImageLayerEventArgs>(_gpTask_GetResultImageLayerCompleted);
                  
        }

        void _gpTask_GetResultImageLayerCompleted(object sender, GetResultImageLayerEventArgs e)
        {
            GPResultImageLayer _imageLayer = e.GPResultImageLayer;
            _imageLayer.Initialized += new EventHandler<EventArgs>(_imageLayer_Initialized);
            _imageLayer.ID = "Kriging";
            _myMap.Layers.Add(_imageLayer);
        }
0 Kudos
1 Solution

Accepted Solutions
dingkaichen
New Contributor II
Silverlight doesn't support GIF. Did you try with another image format?


Thanks for reply. I have solved the problem I stated at the beginning though I still don't understand why it created a gif when I directly publish a toolbox.
I solved the problem by publishing a map source(.mxd) which including a toolbox. The toolbox in published map source became a gp service. It works.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Hi all,
I tried to use GPProcessor to do Kriging Interpolation and the GPResultImageLayer just couldn't show.
I used fiddler to get the response from arcgis server. The result is shown in the attachment. Notice that there is a url and I used that url and was able to get a gif which is the result of the interpolation.
Hope any one can help.Thanks a lot!        

Silverlight doesn't support GIF. Did you try with another image format?
0 Kudos
dingkaichen
New Contributor II
Silverlight doesn't support GIF. Did you try with another image format?


Thanks for reply. I have solved the problem I stated at the beginning though I still don't understand why it created a gif when I directly publish a toolbox.
I solved the problem by publishing a map source(.mxd) which including a toolbox. The toolbox in published map source became a gp service. It works.
0 Kudos