3

I am trying to read a GDAL VRT file.

I have included

    <!-- VRT Format (reader) -->
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-imageio-ext-gdal</artifactId>
        <version>${geotools.version}</version>
    </dependency>

and I have these files:

VRTFormat
VRTFormatFactory
VRTReader

https://github.com/geotools/geotools/tree/669897d2778dab8c31e7ad97bf16ae02e885bfa1/modules/plugin/imageio-ext-gdal/src/main/java/org/geotools/coverageio/gdal/vrt

but

 AbstractGridFormat format = GridFormatFinder.findFormat("...");
 GridCoverage2DReader reader = format.getReader("...");

causes Exception

Trying to get a reader from an unknown format.
java.lang.UnsupportedOperationException: Trying to get a reader from an unknown format.
    at org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.java:62)

how to enable GeoTools to find the respective VRT reader?

  • do you have imageio installed? specifically, you need it.geosolutions.imageio.plugins.vrt.VRTImageReaderSpi – Ian Turton Nov 27 '17 at 8:56
  • yes, I have it.geosolutions.imageio.plugins.vrt.VRTImageReaderSpi – Antonio Nov 27 '17 at 9:15
  • how are you building and running your app? – Ian Turton Nov 27 '17 at 9:15
  • Maven: I have included all dependecies including the gt-imageio-ext-gdal – Antonio Nov 27 '17 at 9:16
  • turn logging up to Fine - I'm seeing "java.lang.NoClassDefFoundError: Could not initialize class org.gdal.gdalconst.gdalconstConstants" – Ian Turton Nov 27 '17 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.