Skip to main content

I have a feature class with cycling and walking routes (with ID and Name) and a feature class with the starting points of the (circular) routes. I want to write all the routes in the feature class to separate gpx-files. Each gpx-file should have the name of the route in its filename.

I tried with the ‘fanout’ option in the writer, but the resulting files are no gpx-files and are very small (1kB), so without content I guess. 

Any advise? 

Hi ireen.

You don’t mention what you have done in any detail, so I’m guessing a bit here.

Routes are usually not lines in a GPS, but points, that the GPS needs to pass when calculating the route. That may be a problem.

As for the fanout, you just need to bring up the text editor for the fanout expression, and use e.g. the route_id in the expression, like this:

Hope this helps.

 


If it does not work can you share an image of your workbench?

The FeatureWriter is more intuitive when using fanout. Maybe this helps you get the settings right.


I thought I included the workbench with my question, but that didn’t seem to work. I think I am doing something wrong with the writer. The writer looks like this. The fanout works, but the resulting gpx is not one file, but two (empty) files:
 

Result:
 

 


The reason that you get two files is because the Route writer or the RoutePoint writer does not receive a @Value(name) attribute. And because it does not get this attribute it creates a .gpx file.

...

The FeatureWriter is more intuitive when using fanout. Maybe this helps you get the settings right.

It's good to realise that because one path in your workbench knows about an attribute, this does not mean the other path knows about the attribute. Connecting both paths to the same transformer does not help, because if one feature knows about an attribute does not mean the other feature knows about the attribute.

In your case it means that you have to create the name attribute before the features split. Or FeatureMerge the name attribute from one path to the other.

With path i mean the connectors between the transformers.


Reply