<?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: Get the maximum hight of a 3D line? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/get-the-maximum-hight-of-a-3d-line/m-p/1033864#M60280</link>
    <description>&lt;P&gt;nan .... Not a Number&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/featureclasstonumpyarray.htm" target="_blank" rel="noopener"&gt;FeatureClassToNumPyArray—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;tokens will only return values if the&amp;nbsp;&lt;SPAN class="usertext"&gt;in_table&lt;/SPAN&gt;&amp;nbsp;contains point features and is m-aware (or z-aware). If the&amp;nbsp;&lt;SPAN class="usertext"&gt;in_table&lt;/SPAN&gt;&amp;nbsp;contains polygon, polyline, or multipart features,&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;will return a nan. Any feature class that is not m-aware or z-aware will not support&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;tokens.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Convert polyline or polygon features to a point featureclass first&lt;/P&gt;&lt;P&gt;then use &lt;STRONG&gt;explode_to_points=True&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FeatureClassToNumPyArray (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {skip_nulls}, {null_value})&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 11:23:42 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-03-08T11:23:42Z</dc:date>
    <item>
      <title>Get the maximum hight of a 3D line?</title>
      <link>https://community.esri.com/t5/python-questions/get-the-maximum-hight-of-a-3d-line/m-p/1033858#M60279</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to get the maximum hight of a line feature but it doesn't work with FeatureClassToNumPyArray?&lt;/P&gt;&lt;P&gt;I tried the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def Sperren_interpShape(self):

        arcpy.CheckOutExtension("3D")

        desc = arcpy.Describe(inSperren)

        outFC = "{0}_3D".format(desc.basename)
        method = "BILINEAR"
        # Execute InterpolateShape
        arcpy.ddd.InterpolateShape(inHights, inSperren, outFC, 
                                   "", "", method, True)
    
        arcpy.CheckInExtension("3D")

        arcpy.MakeFeatureLayer_management(outFC, outLyr) 
        with arcpy.da.SearchCursor(outLyr, "OBJECTID") as cursor:
            for row in cursor:
                print row[0]
                sel = "{} = {}".format("OBJECTID", row[0])
                print sel
                arcpy.SelectLayerByAttribute_management(outLyr, "NEW_SELECTION", sel)
                
                arr = arcpy.da.FeatureClassToNumPyArray(outLyr, ["OBJECTID", 'SHAPE@Z'])
                
                print arr
                print np.amax(arr.astype(np.float))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it only results in the following print statements:&lt;/P&gt;&lt;P&gt;1&lt;BR /&gt;OBJECTID = 1&lt;BR /&gt;[(1, nan)]&lt;BR /&gt;1.0&lt;/P&gt;&lt;P&gt;What does "nan" means? Are there better ways to get the maximum hight of a 3D line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working in 10.6.1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:05:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-maximum-hight-of-a-3d-line/m-p/1033858#M60279</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-03-08T11:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get the maximum hight of a 3D line?</title>
      <link>https://community.esri.com/t5/python-questions/get-the-maximum-hight-of-a-3d-line/m-p/1033864#M60280</link>
      <description>&lt;P&gt;nan .... Not a Number&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/featureclasstonumpyarray.htm" target="_blank" rel="noopener"&gt;FeatureClassToNumPyArray—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;tokens will only return values if the&amp;nbsp;&lt;SPAN class="usertext"&gt;in_table&lt;/SPAN&gt;&amp;nbsp;contains point features and is m-aware (or z-aware). If the&amp;nbsp;&lt;SPAN class="usertext"&gt;in_table&lt;/SPAN&gt;&amp;nbsp;contains polygon, polyline, or multipart features,&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;will return a nan. Any feature class that is not m-aware or z-aware will not support&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@M&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="usertext"&gt;SHAPE@Z&lt;/SPAN&gt;&amp;nbsp;tokens.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Convert polyline or polygon features to a point featureclass first&lt;/P&gt;&lt;P&gt;then use &lt;STRONG&gt;explode_to_points=True&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FeatureClassToNumPyArray (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {skip_nulls}, {null_value})&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-maximum-hight-of-a-3d-line/m-p/1033864#M60280</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-08T11:23:42Z</dc:date>
    </item>
  </channel>
</rss>

