Search code examples
javaimportcompiler-errorscoordinate

Java disutil CoordinateConversions import problems


I'm writing a Java class that will be used to send PDUs across a network- to do this, I am following the tutorial at: Tutorial

In the example, the line:

double lla[] = CoordinateConversions.xyzToLatLonDegrees(c);

appears towards the end of the class, and I see that CoordinateConversions has been imported with the line:

import edu.nps.moves.disutil.CoordinateConversions;

I have tried using the xyzToLatLonDegrees(); method in the class that I am writing- calling it in the same way as is done in the example. However, for some reason, I get a compile error that says:

CoordinateConversions cannot be resolved

on the line where I'm trying to use it, and

The import edu.nps.moves.disutil.CoordinateConversions cannot be resolved

on the line where I am importing it.

Does anyone know why this is, and how I can fix the import, so that I can use the xyzToLatLonDegrees() method?


Solution

  • You need to have the CoordinateConversions class on your classpath. Either by obtaining the source and dropping it into your project (possibly adjusting package names, and only if the license allows), or by finding a JAR containing that class and adding it to your build path in your IDE.

    You probably need to download the Java files from here.