Solved

How to build a path between points in JSON


Badge

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

icon

Best answer by david_r 17 June 2019, 12:54

View original

8 replies

Userlevel 5

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.

Badge

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)

Badge

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.

Userlevel 5

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.

Badge

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.

Badge

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:

Userlevel 5

The following worked for me:

Result based on the sample feature you posted:

Badge

The following worked for me:

Result based on the sample feature you posted:

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

Reply