Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
guard malformated direction values
Browse files Browse the repository at this point in the history
  • Loading branch information
rush42 committed Nov 20, 2023
1 parent a74e5a0 commit 62d264a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/process/trafficSigns/trafficSigns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SET
to_jsonb(((tags ->> 'direction') :: numeric + 360) % 360)
)
WHERE
tags ? 'direction';
(tags ->> 'direction') ~ '^\d*\.?\d*$';-- check if it's a valid decimal number

This comment has been minimized.

Copy link
@tordans

tordans Nov 27, 2023

Contributor

@rush42 is this something we can do in LUA before running the SQL? It feels too complex to have this kind of logic here…

This comment has been minimized.

Copy link
@rush42

rush42 Nov 27, 2023

Author Contributor

I pushed a new version which guards in the Lua file


-- inverse the sign off all traffic signs which have offset=180 to avoid ambiguities
UPDATE
Expand All @@ -58,4 +58,4 @@ SET
tags = tags - 'offset';

-- remove direction table
DROP TABLE "_trafficSignDirections";
DROP TABLE "_trafficSignDirections";

0 comments on commit 62d264a

Please sign in to comment.