Skip to main content

Hello,

I am trying to work with data from OpenStreetMap, and I have an issue with retrieving tags.

 

The only tags I get are the ones related to 1st level types. Other attributes appear in the inspector right panel, but I cannot access it from in my workflow. So what is the difference between attributes from the Table View and the Feature Information ? Is there any way to access those specific features information from the Workbench ?

 

Strangely enough, when I check the "Determine feature by scanning the entire dataset", all tags also appears in the Inspector Table View (with a lot of missing values). But I cannot use that option from my main workflow, as my dataset is an URL (returning an OSM XML file).

 

So far, I am only looking for a few attibutes on a few elements, like the "layer" value for highways (which indicates if they are underground and above or below other highways).

 

 

Any help would be much appreciated, as this is very important for my work :)

Hi,

The osm reader is using a number of features and then setting a schema. Because anything can by added to the OSM schema, it is only when you scan the full dataset that you are likely to get every attribute name exposed in your Workbench (They are still there but not exposed).

 

For you case, you could either download the URL data once and then setup with an entire scan and then just change the input parameter to the url afterwards (although new attributes in future won't be exposed).

Or since you are just after a few elements, just use an attributeexposer after the reader and type the relevant ones in and then you can use in workbench.

If you need all the attributes that osm holds in the output, you will probably need to make dynamic attributes on the output.

Cheers,

Todd


Hi,

The osm reader is using a number of features and then setting a schema. Because anything can by added to the OSM schema, it is only when you scan the full dataset that you are likely to get every attribute name exposed in your Workbench (They are still there but not exposed).

 

For you case, you could either download the URL data once and then setup with an entire scan and then just change the input parameter to the url afterwards (although new attributes in future won't be exposed).

Or since you are just after a few elements, just use an attributeexposer after the reader and type the relevant ones in and then you can use in workbench.

If you need all the attributes that osm holds in the output, you will probably need to make dynamic attributes on the output.

Cheers,

Todd

Seconding Todd here: I think the most idiomatic way to get access to an attribute that you know should be on a feature is to simply expose it with an AttributeExposer. Then you can use an AttributeFilter or Tester to route features based on whether they have the attribute.

 

 


The AttributeExposer was indeed what I was looking for, getting only some elements rather than the entire OSM tags set, and being able to use it as attributes afterwards.

 

Thank you both very much for your explanations !

Reply