Skip to main content
Solved

GeoJSON with LineString from JSON


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6

Hi all, 

I have a JSON file. Each object in the file has the coordinate of the start and end point of a line. I would like to transform it to geojson file with linestring. 

Any ideas how can i do this? 

Example:

{
        "cityName" : "Brussel",
        "endPoint.x" : "4.31888222694397",
        "endPoint.y" : 50.79171001911163,
        "startPoint.x" : "4.3186622858047485",
        "startPoint.y" : 50.79149007797241
 }

Best

Best answer by redgeographics

The easiest option would be to use 2 VertexCreators, the first one to replace the current geometry (if there is any) with a point using startPoint.x and startPoint.y and then a second one to add a point using endPoint.x and endPoint.y

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

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+48
  • Celebrity
  • Best Answer
  • April 10, 2019

The easiest option would be to use 2 VertexCreators, the first one to replace the current geometry (if there is any) with a point using startPoint.x and startPoint.y and then a second one to add a point using endPoint.x and endPoint.y


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • April 10, 2019
redgeographics wrote:

The easiest option would be to use 2 VertexCreators, the first one to replace the current geometry (if there is any) with a point using startPoint.x and startPoint.y and then a second one to add a point using endPoint.x and endPoint.y

Works! Thank you very much =)

 

 


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