Skip to content

Commit

Permalink
fix numpy use
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCaha committed Nov 22, 2024
1 parent bb25740 commit d222a09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion los_tools/classes/sampling_distance_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ def build_line(self, origin_point: QgsPoint, direction_point: QgsPoint) -> QgsLi
def densified_line(self, start_point: QgsPoint, end_point: QgsPoint, sampling_row_index: int) -> QgsLineString:
line = QgsGeometry.fromPolyline([start_point, end_point])

line = line.densifyByDistance(distance=np.nextafter(self.get_row_sampling_distance(sampling_row_index), np.Inf))
line = line.densifyByDistance(distance=np.nextafter(self.get_row_sampling_distance(sampling_row_index), np.inf))

return QgsLineString([x for x in line.vertices()])
6 changes: 4 additions & 2 deletions los_tools/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name=LoS Tools
qgisMinimumVersion=3.30
description=This plugin creates and analyzes lines-of-sight (LoS) and also provides supporting tools.
version=1.2.0
version=1.2.1
author=Jan Caha
[email protected]

Expand All @@ -20,7 +20,9 @@ repository=https://github.com/JanCaha/qgis_los_tools

hasProcessingProvider=yes
# Uncomment the following line and add your changelog:
changelog=1.2.0
changelog=1.2.1
- fix bad use of numpy to avoid exception
<p>1.2.0
- new tool to extract horizon lines at specific distance
- minor fixes to gui tools (based on tests written for them)
<p>1.1.2
Expand Down
2 changes: 1 addition & 1 deletion los_tools/processing/tools/util_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def segmentize_line(line: QgsGeometry, segment_length: float) -> QgsLineString:

line_geom = QgsGeometry(line_extented)

line_geom = line_geom.densifyByDistance(distance=np.nextafter(float(segment_length), np.Inf))
line_geom = line_geom.densifyByDistance(distance=np.nextafter(float(segment_length), np.inf))

line_res = QgsLineString([x for x in line_geom.vertices()])

Expand Down

0 comments on commit d222a09

Please sign in to comment.