I'm trying to use GeoTools library to calculate the grid coverage based on NTv2 .gsb file.

However, I'm unable to create the instance of NTv2Transform.

When I use this piece of code:

File gridFile = new File("C:\\Dev\\VTS\\Grids\\WA\\wohpgn.gsb");
NTv2Transform transform = new NTv2Transform(gridFile.toURI());

I get this exception:

Exception in thread "main" org.opengis.referencing.NoSuchIdentifierException: Could not locate NTv2 Grid File file:/C:/Dev/VTS/Grids/WA/wohpgn.gsb
    at org.geotools.referencing.operation.transform.NTv2Transform.<init>(NTv2Transform.java:105)
    at com.frequentis.example.Main.transformFromNad27UsingGrid(Main.java:75)
    at com.frequentis.example.Main.main(Main.java:90)

Am I using the syntax properly? Is there some other way of how to achieve that? Do you know about some workaround?

I was trying it with versions 18.4 and 19.1 with Maven.

  • Having the same Error with Ubuntu... – aleho Feb 5 '19 at 10:21

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.