Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relations not returning error in MGCP translation when unable to translate #4970

Open
brianhatchl opened this issue Aug 23, 2021 · 2 comments · May be fixed by #4971
Open

Relations not returning error in MGCP translation when unable to translate #4970

brianhatchl opened this issue Aug 23, 2021 · 2 comments · May be fixed by #4971
Assignees

Comments

@brianhatchl
Copy link
Contributor

I would expect that if the tags of a relations could not be translated to an FCODE, the translation would return the tag error=No Valid Feature Code like it does for nodes and ways. Instead, is seems the OSM tags just pass through.

I'll create a branch with a test that is failing in this scenario.

@mattjdnv
Copy link
Contributor

Findings so far:
NOTE: An "empty" multi polygon is one that doesn't have all of it's elements. A "full" one has all of the nodes and ways

  • Converting an "empty" multi polygon:
    • Without any tags streams the input to the output without calling the translation script. Therefore, no error tag
    • Converting to shapefile also doesn't call the translation script. It creates the shapefile directory and no files
  • Converting a "full" multi polygon:
    • Without any tags streams the input to the output without calling the translation script. Therefore, no error tag
    • With a "good" tag it translates correctly
    • With a "bad" tag it translates and sends back the error tag

@mattjdnv
Copy link
Contributor

Since the translator isn't run when there are no tags to translate - I.e. only having the "type" tag - I think we could modify the core to add an error tag if the translator isn't run on a feature. I don't know what this would impact.

I tried using an osm file with two multi polygons, one with a tag (building=yes) and one without. Converting them resulted in:

  • Exporting to OGR (shape etc) basically drops the feature that doesn't have any tags.
    • Two features in, One feature out
  • Converting to XML just passes the feature without tags through
    • Two features in, two features out.

Trying the same file but changing building=yes to be papa=smurf was interesting.

  • The shapefile had a feature in the O2S_A layer - which is expected - and the other feature was dropped
  • The XML had no tags at all! It dropped the invalid tag even though the debug output said that it translated it to o2s_a

Getting curious, I created another OSM file that has:

  1. two ways with valid tags and a relation with valid tags joining them
  2. two ways, one with valid tags, one with invalid tags and a relation with valid tags joining them
  3. two ways without tags and a relation with valid tags joining them
  4. two ways without tags and a relation with invalid tags joining them
  5. two ways without tags and a relation without tags joining them
  6. two ways with valid tags and a relation with invalid tags joining them

Results:

  1. Both roads exported with the tags from the relation
  2. Both roads exported with the tags from the relation. The road with the invalid tags is also in the o2s_l layer
  3. Both roads exported with the tags from the relation
  4. Did not export - I expected it to go to o2s_l but with no tags the translator didn't run
  5. Did not export - as above
  6. Both roads exported with their tags.

Looking at this, it seems that tags on a relation stomp on tags on members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants