feat: implement est_width parsing and sidebar display#289
Draft
Momototoro wants to merge 3 commits into
Draft
Conversation
tordans
requested changes
Jun 9, 2026
| ) : ( | ||
| <code>{secureWidthSource}</code> | ||
| )} | ||
| {properties[widthConfidence] && ( |
| 'traffic_sign:backward', | ||
| 'confidence', // true key is `maxspeed_confidence`, `surface_confidence`, … but we overwrite that when passing props | ||
| 'width_source', | ||
| 'width_confidence', |
Comment on lines
+54
to
+55
| { column = 'width_confidence', type = 'text' }, | ||
| { column = 'width_source', type = 'text' }, |
Contributor
There was a problem hiding this comment.
Regel: Unsere Tabellen haben immer den gleichen Shape id, tags, meta, geom, minzoom
| FROM information_schema.columns | ||
| WHERE table_name = '${tableName}' | ||
| AND column_name IN ('osm_id', 'osm_type') | ||
| AND column_name IN ('osm_id', 'osm_type', 'width_confidence', 'width_source') |
| @@ -0,0 +1,87 @@ | |||
| describe("parse_width", function() | |||
| require('init') | |||
| require('init') | ||
| require('osm2pgsql') | ||
|
|
||
| local logged_errors = {} |
| -- return osm2pgsql.define_table(_options) | ||
| -- end | ||
|
|
||
| function osm2pgsql.define_table(options) |
| @@ -0,0 +1,101 @@ | |||
| describe('RoadClassification', function() | |||
Contributor
There was a problem hiding this comment.
fehlt inner describe blcok weil alels ja nicht road clas.… teste sondern with
| local width = nil | ||
| local width_confidence = nil | ||
|
|
||
| if object_tags.width then |
Contributor
There was a problem hiding this comment.
Refactor to local function surface_direct(tags)
Nach Rebase:
width = parse_length(object_tags.width),
width_source = SANITIZE_TAGS.safe_string(object_tags['source:width']),
width_effective = parse_length(object_tags['width:effective']),
neues muster:
local FOO = derive_witdth(tags)
local result_tags = {
width = foo.width
width_source = FOO.source
width_confience = foo.conficnde
}
local surface_tags_result = SURFACE_TAGS.surface_tags_with_parent(object.tags, object._parent_tags)
…
surface = surface_tags_result.value,
surface_confidence = surface_tags_result.confidence,
surface_source = surface_tags_result.source,
| # Make sure we have the latest lua path at hand. | ||
| # Szenario: We just added a lua helper in a new folder but did not run the full processing, yet | ||
| bun run ./processing/run-tests-update-lua-package-paths.ts | ||
| NODE_PATH=./app/node_modules bun run ./processing/run-tests-update-lua-package-paths.ts |
Contributor
There was a problem hiding this comment.
raus, bun verwendne
brew install bun
2a75126 to
f6c89bc
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
bunx tsc was resolving to a global TypeScript 5 install on WSL instead of the project's TypeScript 6 package, which only exposes the tsc6 bin. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So hier jetzt das Erste:
https://github.com/FixMyBerlin/private-issues/issues/280
Ist hauptsaechlich gevibecoded also ich verstehe auch nicht alles weil ich mich auch nicht tief genug in Tilda eingearbeitet habe.
Habe aber den Implementation plan immer schoen durch einen Grill Prozess durch geschickt.
PR Review: dev-est_width
Branch Summary
developcmandm), falls back toest_widthwhen the defaultwidthtag is missing, logs parsing errors to a dedicated database table, and displays the width's confidence and source in the sidebar inspector and export files.Changed Files (19 total)
parse_width.lua250 cm->2.5 m) and normalizing decimals.width_errors.luawidth_errors) to log unparsable width tags.RoadClassification.luawidth->est_width, settingwidth_confidenceandwidth_source.roads_bikelanes.luawidth_confidenceandwidth_sourcecolumns toroads/roadsPathClassestables.ExcludeByWidth.luaparse_widthutility.RoadWidth.luaTagsTableRowCompositWidth.tsxtranslationsWdith.const.tswidth_confidence(Geschätzt,Direkt gemessen) and common sources.ConditionalFormattedValue.tsxwidth_confidenceandwidth_source.export.$regionSlug.$tableName.tswidth_confidenceandwidth_sourcecolumns in exports.ParseWidth.test.luaRoadClassification.test.lua.genfilesImplementation Details & Code Highlights
1. Robust Unit Parsing (
parse_width.lua)We normalize comma decimals and convert non-meter units like
cmorkmto meter floats:2. OSM Metadata Fallback (
RoadClassification.lua)We fallback to
est_widthifwidthis empty/unparsable, and assignhighvslowconfidence categories:3. Database Schema Migration (
roads_bikelanes.lua)The parsed attributes are saved into dedicated columns on the
roadsandroadsPathClassestables:4. Inline Inspector Display (
TagsTableRowCompositWidth.tsx)In the sidebar inspector, we display the source and the confidence value inline in parentheses inside a collapsible disclosure:
Output Example:
Quelle: Orthofoto 2024 (Direkt gemessen)