calculate_distance
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
calculate_distance [2023/04/21 15:30] – external edit 127.0.0.1 | calculate_distance [2023/04/21 15:48] (current) – irladmin | ||
---|---|---|---|
Line 24: | Line 24: | ||
import sys | import sys | ||
import numpy | import numpy | ||
- | from gdalconst import * | + | from osgeo.gdalconst import * |
from osgeo import gdal | from osgeo import gdal | ||
import math | import math | ||
from node_utils import * | from node_utils import * | ||
from scipy.spatial import distance | from scipy.spatial import distance | ||
- | import gdal | ||
| | ||
# set names for labelling the script while running | # set names for labelling the script while running | ||
Line 52: | Line 51: | ||
| | ||
if (len(road_list) == 0): | if (len(road_list) == 0): | ||
- | print " | + | print(" |
return None | return None | ||
| | ||
Line 66: | Line 65: | ||
node_road = getNodeByName(nodes_data, | node_road = getNodeByName(nodes_data, | ||
if (not node_road): | if (not node_road): | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
return [] | return [] | ||
| | ||
Line 74: | Line 73: | ||
pixelsize = dataset.GetGeoTransform()[1] | pixelsize = dataset.GetGeoTransform()[1] | ||
| | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
| | ||
road_cells = []; | road_cells = []; | ||
Line 83: | Line 82: | ||
road_cells.append(cell); | road_cells.append(cell); | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
| | ||
distances=[] | distances=[] | ||
Line 105: | Line 104: | ||
| | ||
for i in range(CELLS_PRINTING): | for i in range(CELLS_PRINTING): | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
| | ||
| |
calculate_distance.1682083809.txt.gz · Last modified: 2023/04/21 15:30 by 127.0.0.1