Skip to main content

Hi

Hopping this is the correct forum

I'm trying to work out how to extract place names from OpenStreetMap

(.osm) files from geofabrik.de

For testing I picked Wales

Ultimately I will push into PostgreSQL / PostGIS database hopefully

without corrupting non English names

 

In the attached Workbench I used AttributeExposer to show everything this

was done using the cache

My first question how do I make that dynamic?

There will be some distinct attributes like

name, osm_id, is_in, wikidata etc

 

and some dynamic ones especially non English names

 

My Second question is

how do I group similar attributes together and merge into a JSON string

for instance alt_name:en, alt_name:fr, alt_name:* grouped into alt_name

json this with then be held as a jsonb database type

 

Similarly name: en, name:fr, name:* grouped into official_names json

 

I couldn't see how to do this using AttributeFilter or Tester

 

All other attributes not yet accounted for grouped into all_tags json string

 

I've done something similar in C# with dynamic data in that instance I used switch case to loop though all the attribute names Is there a way to do that in FME?

 

Off course if there is a better way to do this please share

 

 

Since you are altering the schema, you have a couple of options for making this schema:

1) Schema from a lookup table

2) Schema from Schema Feature/Multiple Sources

I'd highly recommend checking out the Dynamic Workflows article as it will walk through a couple examples that should help you achieve what you are looking for. Depending on which method you use, the SchemaSetter transformer might also come in handy.

 

For question 2, perhaps the BulkAttributeRenamer could come in handy for renaming and the JSONTemplater for formatting the JSON string.


Reply