I have the following data structure

pointid distance lat long

where pointid is a list of points, distance is distance of point from feature (calculated in QGIS in geographical units under a EPSG::4326 reference system), and lat and long are the coordinates of that point.

How can I convert the distance variable to km?

  • you need to project your data to a metre-based projected coordinate system in order to calculate the distance in metres / kilometres – DPSSpatial Mar 26 '18 at 16:31
  • Is the distance in degrees of arc computed on the sphere or "Euclidean" distance computed by Pythagoras from two lat-long coordinates, treating them as cartesian coordinates? It makes a huge difference. – Spacedman Mar 26 '18 at 17:46
  • Which direction is the distance value? Or is distance supposed to be used to create a buffer around the point? – mkennedy Mar 26 '18 at 21:59
  • I am sorry to say, but if no information of the vector (point 1 and point 2) that gave the distance is available, there is no way to get the length. It is not the same to be 20 degrees away along a parallel at Equator than in the Polar Circles – Marco Mar 27 '18 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.