<?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: How to get elevation from the MapView in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1546625#M431</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/710993"&gt;@imbachb&lt;/a&gt;. No problem! Not off topic yet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The load() method should not be blocking (though it might take some time to open and load all 3,000 files, but that should happen in the background). If you're stepping through in the debugger, that might have something to do with it. Can you set a breakpoint &lt;EM&gt;after&lt;/EM&gt; the load rather than stepping through it? Or try the app without the debugger.&lt;/P&gt;
&lt;P&gt;If that doesn't show things working as expected, then we &lt;EM&gt;are&lt;/EM&gt; starting to get off topic here so could I ask you to pose the question about RasterElevationSource load() blocking over in the &lt;A href="https://community.esri.com/t5/qt-maps-sdk-questions/bd-p/arcgis-runtime-sdk-for-qt-questions" target="_self"&gt;Qt forum&lt;/A&gt; please?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2024 16:17:51 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2024-10-08T16:17:51Z</dc:date>
    <item>
      <title>How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1543493#M407</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a question regarding elevation using the MapView in the ArcGIS SDK for Swift.&lt;/P&gt;&lt;P&gt;My use case is: when long pressing on the map, I would like to display a sheet with details about that location, including elevation data.&lt;/P&gt;&lt;P&gt;To accomplish this, I am currently adding a hidden SceneView behind the MapView. I then configure the scene with a base surface using a world elevation source. To synchronize the scene's viewpoint with the map, I listen for viewpoint changes on the map and continuously apply them to the scene. Then when the user long presses on the MapView, I get the elevation from the scene using:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;let elevation = try? await scene.baseSurface.elevation(at: point)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This works, but has performance and memory implications.&lt;/P&gt;&lt;P&gt;Is there a way to get elevation information for a point only using the MapView?&lt;/P&gt;&lt;P&gt;For reference, I am using SwiftUI in Xcode 16, with arcgis-maps-sdk-swift version is 200.5.1.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 16:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1543493#M407</guid>
      <dc:creator>IgnisDev</dc:creator>
      <dc:date>2024-09-27T16:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1543607#M411</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/820709"&gt;@IgnisDev&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Thank you for reaching out with your query. There are a couple of possible approaches you could try out. I'm laying out both of those for you to make the best choice for your needs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Option 1:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You could query the world elevation service for every point that you get from your map to get the elevation for the point. &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-know-the-altitude-of-a-point/td-p/1475359" target="_self"&gt;Here&lt;/A&gt; is a post that shows how to achieve that. As the post describes, there is a possibility that you could get some inconsistent results based on the context.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Option 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We have a new service, which is in Beta at the moment. &lt;A href="https://developers.arcgis.com/rest/elevation-service/" target="_self"&gt;Here&lt;/A&gt; are the details of the service and &lt;A href="https://www.esri.com/arcgis-blog/products/platform/developers/new-arcgis-location-services-beta-program-for-static-basemap-tiles-and-elevation-services/" target="_self"&gt;here&lt;/A&gt; is a blogpost showing the usage for it. This should work for the case you mentioned but as I mentioned, it is in&amp;nbsp; Beta and we would like you to join the &lt;A href="https://earlyadopter.esri.com/key/locationservices-elevation" target="_self"&gt;Early Adopter Program&lt;/A&gt; and provide us some feedback on it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We hope either of these approaches would help with your performance problems of your app as long as you are querying in an async fashion. I hope this helps. Please keep us posted and let us know if these don't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Koushik&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2024 01:33:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1543607#M411</guid>
      <dc:creator>KoushikHajra</dc:creator>
      <dc:date>2024-09-28T01:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1544161#M415</link>
      <description>&lt;P&gt;In our case our app also has to run offline so we could not rely on ESRI's APIs.&lt;/P&gt;&lt;P&gt;Instead, we created a raster layer with elevation data (for example based on DTED or tif) and then called `identify` to receive the stored raster cell value at a specific location, similar to how it is done in this example:&lt;A href="https://developers.arcgis.com/swift/sample-code/identify-raster-cell/" target="_blank" rel="noopener"&gt;Identify raster cell | ArcGIS Maps SDK for Swift | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To make the raster layer "invisible" (it must be visible otherwise identify won't work) we set its opacity to 0.00001.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 11:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1544161#M415</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2024-10-01T11:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1545444#M426</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/710993"&gt;@imbachb&lt;/a&gt; (this might also be of interested to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/820709"&gt;@IgnisDev&lt;/a&gt;).&lt;/P&gt;
&lt;P&gt;What you're doing is reasonable, but we do have APIs that can make it much easier for you.&lt;/P&gt;
&lt;P&gt;What you need to do is create a standalone &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/surface" target="_self"&gt;&lt;STRONG&gt;Surface&lt;/STRONG&gt;&lt;/A&gt;. You can add 1 or more &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/elevationsource" target="_self"&gt;&lt;STRONG&gt;ElevationSources&lt;/STRONG&gt;&lt;/A&gt; to it, where an &lt;STRONG&gt;ElevationSource&lt;/STRONG&gt; can be an &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/arcgistiledelevationsource/" target="_self"&gt;&lt;STRONG&gt;ArcGISTiledElevationSource&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;(using a service or a local TPK/TPKX file), or it can be a &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/rasterelevationsource/" target="_self"&gt;&lt;STRONG&gt;RasterElevationSource&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;(which can use one or more local DTED files).&lt;/P&gt;
&lt;P&gt;Please note: when using a standalone &lt;STRONG&gt;Surface&lt;/STRONG&gt; like this, you do currently need to explicitly load each of its &lt;STRONG&gt;ElevationSources&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Here's some sample Swift code (though you would use a &lt;STRONG&gt;RasterElevationSource&lt;/STRONG&gt; instead)…&lt;/P&gt;
&lt;LI-CODE lang="swift"&gt;let surface: Surface = {
    let surface = Surface()
    
    let worldElevationServiceURL = URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")!
    let elevationSource = ArcGISTiledElevationSource(url: worldElevationServiceURL)
    surface.addElevationSource(elevationSource)

    Task {
        await surface.elevationSources.load()
        let failedSources = surface.elevationSources.filter({ $0.loadStatus == .failed })
        for source in failedSources {
            print("Elevation source \(source) failed to load: \(String(describing: source.loadError))")
        }
    }
    
    return surface
}()&lt;/LI-CODE&gt;
&lt;P&gt;and you can then call it with something like this…&lt;/P&gt;
&lt;LI-CODE lang="swift"&gt;let elevationAtPoint = try await surface.elevation(at: mapPoint)&lt;/LI-CODE&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 23:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1545444#M426</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2024-10-03T23:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1546420#M430</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/176"&gt;@Nicholas-Furness&lt;/a&gt;, many thanks for your insight. We did in fact not realise that we can use the Surface object as is, without adding it to a SceneView. Your approach is definitely more straight forward than our workaround.&lt;/P&gt;&lt;P&gt;One thing we noticed: The &lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-rasterelevationsource.html" target="_self"&gt;RasterElevationSource Class | ArcGIS Maps SDK for Qt&lt;/A&gt;&amp;nbsp;load() function seems to be a blocking call. We have around 3k *.dt2 files that we'd like to use for our elevation data. The initial load causes the application to freeze for ~10 seconds while the debugger stays on the same line of code. We assume it's because ArcGIS indexes all these files first.&lt;/P&gt;&lt;P&gt;We'd like to be able to switch between maps with different elevation sources within our application but the freezing impacts the UX negatively. In our workaround with the elevation layer we used a&amp;nbsp;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mosaicdatasetraster.html" target="_self"&gt;MosaicDatasetRaster Class | ArcGIS Maps SDK for Qt&lt;/A&gt;&amp;nbsp;which didn't have this issue.&lt;BR /&gt;We use ArcGIS SDK for Qt though, sorry if it is off topic here.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 08:06:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1546420#M430</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2024-10-08T08:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1546625#M431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/710993"&gt;@imbachb&lt;/a&gt;. No problem! Not off topic yet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The load() method should not be blocking (though it might take some time to open and load all 3,000 files, but that should happen in the background). If you're stepping through in the debugger, that might have something to do with it. Can you set a breakpoint &lt;EM&gt;after&lt;/EM&gt; the load rather than stepping through it? Or try the app without the debugger.&lt;/P&gt;
&lt;P&gt;If that doesn't show things working as expected, then we &lt;EM&gt;are&lt;/EM&gt; starting to get off topic here so could I ask you to pose the question about RasterElevationSource load() blocking over in the &lt;A href="https://community.esri.com/t5/qt-maps-sdk-questions/bd-p/arcgis-runtime-sdk-for-qt-questions" target="_self"&gt;Qt forum&lt;/A&gt; please?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 16:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1546625#M431</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2024-10-08T16:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1547145#M436</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/176"&gt;@Nicholas-Furness&lt;/a&gt;&amp;nbsp;Thank you for the reply.&lt;BR /&gt;To us it does seem like the load function is at least partly blocking (maybe blocking is not the right terminology here):&lt;BR /&gt;I wrapped the load function between two `std::chrono::high_resolution_clock::now()` which results in a more than 10 seconds time difference.&lt;BR /&gt;I've created a new thread about this in the qt section:&amp;nbsp;&lt;A href="https://community.esri.com/t5/qt-maps-sdk-questions/rasterelevationsource-load-function-seems-to-be-a/m-p/1547142#M5324" target="_blank" rel="noopener"&gt;RasterElevationSource load() function seems to be ... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 16:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1547145#M436</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2024-10-09T16:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get elevation from the MapView</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1547176#M437</link>
      <description>&lt;P&gt;Yeah, the app should remain responsive while those 3000 files are opened (except perhaps when you're stepping through in the debugger). Thanks for opening that other issue. That's the best way to get feedback on this issue.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 16:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/how-to-get-elevation-from-the-mapview/m-p/1547176#M437</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2024-10-09T16:41:41Z</dc:date>
    </item>
  </channel>
</rss>

