Java impossible to import class GridCoverage from Geotools

124
February 15, 2021, at 3:00 PM

I'm trying to import some class from Geotools but its seems objects are not recognize:

public Coverage() {
        File file = new File("test.tiff");
        AbstractGridFormat format = GridFormatFinder.findFormat(file);
        GridCoverage2DReader reader = format.getReader(file);
        GridCoverage2D coverage = reader.read(null);
    }

I already import this lib :

geotools_version = '25'
implementation "org.geotools:gt-coverage:${geotools_version}"

Source : https://docs.geotools.org/latest/userguide/library/coverage/grid.html

Answer 1

In case of build.gradle, use the following.

In case of higher version of gradle like 6, use below.

implementation 'org.geotools:gt-coverage:24.2'

In case of lower version of gradle like 4, use the below.

compile group: 'org.geotools', name: 'gt-coverage', version: '24.2'

After making changes, use your favorite ide, refresh the gradle project. Once it is done, you will be able to import the class.

READ ALSO
ViewModel vs Activity member variable?

ViewModel vs Activity member variable?

Going by this image, the lifecycle of a ViewModel is pretty much like that of an Activity instance, so why not just use an activity instance variable? Is a ViewModel better because of the automatic call to onClear? Or because it is observable (in which case why not just have observable,...

123
UnicodeError 'idna' encoding when working with Heroku, Redis and Flask

UnicodeError 'idna' encoding when working with Heroku, Redis and Flask

I have a Flask REST API hosted on Heroku with a Heroku-Redis server

159
Why is this happening? I'm getting correct display in console output and right amount of rows in UI but I'm getting no outputs

Why is this happening? I'm getting correct display in console output and right amount of rows in UI but I'm getting no outputs

So I have this problem with displaying phone numbers for userConsole output is displaying numbers, and my user interface is displaying the right amount of rows but not numbers themselves

143