Skip to main content
Solved

How to build a path between points in JSON

  • June 17, 2019
  • 8 replies
  • 58 views

Forum|alt.badge.img

Hello!

 

 

I have a problem with creation a path between points, which are saved in JSON file. I tried a extract JSON file with using a JSONExtractor, and when I got coordinates of my points - but not in the form of a list.

Next to this, I use a StringReplacer Transformer to get a list of coordinates. And the result looks like this:

But when I try a read it to Path or LineBuilder, I don't have any result.

Below, I uploaded a part of my Workbench, where I try to build a path.

 

If anyone knows the solution of my problem, I will be grateful for any help or tips.

Greetings,

Karolina

Best answer by david_r

The following worked for me:

Result based on the sample feature you posted:

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.

8 replies

david_r
Celebrity
  • 8394 replies
  • June 17, 2019

Is this some flavor of GeoJSON, by chance? If so, you can simplify your life significantly by simple passing the entire geometry string to the GeometryReplacer set to "GeoJSON" or "Esri JSON", depending.


Forum|alt.badge.img
  • Author
  • 9 replies
  • June 17, 2019

Is this some flavor of GeoJSON, by chance? If so, you can simplify your life significantly by simple passing the entire geometry string to the GeometryReplacer set to "GeoJSON" or "Esri JSON", depending.

Thanks David for your answer.

I tried GeometryReplacer set to "GeoJSON" but my output is Rejected. When I tried "Esri JSON", result is better (is not rejected, but I don't see any difference between Output and original JSON)


Forum|alt.badge.img
  • Author
  • 9 replies
  • June 17, 2019

Is this some flavor of GeoJSON, by chance? If so, you can simplify your life significantly by simple passing the entire geometry string to the GeometryReplacer set to "GeoJSON" or "Esri JSON", depending.

And probably my oryginal file is not GeoJSON. I download it from other service (which is created in our company) with using a HTTPCaller. I asked a Leader of Project about a type of JSON file and he told me, that this is probably JSON file, not GeoJSON.


david_r
Celebrity
  • 8394 replies
  • June 17, 2019

And probably my oryginal file is not GeoJSON. I download it from other service (which is created in our company) with using a HTTPCaller. I asked a Leader of Project about a type of JSON file and he told me, that this is probably JSON file, not GeoJSON.

If you could post a complete JSON feature here, as text, that would be helpful.


Forum|alt.badge.img
  • Author
  • 9 replies
  • June 17, 2019

If you could post a complete JSON feature here, as text, that would be helpful.

result.txt

Sorry for in this form, but I had a problem with adding a comment with long contents JSON file.


Forum|alt.badge.img
  • Author
  • 9 replies
  • June 17, 2019

If you could post a complete JSON feature here, as text, that would be helpful.

But when I download, upload JSON file with using HTTPCaller, it looks like that:


david_r
Celebrity
  • 8394 replies
  • Best Answer
  • June 17, 2019

The following worked for me:

Result based on the sample feature you posted:


Forum|alt.badge.img
  • Author
  • 9 replies
  • June 17, 2019

The following worked for me:

Result based on the sample feature you posted:

Thanks a lot @david_r. It is my expected result :)