POST
|
I can send you a .ecw file if you'll write your email... as far as I understood it suppose to support .ecw. more than that- the full software support it for certain. the exception I keep getting: Java version : 1.7.0_45 (Oracle Corporation) x86 Rendering engine : DirectX java.lang.RuntimeException: java.lang.RuntimeException: Failed to open raster dataset: k5521.ecw. - Failed to open raster dataset: k5521.ecw. at com.esri.core.raster.FileRasterSource.<init>(Unknown Source) at NewMapUI.<init>(NewMapUI.java:42) at NewMapUI$2.run(NewMapUI.java:66) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Caused by: java.lang.RuntimeException: Failed to open raster dataset: k5521.ecw. - Failed to open raster dataset: k5521.ecw. at com.esri.core.raster.FileRasterSource.nativeCreate(Native Method) at com.esri.core.raster.FileRasterSource.<init>(Unknown Source) ... 16 more
... View more
02-27-2015
08:11 AM
|
0
|
2
|
1146
|
POST
|
its still doesn't work. I don't think it has anything to do with the full file path because the file is inside the folder of the project.
... View more
02-26-2015
09:58 PM
|
0
|
4
|
1146
|
POST
|
Hi, I'm new to ArcGIS SDK for Java and I'm basically trying to develop an app which use my own basemap (packed in .ecw format). What is missing is the code to create the layers of the the files i'm using. the code is: import ...
...
public class NewMapUI {
private JFrame window;
private JMap map;
public NewMapUI() {
window = new JFrame();
window.setSize(800, 600);
window.setLocationRelativeTo(null); // center on screen
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.getContentPane().setLayout(new BorderLayout(0, 0));
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent windowEvent) {
super.windowClosing(windowEvent);
map.dispose();
}
});
myLayers... //here is where my .ecw file needs to be rendered.
map = new JMap(myLayers);
window.getContentPane().add(map);
}
/**
* Starting point of this application.
* @param args
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
NewMapUI application = new NewMapUI();
application.window.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
... View more
02-26-2015
09:29 AM
|
0
|
0
|
2897
|
POST
|
it doesn't work, here is the whole code, what am I getting wrong? what needs to be the value in "rasterPath"? again: "k5221.ecw"? import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.FileNotFoundException;
import com.esri.runtime.ArcGISRuntime;
import com.esri.core.raster.FileRasterSource;
import com.esri.core.renderer.StretchParameters;
import com.esri.core.renderer.StretchParameters.StdDevStretchParameters;
import com.esri.core.renderer.StretchRenderer;
import com.esri.map.JMap;
import com.esri.map.MapOptions;
import com.esri.map.MapOptions.MapType;
import com.esri.map.RasterLayer;
public class newclass {
private JFrame window;
private JMap map;
public newclass() throws Exception {
window = new JFrame();
window.setSize(800, 600);
window.setLocationRelativeTo(null); // center on screen
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.getContentPane().setLayout(new BorderLayout(0, 0));
// dispose map just before application window is closed.
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent windowEvent) {
super.windowClosing(windowEvent);
map.dispose();
}
});
map = new JMap();
FileRasterSource rasterSource = new FileRasterSource("k5521.ecw");
StretchRenderer stretchRenderer = new StretchRenderer();
StdDevStretchParameters stretchParams = new StretchParameters.StdDevStretchParameters();
stretchParams.setStdDev(2.5f);
stretchRenderer .setStretchParameters(stretchParams);
RasterLayer rasterLayer = new RasterLayer(rasterSource);
rasterLayer.setRenderer(stretchRenderer );
rasterLayer.setName("k5521.ecw"); // Here file name is the your raster file name. e.g.= "k5521.ecw".
map.getLayers().add(rasterLayer);
window.getContentPane().add(map);
}
/**
* Starting point of this application.
* @param args
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
newclass application = new newclass();
application.window.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
... View more
02-26-2015
06:41 AM
|
0
|
6
|
1146
|
POST
|
what is the "rasterSource" you mentioned on the fifth line of the code?
... View more
02-26-2015
05:30 AM
|
0
|
8
|
1146
|
POST
|
Hi, I'm new to ArcGIS runtime sdk for java. I need my app to open my own base map that represented by about 6-7 .ecw files (including of course matching .aux files). How do I add a layer from .ecw file to JMap? I tried: JMap map = new JMap(); ... String rasterPath = "k5521.ecw"; //the file is in the folder of the project FileRasterSource rasterSource; try { rasterSource = new FileRasterSource(rasterPath); RasterLayer rasterLayer = new RasterLayer(rasterSource); map.getLayers().add(rasterLayer); } catch (IllegalArgumentException iex) { // handle exception } catch (FileNotFoundException fe) { // handle exception } catch (RuntimeException re) { // handle exception } and also: FileRasterSource rasterSource = new FileRasterSource("k5521.ecw"); rasterSource.project(map.getSpatialReference()); RasterLayer rasterLayer = new RasterLayer(rasterSource); map.getLayers().add(rasterLayer); what am I doing wrong?
... View more
02-26-2015
03:12 AM
|
0
|
10
|
6006
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|