From ec822f0d3d21fe323ed28d8caf32b140b2152ceb Mon Sep 17 00:00:00 2001 From: eric bryant Date: Sun, 14 Jun 2020 14:48:30 -0400 Subject: [PATCH] LABEL_INVALID_CHAR for all points ...not just visible ones --- siteupdate/cplusplus/classes/Route/read_wpt.cpp | 2 +- siteupdate/python-teresco/siteupdate.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/siteupdate/cplusplus/classes/Route/read_wpt.cpp b/siteupdate/cplusplus/classes/Route/read_wpt.cpp index 4af30af2..7253ece7 100644 --- a/siteupdate/cplusplus/classes/Route/read_wpt.cpp +++ b/siteupdate/cplusplus/classes/Route/read_wpt.cpp @@ -62,6 +62,7 @@ void Route::read_wpt // single-point Datachecks, and HighwaySegment w->out_of_bounds(datacheckerrors, fstr); w->duplicate_coords(datacheckerrors, coords_used, fstr); + w->label_invalid_char(datacheckerrors); if (point_list.size() > 1) { w->distance_update(datacheckerrors, fstr, vis_dist, point_list[point_list.size()-2]); // add HighwaySegment, if not first point @@ -76,7 +77,6 @@ void Route::read_wpt w->label_slashes(datacheckerrors, slash); w->underscore_datachecks(datacheckerrors, slash); w->label_parens(datacheckerrors); - w->label_invalid_char(datacheckerrors); w->label_invalid_ends(datacheckerrors); w->bus_with_i(datacheckerrors); w->label_looks_hidden(datacheckerrors); diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 55668533..769217bb 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -3853,6 +3853,13 @@ def run(self): else: coords_used.add(latlng) + # look for labels with invalid characters + if not re.fullmatch('\+?\*?[a-zA-Z0-9()/_\-\.]+', w.label): + datacheckerrors.append(DatacheckEntry(r,[w.label],'LABEL_INVALID_CHAR')) + for a in w.alt_labels: + if not re.fullmatch('\+?\*?[a-zA-Z0-9()/_\-\.]+', a): + datacheckerrors.append(DatacheckEntry(r,[a],'LABEL_INVALID_CHAR')) + # visible distance update, and last segment length check if prev_w is not None: last_distance = w.distance_to(prev_w) @@ -3927,13 +3934,6 @@ def run(self): or (left_count == 1 and w.label.index('(') > w.label.index(')')): datacheckerrors.append(DatacheckEntry(r,[w.label],'LABEL_PARENS')) - # look for labels with invalid characters - if not re.fullmatch('\*?[a-zA-Z0-9()/_\-\.]+', w.label): - datacheckerrors.append(DatacheckEntry(r,[w.label],'LABEL_INVALID_CHAR')) - for a in w.alt_labels: - if not re.fullmatch('\+?\*?[a-zA-Z0-9()/_\-\.]+', a): - datacheckerrors.append(DatacheckEntry(r,[a],'LABEL_INVALID_CHAR')) - # look for labels with invalid first or last character index = 0 while index < len(w.label) and w.label[index] == '*':