<?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 elevation Profile intersection values not in order? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/elevation-profile-intersection-values-not-in-order/m-p/1571342#M86295</link>
    <description>&lt;P&gt;Hello all!&lt;/P&gt;&lt;P&gt;I am using geometryEngine to intersect/extract values from an existing polygon graticule of elevation values, and put those values into an array and into a 'chartjs' stacked bar chart to show an elevation profile.&lt;/P&gt;&lt;P&gt;I've got the values I need, from console inspection,&amp;nbsp; but they are not in directional order?&amp;nbsp; they seem random?&lt;/P&gt;&lt;P&gt;as you can see from the thumbnails included,&amp;nbsp; as a test, I am creating the profile over high mountains and into a flat low plain.&amp;nbsp; &amp;nbsp;the elevation trend should look similar to the profile i created in ArcPro(2nd image) but they show up in random order along the intersect line(1st image).&amp;nbsp; &amp;nbsp;altho the values are correct.&lt;/P&gt;&lt;P&gt;I am using a SketchViewModel polyline to draw the temporary profile line of interest.&amp;nbsp; disregard the stacked colored subsurface geology bars, only the TOP bar value(surf/topsurf) should be the ground/surface elevation value.&lt;/P&gt;&lt;P&gt;here is a snippet of my code.&amp;nbsp; is there a way to make the intersection polyline read from start node to end node(left to right)?&amp;nbsp; Would there need to be some 'Sorting' of the geometry intersections?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    var surf = [];
    var bed = [];
    var base = [];

const query = surfaceLayer.createQuery();
  query.where = "1=1";
  query.geometry = lineGeom
  query.spatialRelationship = "intersects";
  query.returnGeometry = true;
  query.outFields = ["LandSurf_elev_m","topBedrx_alt_m","topBsmt_alt_m","OBJECTID"]; 

  surfaceLayer.queryFeatures(query).then(function(result) {

    result.features.forEach(function(feature) {
      if (geometryEngine.intersects(lineGeom, feature.geometry)) {
        var topsurf  = parseInt(feature.attributes.LandSurf_elev_m); 
        var topbed = parseInt(feature.attributes.topBedrx_alt_m); 
        var topbase =  parseInt(feature.attributes.topBsmt_alt_m);
          
          surf.push([topbed, topsurf]);
          bed.push([topbase, topbed]);
          base.push([topbase + -500, topbase]);
          
      }
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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="Paco_0-1735232835539.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122447i1422C6F48B4099C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paco_0-1735232835539.png" alt="Paco_0-1735232835539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paco_0-1735233472334.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122449i67C61AF62B89AC6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paco_0-1735233472334.png" alt="Paco_0-1735233472334.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Dec 2024 21:31:31 GMT</pubDate>
    <dc:creator>Paco</dc:creator>
    <dc:date>2024-12-26T21:31:31Z</dc:date>
    <item>
      <title>elevation Profile intersection values not in order?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/elevation-profile-intersection-values-not-in-order/m-p/1571342#M86295</link>
      <description>&lt;P&gt;Hello all!&lt;/P&gt;&lt;P&gt;I am using geometryEngine to intersect/extract values from an existing polygon graticule of elevation values, and put those values into an array and into a 'chartjs' stacked bar chart to show an elevation profile.&lt;/P&gt;&lt;P&gt;I've got the values I need, from console inspection,&amp;nbsp; but they are not in directional order?&amp;nbsp; they seem random?&lt;/P&gt;&lt;P&gt;as you can see from the thumbnails included,&amp;nbsp; as a test, I am creating the profile over high mountains and into a flat low plain.&amp;nbsp; &amp;nbsp;the elevation trend should look similar to the profile i created in ArcPro(2nd image) but they show up in random order along the intersect line(1st image).&amp;nbsp; &amp;nbsp;altho the values are correct.&lt;/P&gt;&lt;P&gt;I am using a SketchViewModel polyline to draw the temporary profile line of interest.&amp;nbsp; disregard the stacked colored subsurface geology bars, only the TOP bar value(surf/topsurf) should be the ground/surface elevation value.&lt;/P&gt;&lt;P&gt;here is a snippet of my code.&amp;nbsp; is there a way to make the intersection polyline read from start node to end node(left to right)?&amp;nbsp; Would there need to be some 'Sorting' of the geometry intersections?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    var surf = [];
    var bed = [];
    var base = [];

const query = surfaceLayer.createQuery();
  query.where = "1=1";
  query.geometry = lineGeom
  query.spatialRelationship = "intersects";
  query.returnGeometry = true;
  query.outFields = ["LandSurf_elev_m","topBedrx_alt_m","topBsmt_alt_m","OBJECTID"]; 

  surfaceLayer.queryFeatures(query).then(function(result) {

    result.features.forEach(function(feature) {
      if (geometryEngine.intersects(lineGeom, feature.geometry)) {
        var topsurf  = parseInt(feature.attributes.LandSurf_elev_m); 
        var topbed = parseInt(feature.attributes.topBedrx_alt_m); 
        var topbase =  parseInt(feature.attributes.topBsmt_alt_m);
          
          surf.push([topbed, topsurf]);
          bed.push([topbase, topbed]);
          base.push([topbase + -500, topbase]);
          
      }
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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="Paco_0-1735232835539.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122447i1422C6F48B4099C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paco_0-1735232835539.png" alt="Paco_0-1735232835539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paco_0-1735233472334.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122449i67C61AF62B89AC6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paco_0-1735233472334.png" alt="Paco_0-1735233472334.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 21:31:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/elevation-profile-intersection-values-not-in-order/m-p/1571342#M86295</guid>
      <dc:creator>Paco</dc:creator>
      <dc:date>2024-12-26T21:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: elevation Profile intersection values not in order?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/elevation-profile-intersection-values-not-in-order/m-p/1571348#M86296</link>
      <description>&lt;P&gt;..I also just noticed that I may not even need 'geometryEngine.intersects' for this?&amp;nbsp; the Query/spatialRelationship = "intersects" seems to do the same thing without it?&amp;nbsp; &amp;nbsp; ..but the problem persists.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 18:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/elevation-profile-intersection-values-not-in-order/m-p/1571348#M86296</guid>
      <dc:creator>Paco</dc:creator>
      <dc:date>2024-12-26T18:12:29Z</dc:date>
    </item>
  </channel>
</rss>

