<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can not create a 3D-features(have z value) using a geoprocessing package executed with Local Server in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330012#M12115</link>
    <description>&lt;P&gt;Hi,all&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I&lt;SPAN&gt;&amp;nbsp;created&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a geoprocessing package (&lt;/SPAN&gt;&lt;SPAN&gt;.gpkx&lt;/SPAN&gt;&lt;SPAN&gt;) in ArcGIS Pro(3.02) involving a custom geoprocessing model that includes the &lt;A href="https://pro.arcgis.com/en/pro-app/3.0/tool-reference/3d-analyst/interpolate-shape.htm" target="_self"&gt;Interpolate Shape (3D Analyst)&lt;/A&gt;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.0/tool-reference/3d-analyst/interpolate-shape.htm" target="_self"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;geoprocessing tool, which output a poyline 3D feature with z-value,&amp;nbsp; i executed the geoprocessing package&amp;nbsp;with ArcGIS Runtime Local Server(200.1) using ArcGIS Maps SDK for .Net(200.2)&amp;nbsp;, i got the poyline feature from the output, but the polyline feature is not has a z-value, and the z-values of the points("_Result") on the poyline are all 0.Can someone help me? thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; The relevant code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async void GpJobOnJobChanged(object o, JobStatus e)
        {
            // Show message if job failed
            if (_gpJob.Status == JobStatus.Failed)
            {
                 MessageBox.Show("Not found reason!", "Job Failed");
                return;
            }

            // Return if not succeeded
            if (_gpJob.Status != JobStatus.Succeeded) { return; }

            try
            {
                // Get the results from the outputs.
                GeoprocessingResult result = await _gpJob.GetResultAsync();

                var value = result.Outputs.Values.LastOrDefault() as GeoprocessingFeatures;

                IFeatureSet? gpOutputFeatures = null;

                if (value.CanGetOutputFeatures)
                    gpOutputFeatures = await value.GetOutputFeaturesAsync();
                else
                    gpOutputFeatures = value.Features ;

                List&amp;lt;MapPoint&amp;gt; mapPoints = new List&amp;lt;MapPoint&amp;gt;();

                foreach (var feature in gpOutputFeatures)
                {
                    if (feature.Geometry is Esri.ArcGISRuntime.Geometry.Polyline polyline)
                    {
                        foreach (var part in polyline.Parts)
                        {
                            mapPoints.AddRange(part.Points);
                        }
                    }
                }
                _Result = mapPoints;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
            finally
            {
                // Remove the event handlers.
                _gpJob.ProgressChanged -= GpJob_ProgressChanged;
                _gpJob.StatusChanged -= GpJobOnJobChanged;
            }

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 07:33:32 GMT</pubDate>
    <dc:creator>AlexanderZhang</dc:creator>
    <dc:date>2023-09-19T07:33:32Z</dc:date>
    <item>
      <title>Can not create a 3D-features(have z value) using a geoprocessing package executed with Local Server</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330012#M12115</link>
      <description>&lt;P&gt;Hi,all&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I&lt;SPAN&gt;&amp;nbsp;created&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a geoprocessing package (&lt;/SPAN&gt;&lt;SPAN&gt;.gpkx&lt;/SPAN&gt;&lt;SPAN&gt;) in ArcGIS Pro(3.02) involving a custom geoprocessing model that includes the &lt;A href="https://pro.arcgis.com/en/pro-app/3.0/tool-reference/3d-analyst/interpolate-shape.htm" target="_self"&gt;Interpolate Shape (3D Analyst)&lt;/A&gt;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.0/tool-reference/3d-analyst/interpolate-shape.htm" target="_self"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;geoprocessing tool, which output a poyline 3D feature with z-value,&amp;nbsp; i executed the geoprocessing package&amp;nbsp;with ArcGIS Runtime Local Server(200.1) using ArcGIS Maps SDK for .Net(200.2)&amp;nbsp;, i got the poyline feature from the output, but the polyline feature is not has a z-value, and the z-values of the points("_Result") on the poyline are all 0.Can someone help me? thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; The relevant code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async void GpJobOnJobChanged(object o, JobStatus e)
        {
            // Show message if job failed
            if (_gpJob.Status == JobStatus.Failed)
            {
                 MessageBox.Show("Not found reason!", "Job Failed");
                return;
            }

            // Return if not succeeded
            if (_gpJob.Status != JobStatus.Succeeded) { return; }

            try
            {
                // Get the results from the outputs.
                GeoprocessingResult result = await _gpJob.GetResultAsync();

                var value = result.Outputs.Values.LastOrDefault() as GeoprocessingFeatures;

                IFeatureSet? gpOutputFeatures = null;

                if (value.CanGetOutputFeatures)
                    gpOutputFeatures = await value.GetOutputFeaturesAsync();
                else
                    gpOutputFeatures = value.Features ;

                List&amp;lt;MapPoint&amp;gt; mapPoints = new List&amp;lt;MapPoint&amp;gt;();

                foreach (var feature in gpOutputFeatures)
                {
                    if (feature.Geometry is Esri.ArcGISRuntime.Geometry.Polyline polyline)
                    {
                        foreach (var part in polyline.Parts)
                        {
                            mapPoints.AddRange(part.Points);
                        }
                    }
                }
                _Result = mapPoints;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
            finally
            {
                // Remove the event handlers.
                _gpJob.ProgressChanged -= GpJob_ProgressChanged;
                _gpJob.StatusChanged -= GpJobOnJobChanged;
            }

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 07:33:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330012#M12115</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-09-19T07:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can not create a 3D-features(have z value) using a geoprocessing package executed with Local Server</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330019#M12116</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The first thing I recommend looking at is your geoprocessing model - if you're able to share that here then we may be able to spot if there are any issues in the way it's setup.&lt;/P&gt;&lt;P&gt;Models are fine, but typically as your usage gets more advanced, you'll want to switch to Python scripts. I've shared an old example below. This uses a Linear Referencing tool as well, to add the distance along the line for each point (which I displayed in a client-side chart when you hover the mouse over). I would then add this Python script to a Toolbox and setup the input/output parameters (see image further below).&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, math

inputLine = arcpy.GetParameterAsText(0)
inputRaster = arcpy.GetParameterAsText(1)
outputShapeZ = "in_memory\\outShapeZ"
outputShapeM = "in_memory\\outShapeM"

arcpy.ddd.InterpolateShape(inputRaster, inputLine, outputShapeZ)

arcpy.CreateRoutes_lr(outputShapeZ, "ident", outputShapeM, "LENGTH")

arcpy.SetParameterAsText(2, outputShapeM)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelBranscomb_0-1695111793668.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81057i3DF0CAD31DCEF700/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelBranscomb_0-1695111793668.png" alt="MichaelBranscomb_0-1695111793668.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 08:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330019#M12116</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2023-09-19T08:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can not create a 3D-features(have z value) using a geoprocessing package executed with Local Server</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330459#M12126</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3014"&gt;@MichaelBranscomb&lt;/a&gt;&amp;nbsp;for your&amp;nbsp;professional information,&amp;nbsp;I have solved the issue, and i&amp;nbsp;may have made a rookie mistake. I found that I forgot to set the&amp;nbsp;ReturnZ of&amp;nbsp;the geoprocessing parameters to true, the correct code is as follows:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Create the geoprocessing task from the service
var _gpTask = await GeoprocessingTask.CreateAsync(new Uri(_gpService.Url + "/MyGPModel"));

// Create the geoprocessing parameters
var _gpParams = await _gpTask.CreateDefaultParametersAsync();

// Set the geoprocessing parameters
_gpParams.ReturnZ = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 00:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1330459#M12126</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-09-20T00:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can not create a 3D-features(have z value) using a geoprocessing package executed with Local Server</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1344599#M12257</link>
      <description>&lt;P&gt;So is there a way to create a 3-dimensional shape in ArcGIS Pro 3.1.0 with x,y,and z (z being elevaiton values) and then in geoprocessing the shape can be analyzed using IDW or kriging?&amp;nbsp; I have an Excel sheet in .csv but can't get the shape to produce, and can't analyze it in 3-d, only in 2-d.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 18:52:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-not-create-a-3d-features-have-z-value-using-a/m-p/1344599#M12257</guid>
      <dc:creator>RobertReynolds2</dc:creator>
      <dc:date>2023-11-01T18:52:02Z</dc:date>
    </item>
  </channel>
</rss>

