Just a guess (I'm on mobile seaside) but maybe it is a Windows specific
issue, since the code has been developed and reviewed by Linux devs only.
My guess is based on the path seen in the error message, believe it should
be "file://c:/..." (Note the double slash while the error msg reports a
single one)
Cheers
Andrea
Il mer 25 lug 2018, 10:18 Ian Turton <ijtur...@gmail.com> ha scritto:
> I'm not sure if this is the issue but the preferred way to change a file
> into an url is to use the Urls.toUrl method.
>
> Ian
>
> On Tue, 24 Jul 2018, 21:46 Stanislav Dušek, <dusek.stan...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I'm trying to use GeoTools 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?
>>
>> Btw, I was trying it with versions 18.4 and 19.1 with Maven.
>>
>> Thank you,
>> Stanislav
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users