1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| public class ConversionDepuisDll {
public void transfoCoordonnees(){
try {
System.load("C:/Convers/ConversApi.dll");
//System.loadLibrary("ConversApi");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
}
}
public native void SetConversion(String s1, String s2);
public native void SetPivot(String s1);
public native void SetMeridienParis(String s1);
public native void Conversion(double [] dxy1, String string, int degminsec, int greenwich, double []dxy2, String string2, int km, int i, int degminsec2);
public static void main(String[] args) {
ConversionDepuisDll CDDLL = new ConversionDepuisDll();
double [] dXY1 = new double[3];
dXY1[0]=(double) 0.8863889;
dXY1 [1]= (double)43.62916667;
double []dXY2 = new double[3];
CDDLL.transfoCoordonnees();
int GREENWICH = 1;
int DEGDECIMAUX = 2;
int METRES = 5;
int KM = 0;
CDDLL.SetConversion("WGS84","World Geodetic System 1984 (WGS84),0,WGS84,12,0,0,0,0,0");
CDDLL.SetPivot("WGS84");
CDDLL.SetMeridienParis("2.2014025°");
CDDLL.Conversion(dXY1,"ED50",DEGDECIMAUX,GREENWICH,dXY2, "LT3",KM,0,METRES);
}
} |
Partager