|
POST
|
Had adding the doneLoadingListener allowed you to fix the issue? For detecting loading issues, you can look at the load status to see if it failed to load. I've updated my code to include a bad web address and reported the error in the console: // portal we want to use. NOTE the bad web address!
Portal portal = new Portal("chttp://www.arcgis.com/");
//trigger a load
portal.loadAsync();
// listen to it loading before reading
portal.addDoneLoadingListener(() -> {
// check is has loaded
if (portal.getLoadStatus() == LoadStatus.LOADED) {
// all is well and we can now read the portal info
System.out.println("waiting for it to load we get : " + portal.getPortalInfo().getPortalName());
}
// check for error condition
if (portal.getLoadStatus() == LoadStatus.FAILED_TO_LOAD) {
System.out.println("load failure message : " + portal.getLoadError().getMessage());
System.out.println("load failure cause " + portal.getLoadError().getCause());
}
});
... View more
05-06-2021
01:58 AM
|
0
|
0
|
1432
|
|
POST
|
I wonder if you are reading the portalInfo on the line of code which is after portal.loadAsync() ? It is entirely possible you will get a null value back because you've read the value before the portal has had chance to load. Some asynchronous coding which uses the loadable pattern will help you here, even it only helps to diagnose the issue. Some background notes on this are here. So in your example you should add a DoneLoadingListener something like this: // portal we want to use
Portal portal = new Portal("http://www.arcgis.com/");
//trigger a load
portal.loadAsync();
// listen to it loading before reading
portal.addDoneLoadingListener(() -> {
// check it is has loaded
if (portal.getLoadStatus() == LoadStatus.LOADED) {
// all is well and we can now read the portal info
System.out.println("waiting for it to load we get : " + portal.getPortalInfo().getPortalName());
}
}); You can also use the listener to diagnose loading issues. Does this help?
... View more
05-04-2021
04:11 AM
|
0
|
2
|
1441
|
|
BLOG
|
Although we often associate field data collection activities with mobile phones, it is still very common for these data collection exercises to be carried out using laptop computers. Being able to view your data on a larger screen with a more feature rich user interface is a common requirement for more complex use cases. When working with these types of application, it of course raises the question "how do I get my location?”. Most laptops do not natively have location devices such as GPS: this is where USB based GPS devices will help. In the background, these USB devices output serial streams of data known as NMEA (National Maritime Electronics Association) sentences. These sentences contain position, velocity and time information which can be decoded and used to show location and direction on a map application. The text below shows an example of some NMEA data from a GPS: $GPGSV,3,3,12,09,12,255,,20,12,068,,23,08,070,,10,03,099,*71 $GPRMC,185842.918,V,,,,,,,010321,,,N*4E $GPGGA,185843.918,,,,,0,00,,,M,0.0,M,,0000*55 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPRMC,185843.918,V,,,,,,,010321,,,N*4F $GPGGA,185844.915,,,,,0,00,,,M,0.0,M,,0000*5F $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPRMC,185844.915,V,,,,,,,010321,,,N*45 Once you are listening into this stream of data coming from your GPS device, we’ve made it easy for you to parse the sentences and turn them into a location which shows on your map. The full code for my application is in this git repository if you just wanted to pull it and try it out. I have however given an explanation of how it works so you can use this example effectively in your own app. I’ve left plenty of console output messages within the code so you can get a feel for what is happening, but I appreciate you will delete all this once you’ve see it working successfully. Starting from the very basics our app has a MapView class which is a JavaFX control which displays our Map. Next you will see I’ve created a NmeaLocationDataSource which is the class which will process the strings of data coming from the GPS device. This in turn is used to set the LocationDisplay on the map which is what draws the location marker for you. // make location data source and link to Location Display
nmeaLocationDataSource = new NmeaLocationDataSource();
mapView.getLocationDisplay().setLocationDataSource(nmeaLocationDataSource);
// start location data source and wait for it to be ready
nmeaLocationDataSource.startAsync();
nmeaLocationDataSource.addStartedListener(()-> {
gpsReader = new GPSReader(nmeaLocationDataSource);
}); Looks simple so far, but this is where the fun begins when we work out how to read the stream of data from the GPS device. As this is a Java application it could be working on Windows, Linux or Mac so for it to be properly functional as a cross platform application we need to choose our serial port reading techniques carefully. Unfortunately, the core Java libraries are not well equipped for the dark art of reading from serial ports (RS232 basically) but I did find a nice library which works for just this task and works cross platform too. Step forward the jSerialComm library! It’s pretty reliable and I’ve had it working successfully on my Mac and Windows machines. The jSerialComm library gives you the ability to list serial ports and for any serial port you can connect to, it will read byte streams from the port. In my code I start by going through each of the available ports to see if I can find a GPS device: private void startGPS() {
// try each available port in turn
for (SerialPort serialPort : SerialPort.getCommPorts()) {
System.out.println("detected port name " + serialPort.getSystemPortName());
PortChecker portChecker = new PortChecker(serialPort);
portChecker.start();
}
} When connecting to a port, you need to specify the serial port communication parameters such as the baud rate, data bits and stop bits. The challenge here is getting the parameters right for the device. For the majority of GPS devices, you can usually get away with: Baud rate: 4800 Data bits: 8 Stop bits: 1 Parity: 0 However, I’ve come across devices which use a different baud rate. If you get the baud rate wrong you can still connect to the port and read the byte stream, but the data you get out won’t be of much use. This is what I get when reading on my device with the wrong baud rate: ��������������x���`x`�~��f�x�x�xx�xx�~xx�x`x�x�x�x�x�`xx�x~x�xx�x�x�x�x`x�xx�x�xx�x�xx�x���~x�x��`x`�~��f�x�x�xx�xx�fxx�xx��x�x�`xx�xxx��xx�x�x�x�x�x��xx�xx�x�xx��~x`怘�`x`�~��f�x�x�xx�x�x�x�xxx��xx�xx�xx�x��x�xx�xx`x��x�xx�x�x���~x����`x`����xx�x�xx�x�xxx�x��������x�xxxx�x����`xx��`x`�~�`�xx�x�xx�x�xxx�����x�xx�`x�x����x�x����xxxxf~xx怘 You could blindly pass this data to the nmeaLocationDataSource, but you are unlikely to get any locations out of it! The technique I’ve used here to get the correct baud rate is to connect to each serial port and simply try out different baud rates to see if I get a valid NMEA sentence. If you can read the characters “$GP” at the start of your sentence you’ve got the correct baud rate. If you’ve been reading the port for a second and you get nothing or no sign of a “$GP” you can assume you’ve got it wrong and try another baud rate. I’ve not detailed the code in this blog, but this should give you enough information to understand how it works Once you’ve found a GPS device and you are listening into the stream of bytes you just need pass the bytes of data to the LocationDataSource and it will update your location display on the map: // send the data to the location data source for parsing
nmeaLocationDataSource.pushData(newData); And that’s it, as long as you are processing that NMEA data you’ll get a constantly updated location display which can be used for collecting new data or showing your position for routing for example. All this will be happening on a background thread so it will not be blocking your UI thread so your application will always remain responsive. Of course, when you do shut down your application you will need to close the connection to the USB port you have opened otherwise the background thread will not stop reading your GPS data and your application will not fully terminate. See the close method on the GpsReader class. /**
* Stops and releases all resources used in application.
*/
@Override
public void stop() {
if (gpsReader != null) gpsReader.close();
if (mapView != null) mapView.dispose();
} If this code which seeks out a serial port for a USB GPS device is of interest to lots of developers, I will consider adding this capability to our toolkit. Let me know this this would be of benefit to you.
... View more
05-04-2021
03:40 AM
|
2
|
0
|
7323
|
|
POST
|
It's very likely again that your drivers don't meet the OpenGL requirements to render a 3D scene. On the VM are you able to render a MapView based app? What happens when you query the graphics capabilities of the machine using glxinfo | grep "version" Also see the requirements here https://developers.arcgis.com/java/reference/system-requirements/ The SDK has been tested against SUSE, Ubuntu and Redhat. I've never tried centOS before but my understanding is this is very similar to Redhat. You do however need to have the correct OpenGL / shader support. As I explained some software based graphics drivers are not complete; drivers from the graphics card vendor are the best way forward. As you can see on my Ubuntu machine I have the correct nvidia drivers and I meet the requirements easily: OpenGL version string: 4.6.0 NVIDIA 390.141 OpenGL shading language version string: 4.60 NVIDIA
... View more
04-15-2021
06:19 AM
|
1
|
1
|
5196
|
|
POST
|
I suspect you need to update or install the drivers for your graphics card. Runtime apps running in Linux will need to create an openGL context and it looks like your drivers are not allowing it. If you can get a driver from the vendor of the chipset for your graphics card this will be best. My experience of open source software based drivers is not good. For example on my old Ubuntu machine I have the nVidia drivers and this works nicely. You can see how I've checked the openGL support and drivers below: ~$ glxinfo | grep "version"
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 390.141
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 390.141
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.141
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions, Does this help?
... View more
04-14-2021
12:18 PM
|
1
|
1
|
5207
|
|
POST
|
Tim, If you've got the geometry class for your graphic its easy to extract the points. I modified part of a sample to show constructing a line then showing code to get the points: /**
* Creates a Polyline and adds it to a GraphicsOverlay.
*/
private void createPolyline() {
// create a purple (0xFF800080) simple line symbol
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.DASH, 0xFF800080, 4);
// create a new point collection for polyline
PointCollection points = new PointCollection(SPATIAL_REFERENCE);
// create and add points to the point collection
points.add(new Point(-2.715, 56.061));
points.add(new Point(-2.6438, 56.079));
points.add(new Point(-2.638, 56.079));
points.add(new Point(-2.636, 56.078));
points.add(new Point(-2.636, 56.077));
points.add(new Point(-2.637, 56.076));
points.add(new Point(-2.715, 56.061));
// create the polyline from the point collection
Polyline polyline = new Polyline(points);
// create the graphic with polyline and symbol
Graphic graphic = new Graphic(polyline, lineSymbol);
// add graphic to the graphics overlay
graphicsOverlay.getGraphics().add(graphic);
// get the parts (if its simple there will be 1)
ImmutablePartCollection partCollection = polyline.getParts();
for (ImmutablePart part : partCollection) {
// loop through the points which make up the part
for (Point pt : part.getPoints()) {
System.out.println("x=" + pt.getX() + " y=" + pt.getY());
}
}
} You can't change a geometry as they are immutable, so you will need to create a new one each time you want to move it. Glad you've got some good performance improvements.
... View more
04-08-2021
10:20 AM
|
0
|
0
|
12748
|
|
POST
|
Hi Tim, Are you seeing any improvement in the speed of updates on the scene yet? In terms of differences between SceneView and MapView, I'd expect the scenes to be more demanding on the GPU and I'd not expect you to be able to push it as hard as a scene view in terms of the numbers of graphics. However I'd still expect it to cope with 1000s of graphics updating many times a second. Your requirement of 90 graphics a second is very achievable. As you say SceneViews are there for 3D capabilities and depending on how you render your graphics (ideally in dynamic mode) you will be able to see them rendered in the air with your Z value. This sample explains surface placement: https://github.com/Esri/arcgis-runtime-samples-java/tree/master/scene/surface-placement As an experiment I crudely swapped out my MapView for a SceneView and although I had to do a little more work with specifying the spatial reference it still performs quite well. import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.SpatialReferences;
import com.esri.arcgisruntime.mapping.ArcGISScene;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.Graphic;
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
import com.esri.arcgisruntime.mapping.view.SceneView;
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.view.MapView;
import java.util.*;
public class GraphicUpdating extends Application {
private SceneView mapView;
private GraphicsOverlay graphicsOverlay;
private SimpleMarkerSymbol markerSymbol;
private HashMap<String, Graphic> aircraftList;
private Timer timer;
@Override
public void start(Stage stage) {
try {
// create stack pane and application scene
BorderPane stackPane = new BorderPane();
Scene scene = new Scene(stackPane);
// set title, size, and add scene to stage
stage.setTitle("Graphic updating sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// authentication with an API key or named user is required to access basemaps and other location services
String yourAPIKey = System.getProperty("apiKey");
//ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
// create a map with the standard imagery basemap style
//ArcGISMap map = new ArcGISMap(Basemap.createOpenStreetMap());
ArcGISScene map = new ArcGISScene(Basemap.createStreets());
// create a map view and set the map to it
mapView = new SceneView();
mapView.setArcGISScene(map);
HBox hBox = new HBox();
stackPane.setTop(hBox);
stackPane.setCenter(mapView);
//symbols to be used
markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFF00FF00, 10);
//graphics overlay
graphicsOverlay = new GraphicsOverlay();
mapView.getGraphicsOverlays().add(graphicsOverlay);
//start timer for adding and moving graphics
StartGraphicController(10000);
} catch (Exception e) {
// on any error, display the stack trace.
e.printStackTrace();
}
}
private class Updater extends TimerTask {
private int maxGraphics;
private int numGraphics = 0;
private int updates = 0;
private Random random = new Random();
@Override
public void run() {
// add a new graphic after every 5 updates
if (updates++ == 4) {
updates = 0;
//check we've not reached the max
if (numGraphics < maxGraphics) {
//System.out.println("adding new");
numGraphics++;
// create a new graphic
Point pt = new Point(random.nextDouble() * 5000000, random.nextDouble() * 5000000, SpatialReferences.getWebMercator());
Graphic graphic = new Graphic(pt, markerSymbol);
graphicsOverlay.getGraphics().add(graphic);
UUID guid = UUID.randomUUID();
// add it to the hashmap
aircraftList.put(guid.toString(), graphic);
}
}
// loop through all aircraft and update them
for (String id : aircraftList.keySet()) {
MoveAircraft(id);
}
}
//constructor
public Updater(int maxGraphics) {
this.maxGraphics = maxGraphics;
System.out.println("constructor");
}
}
private void MoveAircraft(String id) {
//get graphic from the id
Graphic graphic = aircraftList.get(id);
// read current position
Point pos = (Point) graphic.getGeometry();
// new graphic
Point newPos = new Point(pos.getX() + 1000, pos.getY(), SpatialReferences.getWebMercator());
graphic.setGeometry(newPos);
}
private void StartGraphicController(int maxGraphics) {
aircraftList = new HashMap<>();
timer = new Timer();
Updater updater = new Updater(maxGraphics);
timer.schedule(updater,1000,20);
}
/**
* Stops and releases all resources used in application.
*/
@Override
public void stop() {
if (mapView != null) {
mapView.dispose();
}
timer.cancel();
}
/**
* Opens and runs application.
*
* @param args arguments passed to this application
*/
public static void main(String[] args) {
Application.launch(args);
}
}
... View more
04-07-2021
01:17 AM
|
0
|
1
|
12754
|
|
POST
|
If you run my app, it should give you confidence the rendering pipeline is very capable and with your 90 graphics every second update frequency it shouldn't be stressing anything. Try running my app to be sure. In my test app, the timer will be called on its own thread. As soon as the graphic is updated, our internal rendering pipeline will trigger a new image to be generated which is reflected on the MapView. You don't need to do anything like Platform.runlater when updating graphics; this will slow things down. It is designed for rapidly updating graphics so you can trigger an update as soon as you have the data. I'm wondering if you can decouple parts of your app to work out where the lag is caused. If you can swap parts out with code to simulate updates it might help narrow it down. I'd also have a look to see you don't have lots of activity on the UI thread of your JavaFX app. Any intensive data processing or code which causes delays due to network latency will make the UI of your app poor to respond.
... View more
04-05-2021
01:34 PM
|
0
|
0
|
12763
|
|
POST
|
Tim, I've had a quick look at your code and although I've not tried it, I do wonder if your method for looking for an existing graphic is going to work very quickly and if it will scale to lots of graphics. I can see how your use of the streams works, but I do think a quicker way to get to your graphics would help. Your architecture diagram makes sense and I've seen plenty of implementations like this. In my experience, the UDP feed with be a stream of messages giving updates for items where each item has a unique identifier. This unique identifier looks like ICAO in your implementation. So your workflow would be something like: - An update comes in for item XYZ - Check to see if there is a graphic for XYZ. If there is update it, if not add a new one. So in your app you need a super efficient way of getting the graphic associated with XYZ. Searching in the graphics then in the attributes isn't going to be quick if you've got lots of graphics, so I would use a HashMap like this: private HashMap<String, Graphic> aircraftList; The key of this can be used for your unique reference and its very fast to look this up and get the graphic. I've thrown together a crude app to show how this might work. The app gradually adds up to 10000 graphics and updates all the graphics every 20ms by getting hold of the graphic via the HashMap. package com.esri.samples.display_map;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.Graphic;
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.view.MapView;
import java.util.*;
public class GraphicUpdating extends Application {
private MapView mapView;
private GraphicsOverlay graphicsOverlay;
private SimpleMarkerSymbol markerSymbol;
private HashMap<String, Graphic> aircraftList;
private Timer timer;
@Override
public void start(Stage stage) {
try {
// create stack pane and application scene
BorderPane stackPane = new BorderPane();
Scene scene = new Scene(stackPane);
// set title, size, and add scene to stage
stage.setTitle("Graphic updating sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// authentication with an API key or named user is required to access basemaps and other location services
String yourAPIKey = System.getProperty("apiKey");
//ArcGISRuntimeEnvironment.setApiKey(yourAPIKey);
// create a map with the standard imagery basemap style
ArcGISMap map = new ArcGISMap(Basemap.createOpenStreetMap());
// create a map view and set the map to it
mapView = new MapView();
mapView.setMap(map);
HBox hBox = new HBox();
stackPane.setTop(hBox);
stackPane.setCenter(mapView);
//symbols to be used
markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFF00FF00, 10);
//graphics overlay
graphicsOverlay = new GraphicsOverlay();
mapView.getGraphicsOverlays().add(graphicsOverlay);
//start timer for adding and moving graphics
StartGraphicController(10000);
} catch (Exception e) {
// on any error, display the stack trace.
e.printStackTrace();
}
}
private class Updater extends TimerTask {
private int maxGraphics;
private int numGraphics = 0;
private int updates = 0;
private Random random = new Random();
@Override
public void run() {
// add a new graphic after every 5 updates
if (updates++ == 4) {
updates = 0;
//check we've not reached the max
if (numGraphics < maxGraphics) {
//System.out.println("adding new");
numGraphics++;
// create a new graphic
Point pt = new Point(random.nextDouble() * 5000000, random.nextDouble() * 5000000);
Graphic graphic = new Graphic(pt, markerSymbol);
graphicsOverlay.getGraphics().add(graphic);
UUID guid = UUID.randomUUID();
// add it to the hashmap
aircraftList.put(guid.toString(), graphic);
}
}
// loop through all aircraft and update them
for (String id : aircraftList.keySet()) {
MoveAircraft(id);
}
}
//constructor
public Updater(int maxGraphics) {
this.maxGraphics = maxGraphics;
System.out.println("constructor");
}
}
private void MoveAircraft(String id) {
//get graphic from the id
Graphic graphic = aircraftList.get(id);
// read current position
Point pos = (Point) graphic.getGeometry();
// new graphic
Point newPos = new Point(pos.getX() + 1000, pos.getY());
graphic.setGeometry(newPos);
}
private void StartGraphicController(int maxGraphics) {
aircraftList = new HashMap<>();
timer = new Timer();
Updater updater = new Updater(maxGraphics);
timer.schedule(updater,1000,20);
}
/**
* Stops and releases all resources used in application.
*/
@Override
public void stop() {
if (mapView != null) {
mapView.dispose();
}
timer.cancel();
}
/**
* Opens and runs application.
*
* @param args arguments passed to this application
*/
public static void main(String[] args) {
Application.launch(args);
}
} It's not a great bit of code, but you'll see its very fast to update and the UI remains responsive to panning and zooming whilst its updating up to 10000 graphics every 20ms.
... View more
04-05-2021
12:56 PM
|
0
|
0
|
12766
|
|
POST
|
I'm glad to hear you've managed to display a tif file which should give you confidence in your code. I'm happy to take a look at one of your files to see if I can see the issue. You just need to post it here or contact me directly to find a way of sharing it.
... View more
04-05-2021
10:30 AM
|
1
|
0
|
2429
|
|
POST
|
I suspect that this is failing as there was an issue loading the raster. The code above could be improved by checking the load status of the file before setting the view point. In my own app, I did the following: // set viewpoint on the raster
rasterLayer.addDoneLoadingListener(() -> {
// check to see if the file loaded
if (rasterLayer.getLoadStatus() == LoadStatus.LOADED) {
mapView.setViewpointGeometryAsync(rasterLayer.getFullExtent(), 150);
} else {
// it didn't load so let's examine the load errors outputting results from these methods:
rasterLayer.getLoadError().getMessage();
rasterLayer.getLoadError().getCause();
}
}); So output the errors to Logcat and see what is happening. It is possible you don't have permission to read the files from your local storage... Let me know if this helps. Thanks Mark
... View more
04-04-2021
11:08 AM
|
0
|
2
|
1745
|
|
POST
|
Hi Tim, I was keeping an eye open for your post as Kerry mentioned you had a question. With the number of graphics you are working with, dynamic rendering is fine. The display you show in the video above doesn't look very good and I certainly think there is lots of scope to improve this. To give you some hope, I have tests which allow 20,000 graphics all being updated every 20ms so I'm sure we can make this better. I'm trying to imagine the use-case here and can picture your app as receiving some feed of regular updates about your aircraft location. If these updates are coming in on a separate thread, you are fine with updating graphics away from the UI thread; this is quite safe. Usually the workflow I follow for this kind of rapidly updating app is: - Create an initial geometry for your aircraft location (a point for example) - Create a symbol - create a graphic passing in the symbol and the geometry - Then in a loop: -> read in the new location and create a new geometry (point). Remember Points and other geometries are immutable. -> apply the new point to the graphic and it will update the display If you wanted to share some code I'd be happy to make suggestions on how to improve it. Let me know if this helps. Mark
... View more
04-04-2021
10:44 AM
|
0
|
0
|
12780
|
|
POST
|
@VanyaIvanov it's not easy for me to see why this isn't working unless I can get a sample of your data. Can you post it on the forum, or if sharing your specific data isn't an option for you, then look me up here https://github.com/mbcoder and find a way of sharing the data with me. If I can get the data you are trying to display I should be able to find the issue.
... View more
04-01-2021
11:43 AM
|
1
|
0
|
2451
|
|
POST
|
When you say it doesn't work, how does this is not work? Does it load but not display, or just not load? Are you using the sample data I suggested? Maybe you can also provide more information like the version of SDK, OS, JDK etc so I can check things. This is what I'm seeing with this data. At the moment I can't see what's wrong here as for me as shown in a picture earlier in this thread it loads okay and I've seen it working on macOS and Windows.
... View more
03-31-2021
09:49 AM
|
1
|
1
|
4326
|
|
POST
|
Are you able to display the tif file which is used in this sample: https://github.com/Esri/arcgis-runtime-samples-java/tree/master/raster/raster-layer-file This will display the raster in a 2D MapView application, but you should be able to display this in a scene view too. I adapted your code sample above to zoom to the data so you don't have to find it: private void addCountrySurface()
{
Raster raster = new Raster("Shasta.tif");
RasterLayer rasterLayer = new RasterLayer(raster);
rasterLayer.addDoneLoadingListener(() -> {
if (rasterLayer.getLoadStatus() == LoadStatus.LOADED) {
System.out.println("raster added");
Envelope extent = rasterLayer.getFullExtent();
Viewpoint viewpoint = new Viewpoint(extent);
sceneView.setViewpoint(viewpoint);
} else {
System.out.println("Error");
}
});
scene.getOperationalLayers().add(rasterLayer);
} It is also worth noting that in 3D SceneView applications you need to be fairly zoomed in to see the raster layers, so maybe you are not seeing the raster data because you are too far zoomed out.
... View more
03-26-2021
06:05 AM
|
1
|
0
|
4361
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2026 01:35 AM | |
| 2 | 05-07-2026 06:59 AM | |
| 1 | 08-13-2024 05:17 AM | |
| 1 | 07-10-2024 01:50 AM | |
| 1 | 04-22-2024 01:21 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2026
06:46 AM
|