[gdal-dev] gdal ogr with java

zeng xiaoxxcool at 163.com
Mon Mar 29 22:21:14 EDT 2010


Hi, buddies
      I am using gdal 1.7.1 with java banding, I got a problem when I run the follow code, there is no out put message. And I am sure the file exists, I have tried the relative code in c++, it works well. Any one knows why?
//ShpTest.java
import java.io.IOException;
import org.gdal.gdal.gdal;
import org.gdal.ogr.DataSource;
import org.gdal.ogr.ogr;
public class ShpTest {
    public static void main(String args[]) throws IOException {
        String filename="f:/test/shp/states.shp";
        gdal.AllRegister();        
        DataSource poDS = ogr.Open(filename);
        if(poDS == null)
        {
            System.out.println(gdal.GetLastErrorMsg());
            System.exit( 1 );
        }               
        System.out.println("test ok");
        poDS.delete();
    }        
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100330/c60c91c3/attachment.html


More information about the gdal-dev mailing list