Skip to content

Commit abd8b2c

Browse files
committed
fix get_value_from_raster import
1 parent cc315d7 commit abd8b2c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

map2loop/sorter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas
44
import numpy as np
55
import math
6-
from .mapdata import MapData
6+
from .mapdata import MapData, get_value_from_raster
77
from typing import Union
88

99
from .logging import getLogger
@@ -434,9 +434,9 @@ def sort(
434434
continue
435435

436436
# Get heights for intersection point and start of ray
437-
height = map_data.get_value_from_raster(Datatype.DTM, start.x, start.y)
437+
height = get_value_from_raster(Datatype.DTM, start.x, start.y)
438438
first_intersect_point = Point(start.x, start.y, height)
439-
height = map_data.get_value_from_raster(
439+
height = get_value_from_raster(
440440
Datatype.DTM, second_intersect_point.x, second_intersect_point.y
441441
)
442442
second_intersect_point = Point(second_intersect_point.x, start.y, height)

map2loop/thickness_calculator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
)
1010
from .m2l_enums import Datatype
1111
from .interpolators import DipDipDirectionInterpolator
12-
from .mapdata import MapData
12+
from .mapdata import MapData, get_value_from_raster
1313

1414
from .logging import getLogger
1515
logger = getLogger(__name__)
@@ -358,13 +358,13 @@ def compute(
358358
p1[0] = numpy.asarray(short_line[0].coords[0][0])
359359
p1[1] = numpy.asarray(short_line[0].coords[0][1])
360360
# get the elevation Z of the end point p1
361-
p1[2] = map_data.get_value_from_raster(Datatype.DTM, p1[0], p1[1])
361+
p1[2] = get_value_from_raster(Datatype.DTM, p1[0], p1[1])
362362
# create array to store xyz coordinates of the end point p2
363363
p2 = numpy.zeros(3)
364364
p2[0] = numpy.asarray(short_line[0].coords[-1][0])
365365
p2[1] = numpy.asarray(short_line[0].coords[-1][1])
366366
# get the elevation Z of the end point p2
367-
p2[2] = map_data.get_value_from_raster(Datatype.DTM, p2[0], p2[1])
367+
p2[2] = get_value_from_raster(Datatype.DTM, p2[0], p2[1])
368368
# calculate the length of the shortest line
369369
line_length = scipy.spatial.distance.euclidean(p1, p2)
370370
# find the indices of the points that are within 5% of the length of the shortest line

0 commit comments

Comments
 (0)