Skip to content

osm_to_railjson: minor upgrades#16209

Open
SaumonDesMers wants to merge 4 commits intodevfrom
sga/osm2railjson_minor_upgrades
Open

osm_to_railjson: minor upgrades#16209
SaumonDesMers wants to merge 4 commits intodevfrom
sga/osm2railjson_minor_upgrades

Conversation

@SaumonDesMers
Copy link
Copy Markdown
Contributor

This PR introduce multiple upgrade that were more or less necessary during developpement of other features, but that didn't fit into the PR of those features.
Their main objective is perfomance and/or filtering bad data.

I was not sure how to add then to dev.
Please let me know if this is not the right way.

@SaumonDesMers SaumonDesMers self-assigned this Apr 11, 2026
@SaumonDesMers SaumonDesMers requested a review from a team as a code owner April 11, 2026 17:41
@github-actions github-actions bot added the area:editoast Work on Editoast Service label Apr 11, 2026
Copy link
Copy Markdown
Contributor

@Tristramg Tristramg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fixes, thank you for the split in commits that make sense!

osm4routing::osmpbfreader::OsmObj::Node(node) => node
.tags
.get("railway:ref")
.filter(|trigram| trigram.len() <= 3)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.dbinfrago.com/web/schienennetz/betrieb/allgemeine-betriebsinformationen/betriebsstellen-12592996

In Germany they can have up to 5 characters (and in France 1 or 2...).
If this filter is needed, I would say to filter at 5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this filter because editoast give me and error when I have a trigram longer then 3 characters. I don't know where but I think there is a 3 characters limitation somewhere else in the code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it seems the search_operational_point table has a trigram field of type varying(3) but it's most likely a bug in editoast

  2026-04-13T08:23:43.542183Z ERROR editoast::error: [editoast:ModelError] an error occurred while querying the database: value too long for type character varying(3): disabled backtrace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Openned #16212 but i don't know how this will play out with the OP model refacto

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #16215 to fix editoast

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ! but ths problem still remains, sometimes there is a number where the trigram should be.
Would filtering by alphabetic character to the job ?
Is there trigram with number in them ?

Copy link
Copy Markdown
Contributor

@ppitou ppitou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦅


let nodes_tracks = NodeToTrack::from_edges(&edges);
let signals = signals(&osm_pbf_in, &nodes_tracks, &adjacencies);
let signals = if generate_signals {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use don't instead of dont in the commit title

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Filter out railway nodes that are tagged with tourism or sciences.

Signed-off-by: Simon <sim.gaubert.sg@gmail.com>
Don't parse signals when we generate them, as they will be overridden anyway.

Signed-off-by: Simon <sim.gaubert.sg@gmail.com>
Stop mapping every node, and map only those that have a "railway:ref" tag,
and filter out those whose trigram is longer than 3 characters.

Signed-off-by: Simon <sim.gaubert.sg@gmail.com>
Signed-off-by: Simon <sim.gaubert.sg@gmail.com>
@SaumonDesMers SaumonDesMers force-pushed the sga/osm2railjson_minor_upgrades branch from bc66684 to ca87ca4 Compare April 13, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editoast Work on Editoast Service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants