Skip to main content

Hi users,

I have a script that create a route between two points ( start and end ) using library googlemaps.

The return is going well to attribute in format JSON.

The idea is extract the route information in 'html_instructions'. In PyCharm is work when i execute it:

I configured my Workspace and execute ( attached template file), but it brings only the last route between two points.

How can i get inside my Workspace all route and turn a attribute? Attached the JSON generated by request googlemaps and Workspace.

Thanks in Advance,

Live from my gate at Vancouver airport..! 🙂

 

The more "FME way" to do it, is to not use a PythonCaller at all, but an HTTPCaller, I guess. That will return a JSON response, from which you can extract the instructions using a JSONExtractor, for instance.

 

However, if you do want to use the PythonCaller, please have a look at the attached workspace. The trick is to write to a list attribute. You can concatenate the instruction strings afterwards using a ListConcatenator if you want.


Live from my gate at Vancouver airport..! 🙂

 

The more "FME way" to do it, is to not use a PythonCaller at all, but an HTTPCaller, I guess. That will return a JSON response, from which you can extract the instructions using a JSONExtractor, for instance.

 

However, if you do want to use the PythonCaller, please have a look at the attached workspace. The trick is to write to a list attribute. You can concatenate the instruction strings afterwards using a ListConcatenator if you want.

Hello @sander_s , thanks your time when you wait your flight :)

 

Yes, i want to solve this with the transformer PythonCaller and your Workspace was perfect to resolve this. Thanks

 

 

I wish that you will have a excellent return your home.

 

 


Reply