SHARE
TWEET

Untitled

a guest Sep 13th, 2017 263 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Distance(lat1, lon1, lat2, lon2) {
  2.     var radlat1 = Math.PI * lat1/180;
  3.     var radlat2 = Math.PI * lat2/180;
  4.     var radlon1 = Math.PI * lon1/180;
  5.     var radlon2 = Math.PI * lon2/180;
  6.     var theta = lon1-lon2;
  7.     var radtheta = Math.PI * theta/180;
  8.     var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);
  9.     dist = Math.acos(dist);
  10.     dist = dist * 180/Math.PI;
  11.     dist = dist * 60 * 1.1515;
  12.     dist = dist * 1.609344;
  13.     return dist;
  14. }
  15. function(doc) {
  16.   var i;
  17.   var X1;
  18.   var Y1;
  19.   for(i in doc.Placemark)
  20.   {
  21.         if(doc.Placemark[i].AddressDetails.Country.CountryName == "Polska" && doc.Placemark[i].AddressDetails.Country.AdministrativeArea.AdministrativeAreaName =="Kujawsko-Pomorskie")
  22.         {
  23.             X1 = doc.Placemark[i].Point.coordinates[0];
  24.             Y1 = doc.Placemark[i].Point.coordinates[1];
  25.  
  26.             emit(doc.Placemark[i].address, [doc.Placemark[i].Point.coordinates[0],doc.Placemark[i].Point.coordinates[1]]);
  27.         }
  28.   }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top