1

Usually, Euclidean distance is defined as squareroot((x1 - x2)^2 - (y1-y2)^2) but, instead of having x and y values you have a cell size of 20.

How can to calculate the Euclidean distance between the yellow boxes?

enter image description here

Further context:

enter image description here

7
  • 1
    Do you know the relative position of the cells i.e. (0,0 and 4,1)?
    – Cushen
    Mar 14 at 0:20
  • 2
    Are the cells always in the same relative position? Otherwise it seems like the task is to calculate the distance between two unknown locations, which seems tricky.
    – Cushen
    Mar 14 at 0:33
  • 2
    In this specific case, given cell size 20 and measuring distance to/from the centre of the cells: x=20 y=60 so D= 63.245. This is a specific answer, to solve for other cases we need to know the relative position of the cells. a formula in that case would be: d = √((cellsize(cell2y-cell1y))²+(cellsize(cell2x-cell1x))²) i.e. d = √(4000 ) = 63.245
    – Cushen
    Mar 14 at 1:21
  • 1
    Please add your comment as an answer so that I can accept it as an answer, thank you. Mar 14 at 2:55
  • 2
    Jusr because cell size is fixed doesn't mean that there is no Y component. It just means that X and Y are multiples of some constant w. This is more pure math than a GIS problem.
    – Vince
    Mar 14 at 11:12

1 Answer 1

1

In this specific case, given cell size 20 and measuring distance to/from the centre of the cells:

x=20 y=60. Therefore: d=63.245

This is a specific answer, to solve for other cases we need to know the relative position of the cells. A formula in that case would be:

d = √( ( cellsize(cell2y-cell1y) )²+( cellsize(cell2x-cell1x) )² ) 

i.e. d = √(4000) = 63.245

Not the answer you're looking for? Browse other questions tagged or ask your own question.