convert x/y to lat/lng


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. double lambda0 = 2488.57915; // addition des longitudes
  2. float scale = 100000; // scale dans gephi
  3. int totalNode = 70;
  4. double latitude;
  5. double longitude;
  6. float x = 552.6573; //position x après spatialisation
  7. float y = 3682.871; //position y après spatialisation
  8.  
  9. lambda0 = lambda0/totalNode;
  10. lambda0 = Math.toRadians(lambda0);
  11.  
  12. latitude = 180/PI * (2*Math.atan((Math.exp(y/scale))) - PI/2); // soucis avec cette formule
  13. longitude = 180/PI * ( x/scale + lambda0);
  14.  
  15. println(latitude);
  16. println(longitude);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.