How to calculate topological distance using ArcMap or other software?

I would like to calculate the topological distance instead of the Euclidean distance between two polygons. The distance between two adjacent polygons is 1, between two polygons connecting a common neighbor, it is 2, etc.

Is there any simple way to calculate the topological distance? I searched for this question but could not find a solution.

Thanks.

+4
source share
2 answers

I find a way to implement this calculation using existing software.

First import the shp file into PostgreSQL using the PostGIS plugin.

Secondly, use the ST_Touches function to compute each polygon of adjacent polygons.

Third, take each polygon as a point and build a new network.

Finally, calculate the shortest path between two points using Dijkstra's algorithm.

0
source

Basically you want to find the distance between Polygon A and B

Here are the steps I will take:

Distance = 1;

  • Check if Polygon B is a neighboring polygon A, if it is = Done, if not go to step 2.
  • Calculate the coordinate center (midpoint) of all adjacent polygons and polygon B
  • Count the distance between the adjacent centroid to the Polygon B centroid, select the polygon with the closest distance (Polygon C)
  • Distance = Distance + 1. Check if Polygon B is a neighboring polygon C, if it = Done, If not, Polygon A = Polygon C, go to step 2

In the end you will get the distance.

0
source

Source: https://habr.com/ru/post/1481294/


All Articles