Skip to main content
Solved

Is there a way to pass geojson simply as string parameter in the Rest API and not as file or URL?

  • March 9, 2022
  • 4 replies
  • 173 views

Forum|alt.badge.img

I am developing a leaflet-based web app. I would like to pass the geojson drawn by a user in leaflet through the FME rest API to my workspace in FME server. The workspace contains a geojson reader, topologycalculator and geojson writer. But so far, the geojson reader accepts only a file or URL. Is it possible to send it along with URL as a parameter without the need to create a file. Something like

URL Example :http://desktop-f25rpfv:8080/fmerest/v3/transformations/submit/GeneralizationPredict/networkcalculator.fmw?data = {geojson object}

 

 

Best answer by redgeographics

Thank you. I am totally new to FME and after struggling for a day, I still could not figure out how to use the geometry placer in FME Workbench. Attached is a very simple workspace where I am creating user parameter called data. I give it as a source to GeometryReplacer and try to write the output. But I am not getting any result out of the geometry replacer. Could you please let me know what I am doing wrong?

This turned out to be a little bit more complex than I thought, as the json contains more than just geometry.

 

Screenshot 2022-03-10 at 14.03.43You'll need to use a Creator to kick things off, then an AttributeCreator to store the parameter value in an attribute. Then a JSONFragmenter and JSONFlattener to tear the JSON apart and a GeometryReplacer to build geometry.

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.

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • March 9, 2022

You can create a user parameter for your workspace, fill that with the GeoJSON string and then use a GeometryReplacer to build geometry, using that parameter as source.


Forum|alt.badge.img
  • Author
  • 7 replies
  • March 10, 2022

You can create a user parameter for your workspace, fill that with the GeoJSON string and then use a GeometryReplacer to build geometry, using that parameter as source.

Thank you. I am totally new to FME and after struggling for a day, I still could not figure out how to use the geometry placer in FME Workbench. Attached is a very simple workspace where I am creating user parameter called data. I give it as a source to GeometryReplacer and try to write the output. But I am not getting any result out of the geometry replacer. Could you please let me know what I am doing wrong?


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • Best Answer
  • March 10, 2022

Thank you. I am totally new to FME and after struggling for a day, I still could not figure out how to use the geometry placer in FME Workbench. Attached is a very simple workspace where I am creating user parameter called data. I give it as a source to GeometryReplacer and try to write the output. But I am not getting any result out of the geometry replacer. Could you please let me know what I am doing wrong?

This turned out to be a little bit more complex than I thought, as the json contains more than just geometry.

 

Screenshot 2022-03-10 at 14.03.43You'll need to use a Creator to kick things off, then an AttributeCreator to store the parameter value in an attribute. Then a JSONFragmenter and JSONFlattener to tear the JSON apart and a GeometryReplacer to build geometry.


Forum|alt.badge.img
  • Author
  • 7 replies
  • March 11, 2022

Worked like a charm!! Thank you very much for the help and effort.