From d80a0e66b1f35dcc693330b5ade23f945c7d67c1 Mon Sep 17 00:00:00 2001 From: kauevestena Date: Fri, 15 Apr 2022 23:19:31 -0300 Subject: [PATCH] to adapt to windows messing with strings, release --- generic_functions.py | 9 +++++++-- metadata.txt | 4 ++-- osm_sidewalkreator.py | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 generic_functions.py mode change 100644 => 100755 osm_sidewalkreator.py diff --git a/generic_functions.py b/generic_functions.py old mode 100644 new mode 100755 index 49395f9..5385a4d --- a/generic_functions.py +++ b/generic_functions.py @@ -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 diff --git a/metadata.txt b/metadata.txt index 1d5f7b2..e481603 100644 --- a/metadata.txt +++ b/metadata.txt @@ -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=kauemv2@gmail.com diff --git a/osm_sidewalkreator.py b/osm_sidewalkreator.py old mode 100644 new mode 100755 index 3adedfc..0433932 --- a/osm_sidewalkreator.py +++ b/osm_sidewalkreator.py @@ -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) @@ -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():