1

I am new to the gdal scene so there might be a simple explanation for my problem. When executing ogrinfo from the command line there is a large list of supported formats.

    C:\OSGeo4W\bin>ogrinfo.exe --formats
    Supported Formats:
    "FileGDB" (read/write)
    "ESRI Shapefile" (read/write)
    "MapInfo File" (read/write)
    ...

However, when I run the equivalent command through the java bindings I get the following output:

    C:\OSGeo4W\bin>java -classpath ..\lib\gdal.jar;. ogrinfo --formats
    Supported Formats:
    "ESRI Shapefile" (read/write)
    "MapInfo File" (read/write)
    ...

Notice that the "FileGDB" driver doesn't appear when accessing gdal through the java bindings. Why are some of the gdal drivers not available with the java bindings? Is it a problem with my classpath and some of the driver dlls locations?

1 Answer 1

2

You need to set the GDAL_DRIVER_PATH environment variable to the path of the gdal plugins folder. It's been a while since I've used osgeo4w, but the plugins folder is generally a folder inside of the bin folder where the gdal binaries can be found.

You may also want to set the GDAL_DATA variable as well, which should point to the folder containing all of GDAL projection (proj.4) files. This will allow OGR to reproject data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.