<?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 Re: Elevation Profile Does Not Return Z or M Values in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1127274#M6916</link>
    <description>&lt;P&gt;I was able to retrieve the Z and M values using the following code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_polyline = Polyline({
	"paths": [[[-73.609551, 45.490678, 0, 0],
			   [-73.584162, 45.513645, 0, 0]]],
	"spatialReference": {
		"wkid": 4326
	}
})

input_feature_set = FeatureSet(
	features=[Feature(geometry=input_polyline)])

arcgis.env.return_z = True
arcgis.env.return_m = True

pf = profile(input_line_features=input_feature_set,
			 dem_resolution='FINEST')

print(pf)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two steps were required:&lt;/P&gt;&lt;P&gt;1) The following lines had to be added, which set the environment variables for arcgis:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
arcgis.env.return_z = True
arcgis.env.return_m = True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Z and M values must be provided within the input geometry for each point, and adding in zeros is sufficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2021 18:50:58 GMT</pubDate>
    <dc:creator>Moe-Notos</dc:creator>
    <dc:date>2021-12-17T18:50:58Z</dc:date>
    <item>
      <title>Elevation Profile Does Not Return Z or M Values</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126486#M6911</link>
      <description>&lt;P&gt;I am attempting to retrieve an elevation profile for a local feature through the Python API.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;While the job executes successfully, the output does not contain any Z or M values (see below).&lt;BR /&gt;I have explored several approaches, such as loading in the toolbox manually, as well as attempting to find some place to specify returnZ = True.&lt;/P&gt;&lt;P&gt;Please advise how Z and M values could be retrieved.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.features.elevation import profile
from arcgis.features.feature import Feature, FeatureSet
from arcgis.geometry import Polyline

input_polyline = Polyline({
	"paths": [[[-73.609551, 45.490678], [-73.584162, 45.513645]]],
	"spatialReference": {
		"wkid": 4326
	}
})

input_feature_set = FeatureSet(
	features=[Feature(geometry=input_polyline)])

pf = profile(input_line_features=input_feature_set,
			 dem_resolution='FINEST',
			 maximum_sample_distance_units='Meters')

print(pf)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;{
    "displayFieldName": "",
    "features": [
        {
            "attributes": {
                "DEMResolution": "10m",
                "OBJECTID": 1,
                "ProductName": "NED_1r3_arcsec",
                "ProfileLength": 3233.121443184,
                "Shape_Length": 0.034235718815843016,
                "Source": "USGS",
                "Source_URL": "http://ned.usgs.gov"
            },
            "geometry": {
                "paths": [
                    [
                        [
                            -73.60955099984307,
                            45.49067799983942
                        ],
                        [
                            -73.60903285711129,
                            45.49114671393437
                        ],
                        [
                            -73.60851471437951,
                            45.49161542802932
                        ],
                        [
                            -73.60799657164767,
                            45.49208414302365
                        ],
                        [
                            -73.60747842801658,
                            45.492552857118596
                        ],
                        [
                            -73.6069602852848,
                            45.493021571213546
                        ],
                        [
                            -73.60644214255302,
                            45.493490285308496
                        ],
                        [
                            -73.60592399982119,
                            45.493959000302766
                        ],
                        [
                            -73.60540585708941,
                            45.49442771439777
                        ],
                        [
                            -73.60488771435763,
                            45.49489642849272
                        ],
                        [
                            -73.60436957162585,
                            45.49536514258767
                        ],
                        [
                            -73.6038514279947,
                            45.49583385668262
                        ],
                        [
                            -73.60333328526292,
                            45.49630257167689
                        ],
                        [
                            -73.60281514253114,
                            45.4967712857719
                        ],
                        [
                            -73.60229699979931,
                            45.49723999986685
                        ],
                        [
                            -73.60177885706753,
                            45.4977087139618
                        ],
                        [
                            -73.60126071433575,
                            45.49817742895607
                        ],
                        [
                            -73.60074257160397,
                            45.49864614305102
                        ],
                        [
                            -73.60022442797282,
                            45.499114857146026
                        ],
                        [
                            -73.59970628524104,
                            45.499583571240976
                        ],
                        [
                            -73.59918814250926,
                            45.500052285335926
                        ],
                        [
                            -73.59866999977748,
                            45.500521000330195
                        ],
                        [
                            -73.59815185704565,
                            45.500989714425145
                        ],
                        [
                            -73.59763371431387,
                            45.50145842852015
                        ],
                        [
                            -73.5971155715821,
                            45.5019271426151
                        ],
                        [
                            -73.59659742795094,
                            45.50239585760937
                        ],
                        [
                            -73.59607928521916,
                            45.50286457170432
                        ],
                        [
                            -73.59556114248738,
                            45.50333328579933
                        ],
                        [
                            -73.5950429997556,
                            45.50380199989428
                        ],
                        [
                            -73.59452485702377,
                            45.50427071488855
                        ],
                        [
                            -73.594006714292,
                            45.5047394289835
                        ],
                        [
                            -73.59348857156021,
                            45.50520814307845
                        ],
                        [
                            -73.59297042792912,
                            45.505676857173455
                        ],
                        [
                            -73.59245228519728,
                            45.506145571268405
                        ],
                        [
                            -73.5919341424655,
                            45.506614286262675
                        ],
                        [
                            -73.59141599973373,
                            45.507083000357625
                        ],
                        [
                            -73.59089785700195,
                            45.507551714452575
                        ],
                        [
                            -73.59037971427011,
                            45.50802042854758
                        ],
                        [
                            -73.58986157153834,
                            45.50848914354185
                        ],
                        [
                            -73.58934342790724,
                            45.5089578576368
                        ],
                        [
                            -73.5888252851754,
                            45.50942657173175
                        ],
                        [
                            -73.58830714244363,
                            45.5098952858267
                        ],
                        [
                            -73.58778899971185,
                            45.51036399992171
                        ],
                        [
                            -73.58727085698007,
                            45.51083271491598
                        ],
                        [
                            -73.58675271424823,
                            45.51130142901093
                        ],
                        [
                            -73.58623457151646,
                            45.51177014310588
                        ],
                        [
                            -73.58571642788536,
                            45.51223885720083
                        ],
                        [
                            -73.58519828515358,
                            45.512707572195154
                        ],
                        [
                            -73.58468014242175,
                            45.513176286290104
                        ],
                        [
                            -73.58416199968997,
                            45.513645000385054
                        ]
                    ]
                ],
                "spatialReference": {
                    "latestWkid": 4326,
                    "wkid": 4326
                }
            }
        }
    ],
    "fields": [
        {
            "alias": "OBJECTID",
            "name": "OBJECTID",
            "type": "esriFieldTypeOID"
        },
        {
            "alias": "DEM Resolution",
            "length": 50,
            "name": "DEMResolution",
            "type": "esriFieldTypeString"
        },
        {
            "alias": "Product Name",
            "length": 50,
            "name": "ProductName",
            "type": "esriFieldTypeString"
        },
        {
            "alias": "Source",
            "length": 50,
            "name": "Source",
            "type": "esriFieldTypeString"
        },
        {
            "alias": "Source URL",
            "length": 84,
            "name": "Source_URL",
            "type": "esriFieldTypeString"
        },
        {
            "alias": "Length Meters",
            "name": "ProfileLength",
            "type": "esriFieldTypeDouble"
        },
        {
            "alias": "Shape_Length",
            "name": "Shape_Length",
            "type": "esriFieldTypeDouble"
        }
    ],
    "geometryType": "esriGeometryPolyline",
    "objectIdFieldName": "OBJECTID",
    "spatialReference": {
        "latestWkid": 4326,
        "wkid": 4326
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 22:32:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126486#M6911</guid>
      <dc:creator>Moe-Notos</dc:creator>
      <dc:date>2021-12-15T22:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Elevation Profile Does Not Return Z or M Values</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126497#M6912</link>
      <description>&lt;P&gt;over what dem is the profile to extract the data?&lt;/P&gt;&lt;P&gt;arcgis.features.elevation.DataFile(....&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 23:03:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126497#M6912</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-15T23:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Elevation Profile Does Not Return Z or M Values</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126722#M6915</link>
      <description>&lt;P&gt;From my understanding, since I specified:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;dem_resolution='FINEST'&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;it determined that:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;"ProductName": "NED_1r3_arcsec"​&lt;/BLOCKQUOTE&gt;&lt;P&gt;should be used (located within the output). Additionally, the &lt;A href="https://developers.arcgis.com/rest/elevation/api-reference/profile.htm" target="_self"&gt;REST API Reference For profile&lt;/A&gt; (which from my understanding the python api implements) mentions that the data source can be auto selected or specified within the request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was attempting to follow the latest &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.elevation.html" target="_blank" rel="noopener"&gt;Python API Reference For arcgis.features.elevation&lt;/A&gt; as well as several sample notebooks, including &lt;A href="https://developers.arcgis.com/python/guide/using-geoprocessing-tools/" target="_self"&gt;Using Geoprocessing Tools&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;If there are other sources of documentation please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 16:01:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1126722#M6915</guid>
      <dc:creator>Moe-Notos</dc:creator>
      <dc:date>2021-12-16T16:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Elevation Profile Does Not Return Z or M Values</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1127274#M6916</link>
      <description>&lt;P&gt;I was able to retrieve the Z and M values using the following code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_polyline = Polyline({
	"paths": [[[-73.609551, 45.490678, 0, 0],
			   [-73.584162, 45.513645, 0, 0]]],
	"spatialReference": {
		"wkid": 4326
	}
})

input_feature_set = FeatureSet(
	features=[Feature(geometry=input_polyline)])

arcgis.env.return_z = True
arcgis.env.return_m = True

pf = profile(input_line_features=input_feature_set,
			 dem_resolution='FINEST')

print(pf)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two steps were required:&lt;/P&gt;&lt;P&gt;1) The following lines had to be added, which set the environment variables for arcgis:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
arcgis.env.return_z = True
arcgis.env.return_m = True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Z and M values must be provided within the input geometry for each point, and adding in zeros is sufficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 18:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/elevation-profile-does-not-return-z-or-m-values/m-p/1127274#M6916</guid>
      <dc:creator>Moe-Notos</dc:creator>
      <dc:date>2021-12-17T18:50:58Z</dc:date>
    </item>
  </channel>
</rss>

