Skip to main content
Solved

How to build a path between points in JSON


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:

View original
Did this help you find an answer to your question?

8 replies

david_r
Evangelist
  • 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
  • June 17, 2019
david_r wrote:

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
  • June 17, 2019
david_r wrote:

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
Evangelist
  • June 17, 2019
borko_k wrote:

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
  • June 17, 2019
david_r wrote:

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
  • June 17, 2019
david_r wrote:

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
Evangelist
  • Best Answer
  • June 17, 2019

The following worked for me:

Result based on the sample feature you posted:


Forum|alt.badge.img
  • Author
  • June 17, 2019
david_r wrote:

The following worked for me:

Result based on the sample feature you posted:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings