<?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 elevtion at point on the screen in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021399#M2298</link>
    <description>&lt;P&gt;Java arcgis docs returns 404 error! and i didn't find java code examples&amp;nbsp;&lt;/P&gt;&lt;P&gt;If somebody is interested in how to get elevation and coordinates by mouse click on the scene(map)&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt;public void start(Stage stage) {&lt;BR /&gt;StackPane stackPane = new StackPane();&lt;BR /&gt;Scene scene = new Scene(stackPane);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;stage.setTitle("Map");&lt;BR /&gt;stage.setWidth(600);&lt;BR /&gt;stage.setHeight(350);&lt;BR /&gt;stage.setScene(scene);&lt;BR /&gt;stage.show();&lt;/P&gt;&lt;P&gt;sceneView = new SceneView();&lt;BR /&gt;setupScene();&lt;BR /&gt;addTrailheadsLayer();&lt;BR /&gt;addElevationData();&lt;BR /&gt;sceneView.setInteractionListener(new DefaultInteractionListener(sceneView)&lt;BR /&gt;{&lt;BR /&gt;public void onMousePressed(javafx.scene.input.MouseEvent e)&lt;BR /&gt;{&lt;BR /&gt;javafx.geometry.Point2D screenPoint = new javafx.geometry.Point2D(Math.round(e.getX()),&lt;BR /&gt;Math.round(e.getY()));&lt;BR /&gt;com.esri.arcgisruntime.geometry.Point surfacePoint = sceneView.screenToBaseSurface(screenPoint);&lt;BR /&gt;JOptionPane.showMessageDialog(null, "Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;stackPane.getChildren().add(sceneView);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all libraries i used:&lt;/P&gt;&lt;P&gt;import javafx.application.Application;&lt;BR /&gt;import javafx.scene.Scene;&lt;BR /&gt;import javafx.scene.*;&lt;BR /&gt;import javafx.scene.layout.StackPane;&lt;BR /&gt;import javafx.stage.Stage;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import java.util.Arrays;&lt;BR /&gt;import java.awt.*;&lt;BR /&gt;import java.awt.Point;&lt;BR /&gt;import java.util.ArrayList;&lt;BR /&gt;import java.util.concurrent.ExecutionException;&lt;BR /&gt;import java.lang.*;&lt;/P&gt;&lt;P&gt;import javax.swing.JOptionPane;&lt;/P&gt;&lt;P&gt;import com.esri.arcgisruntime.concurrent.ListenableFuture;&lt;BR /&gt;import com.esri.arcgisruntime.data.ServiceFeatureTable;&lt;BR /&gt;import com.esri.arcgisruntime.layers.FeatureLayer;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.ArcGISScene;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.Basemap;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.Camera;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.SceneView;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.SceneView.DefaultInteractionListener;&lt;BR /&gt;import com.esri.arcgisruntime.layers.ArcGISTiledLayer;&lt;BR /&gt;import com.esri.arcgisruntime.data.TileCache;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.Surface;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.RasterElevationSource;&lt;BR /&gt;import com.esri.arcgisruntime.geometry.*;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 06:23:32 GMT</pubDate>
    <dc:creator>VanyaIvanov</dc:creator>
    <dc:date>2021-01-29T06:23:32Z</dc:date>
    <item>
      <title>Get elevtion at point on the screen of the scene</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021209#M2297</link>
      <description>&lt;P&gt;How can i get elevation at some point on the screen of the scene using Java SDK?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 06:25:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021209#M2297</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-01-29T06:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get elevtion at point on the screen</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021399#M2298</link>
      <description>&lt;P&gt;Java arcgis docs returns 404 error! and i didn't find java code examples&amp;nbsp;&lt;/P&gt;&lt;P&gt;If somebody is interested in how to get elevation and coordinates by mouse click on the scene(map)&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt;public void start(Stage stage) {&lt;BR /&gt;StackPane stackPane = new StackPane();&lt;BR /&gt;Scene scene = new Scene(stackPane);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;stage.setTitle("Map");&lt;BR /&gt;stage.setWidth(600);&lt;BR /&gt;stage.setHeight(350);&lt;BR /&gt;stage.setScene(scene);&lt;BR /&gt;stage.show();&lt;/P&gt;&lt;P&gt;sceneView = new SceneView();&lt;BR /&gt;setupScene();&lt;BR /&gt;addTrailheadsLayer();&lt;BR /&gt;addElevationData();&lt;BR /&gt;sceneView.setInteractionListener(new DefaultInteractionListener(sceneView)&lt;BR /&gt;{&lt;BR /&gt;public void onMousePressed(javafx.scene.input.MouseEvent e)&lt;BR /&gt;{&lt;BR /&gt;javafx.geometry.Point2D screenPoint = new javafx.geometry.Point2D(Math.round(e.getX()),&lt;BR /&gt;Math.round(e.getY()));&lt;BR /&gt;com.esri.arcgisruntime.geometry.Point surfacePoint = sceneView.screenToBaseSurface(screenPoint);&lt;BR /&gt;JOptionPane.showMessageDialog(null, "Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;stackPane.getChildren().add(sceneView);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all libraries i used:&lt;/P&gt;&lt;P&gt;import javafx.application.Application;&lt;BR /&gt;import javafx.scene.Scene;&lt;BR /&gt;import javafx.scene.*;&lt;BR /&gt;import javafx.scene.layout.StackPane;&lt;BR /&gt;import javafx.stage.Stage;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import java.util.Arrays;&lt;BR /&gt;import java.awt.*;&lt;BR /&gt;import java.awt.Point;&lt;BR /&gt;import java.util.ArrayList;&lt;BR /&gt;import java.util.concurrent.ExecutionException;&lt;BR /&gt;import java.lang.*;&lt;/P&gt;&lt;P&gt;import javax.swing.JOptionPane;&lt;/P&gt;&lt;P&gt;import com.esri.arcgisruntime.concurrent.ListenableFuture;&lt;BR /&gt;import com.esri.arcgisruntime.data.ServiceFeatureTable;&lt;BR /&gt;import com.esri.arcgisruntime.layers.FeatureLayer;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.ArcGISScene;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.Basemap;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.Camera;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.SceneView;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.view.SceneView.DefaultInteractionListener;&lt;BR /&gt;import com.esri.arcgisruntime.layers.ArcGISTiledLayer;&lt;BR /&gt;import com.esri.arcgisruntime.data.TileCache;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.Surface;&lt;BR /&gt;import com.esri.arcgisruntime.mapping.RasterElevationSource;&lt;BR /&gt;import com.esri.arcgisruntime.geometry.*;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 06:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021399#M2298</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-01-29T06:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get elevtion at point on the screen of the scene</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021424#M2299</link>
      <description>&lt;P&gt;Yes this is possible and I can think of a couple of options depending on if you are working on a 2D map (MapView), or a 3D scene (SceneView).&lt;/P&gt;&lt;P&gt;Both approaches will need some sort of elevation data which often comes in a raster format (DEM data) where the raster cell values are set to a value related to height instead of a color map.&lt;/P&gt;&lt;P&gt;You can perform an identify operation on your layer which contains the elevation data to get the result.&lt;/P&gt;&lt;P&gt;There is a sample which shows a raster identify operation on a mouse move here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/raster/identify-raster-cell" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-java/tree/master/raster/identify-raster-cell&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The data here I don't believe is DEM data, but it shows you how it works.&lt;/P&gt;&lt;P&gt;If you are writing a 3D scene based application, there are specific methods for getting the elevation of a surface.&amp;nbsp; This sample demonstrates this nicely:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/scene/get-elevation-at-a-point" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-java/tree/master/scene/get-elevation-at-a-point&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you take a look at the&amp;nbsp;&lt;SPAN&gt;getElevationAsync method in the sample you will see where the elevation is obtained.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does this help?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 08:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/get-elevtion-at-point-on-the-screen-of-the-scene/m-p/1021424#M2299</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-01-29T08:54:03Z</dc:date>
    </item>
  </channel>
</rss>

