Skip to main content
Solved

GeoJSON with LineString from JSON

  • April 10, 2019
  • 2 replies
  • 17 views

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

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.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3702 replies
  • 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
  • 89 replies
  • 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

Works! Thank you very much =)