Skip to main content
Solved

Doens't show the values in python

  • May 26, 2017
  • 2 replies
  • 9 views

danilo_fme
Celebrity
Forum|alt.badge.img+51

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,

Best answer by geosander

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

geosander
Forum|alt.badge.img+7
  • Best Answer
  • May 26, 2017

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.


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Author
  • Celebrity
  • May 27, 2017

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.