Hello everyone, First of all, sorry for my english.I am looking for how to build a point from another point according to a distance(meters) and a angle(degree).Olivier
Hi, Thank you for your answer.I am worry that this method will not be precise enough as the earth is a sphere. But I could still have a try.I keep you in touch.Olivier
Hello Dlimos, I tried what you advised me to do and this is perfectly working !! Thank you a lot !To any people that might face this problem, this is the js function I used :function buildPoint(point,angle, nav_long){ var coord = esri.geometry.lngLatToXY(point.getLongitude(),point.getLatitude(),true); var ox = coord[0]+ Math.cos(angle/180*Math.PI)*nav_long; var oy = coord[1] + Math.sin(angle/180*Math.PI)*nav_long; var newPoint = new esri.geometry.Point(esri.geometry.xyToLngLat(ox,oy),new esri.SpatialReference({ wkid:4326 })); return newPoint;}OlivierL
gsvc = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); outSR = new esri.SpatialReference({ wkid: 32631}); startingSR = new esri.SpatialReference({ wkid: 4326}); function buildPoint(point,angle, nav_long){ gsvc.project([ point ], outSR, function(projectedPoints) { var pt = projectedPoints[0]; var ox = pt.x + Math.cos(angle/180*Math.PI)*nav_long; var oy = pt.y + Math.sin(angle/180*Math.PI)*nav_long; var newPoint = new esri.geometry.Point(ox, oy,new esri.SpatialReference({ wkid:outSR })); gsvc.project([ newPoint ], startingSR, function(projectedPoints2) { var pt2 = projectedPoints2[0]; return pt2; }); }); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.