From: Mats H. <ma...@he...> - 2003-06-12 05:42:30
|
Here is my code: String file = "F:/upl/build/maps/world"; URL url = new URL("file://" + file); ShapefileReader reader = new ShapefileReader(url); Theme t = reader.getTheme(); GeoData[] data = reader.readData(); for (int i = 0; i < data.length; i++) { t.setGeoData(data[i]); } // Works fine until here ShapefileWriter writer = new ShapefileWriter("map", t); This is what I get: [junit] ------------- Standard Error ----------------- [junit] Sfh->WARNING filecode 57019402 not a match for documented shapefile code 9994 [junit] ------------- ---------------- --------------- [junit] Testcase: testShapefileReadWrite(info.codeq.upl.test.MapTest): Caused an ERROR [junit] null [junit] java.lang.ClassCastException [junit] at uk.ac.leeds.ccg.geotools.ShapefileWriter.init(Unknown Source) [junit] at uk.ac.leeds.ccg.geotools.ShapefileWriter.<init>(Unknown Sourc e) [junit] at info.codeq.upl.test.MapTest.testShapefileReadWrite(MapTest.ja va:55) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces sorImpl.java:39) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet hodAccessorImpl.java:25) Anyone with a clue? That warning should be benign, because reading works fine in my applet. Mats |