Thanks for helping with the multiple grid files issue. Let us know if there
is anything we can do to help. In the meantime, we have one error that
appears on some of the tests:
InvalidGeodeticParameterException: Unit conversion from “DMS” to “°” is
non-linear.
The code to reproduce is below:
public void NAD_1983_CSRS_Quebec_AlbersTest() throws FactoryException,
NoninvertibleTransformException, MismatchedDimensionException,
TransformException {
double latitude = 53;
double longitude = -68;
double x = 33320.3957334436;
double y = 1004126.36457275;
CRSAuthorityFactory crsFactory = CRS.getAuthorityFactory("EPSG");
CoordinateOperationAuthorityFactory opFactory =
(CoordinateOperationAuthorityFactory) crsFactory;
// NAD_1983_CSRS_Quebec_Albers
CoordinateReferenceSystem targetCRS =
crsFactory.createCoordinateReferenceSystem("6624");
// This is the transformation we want to use
NAD_1983_CSRS_To_WGS_1984
CoordinateOperation datumOperation =
opFactory.createCoordinateOperation("1473");
// normalize the axis for the target
targetCRS =
AbstractCRS.castOrCopy(targetCRS).forConvention(AxesConvention.DISPLAY_ORIENTED);
CoordinateOperation targetOperation =
CRS.findOperation(datumOperation.getSourceCRS(), targetCRS, null);
/*
* concatenate two operations
*/
MathTransform step1 = datumOperation.getMathTransform().inverse();
MathTransform step2 = targetOperation.getMathTransform();
MathTransform completeTransform = MathTransforms.concatenate(step1,
step2);
/*
* transform to x,y in one step
*/
DirectPosition source = new DirectPosition2D(latitude, longitude);
DirectPosition target = completeTransform.transform(source, null);
double[] coordinate = target.getCoordinate();
Assert.assertEquals(x, coordinate[0], 1);
Assert.assertEquals(y, coordinate[1], 1);
}
On Mon, Jan 13, 2020 at 5:33 AM Martin Desruisseaux <
[email protected]> wrote:
> Le 08/01/2020 à 00:09, Martin Desruisseaux a écrit :
>
> > To fix this issue we need to read all sub-grids in NTv2 files. The
> > NTv2 reader of SIS is actually already capable of that, but to finish
> > that work cleanly we need an R-Tree or QuadTree. I may try to
> > implement a "raw" approach this weekend without R-Tree/QuadTree for
> > now, at the sacrifice of performance, and revisit later when we have
> > better index. I will see if I can do that Saturday or Sunday and keep
> > you informed.
> >
> I did some work on this issue this weekend. I changed my mind and try to
> go the "right" way (using a QuadTree or RTree) from the beginning. But
> it will take me a few more weekends before to complete this task. I will
> keep this list informed about the progress.
>
> Martin
>
>
>