Skip to content

Commit

Permalink
to adapt to windows messing with strings, release
Browse files Browse the repository at this point in the history
  • Loading branch information
kauevestena committed Apr 16, 2022
1 parent 6289c59 commit d80a0e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions generic_functions.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,15 @@ def get_major_dif_signed(inputval,inputdict,tol=0.5,print_diffs=False):

diffs = {} # []

inputval = float(inputval)

for key in inputdict:
# always avoid to compare floats equally
if not isclose(inputval,inputdict[key],abs_tol=tol):
diffs[key] = inputdict[key]-inputval #.append(inputdict[key]-inputval)

desired_value = float(inputdict[key])

if not isclose(inputval,desired_value,abs_tol=tol):
diffs[key] = desired_value-inputval #.append(inputdict[key]-inputval)
else:
refused_key = key

Expand Down
4 changes: 2 additions & 2 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[general]
name=OSM SidewalKreator
qgisMinimumVersion=3.14
description=Plugin designated to create the Geometries of Sidewalks (separated from streets) based on OpenStreetMap Streets, given a bounding polygon, outputting to JOSM format. It is mostly intended for acessibility Mapping.
version=0.2
description=Plugin designated to create the Geometries of Sidewalks (separated from streets) based on OpenStreetMap Streets, given a bounding polygon, outputting to a .geojson to be imported on JOSM. It is mostly intended for acessibility Mapping.
version=0.9
author=Kaue de Moraes Vestena
[email protected]

Expand Down
4 changes: 2 additions & 2 deletions osm_sidewalkreator.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ def draw_crossings(self):

crossing_as_feat = geom_to_feature(crossing_geom,[self.crossings_len_fieldname,self.len_checking_fieldname,self.above_tol_fieldname])

ortholen = self.dlg.d_to_add_box.value() + belonging_line[widths_fieldname]
ortholen = self.dlg.d_to_add_box.value() + float(belonging_line[widths_fieldname])

tolerance_factor = self.dlg.perc_tol_crossings_box.value()
tol_len = ortholen * (1 + tolerance_factor/100)
Expand Down Expand Up @@ -2227,7 +2227,7 @@ def two_intersections_byvector_with_sidewalks(self,vector,centerpoint,linefeatur

# a tolerance for a max length check
tolerance_factor = self.dlg.perc_tol_crossings_box.value()
max_len = (self.dlg.d_to_add_box.value() + linefeature[widths_fieldname]) * (1 + tolerance_factor/100)
max_len = (self.dlg.d_to_add_box.value() + float(linefeature[widths_fieldname])) * (1 + tolerance_factor/100)

# correct datatype (QgsPoint/QGSPointXY)
if centerpoint.isMultipart():
Expand Down

0 comments on commit d80a0e6

Please sign in to comment.