Skip to main content
Question

Creating Polyline from Point data.

  • February 18, 2019
  • 6 replies
  • 206 views

gis2020
Participant
Forum|alt.badge.img

Hi All,

I am having the point data in which has X, Y for each point and trying to convert this to a polyline. but somehow I am not getting desired results. This point is derived from JSON query it has X, Y and one common field I am trying to use vertex cretor and then sorter on the common field and at the end, i am using LIne builder. but i am not getting desired results.

Can someone please suggest a way to resolve this?

Thank you in advance .

 

 

 

6 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

VertexCreator and LineBuilder is the way to go but it does require that the points are in order before connecting them. Do you have an attribute that indicate the order of the points within each line? If so, sort on the "common" attribute and then the order attribute, using a Sorter, before trying to connect them.


gis2020
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • February 19, 2019
redgeographics wrote:

VertexCreator and LineBuilder is the way to go but it does require that the points are in order before connecting them. Do you have an attribute that indicate the order of the points within each line? If so, sort on the "common" attribute and then the order attribute, using a Sorter, before trying to connect them.

hi, @redgeographics there is no order for a point. however, I am using sorter before line builder. Sorter is used on longitude field and Transaction_ID still I don't get desired results.


nielsgerrits
VIP
Forum|alt.badge.img+54

If this is related to this question I think the approach should be different.

In the full block of json you posted is a piece where the creation of a linesegment is described:

..., {            "type""CreateGeometry",            "featureType""ccom:4_0:ccom-Core:RoadElement",            "geometry": {                "type""LineString",                "coordinates": [                    [-412716042, -217824135],                    [-412710157, -217826553]                ]            },...

I suspect that all these pieces describe segments. Once you have the segments you might be able to connect those using a LineCombiner.

Added a workspace to break down a single part.

jsontoline.fmwt


gis2020
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • February 19, 2019
nielsgerrits wrote:

If this is related to this question I think the approach should be different.

In the full block of json you posted is a piece where the creation of a linesegment is described:

..., {            "type""CreateGeometry",            "featureType""ccom:4_0:ccom-Core:RoadElement",            "geometry": {                "type""LineString",                "coordinates": [                    [-412716042, -217824135],                    [-412710157, -217826553]                ]            },...

I suspect that all these pieces describe segments. Once you have the segments you might be able to connect those using a LineCombiner.

Added a workspace to break down a single part.

jsontoline.fmwt

Thank you @nielsgerrits i will try the workspace you shared.

   Indeed this is related to the other question which I posted earlier .. so from JSON i am getting the coordinate information for each line segments. one transaction id is linked to one line so all the coordinates are vertices of one line segment in this json code block.

 


redgeographics
Celebrity
Forum|alt.badge.img+49
gis2020 wrote:

hi, @redgeographics there is no order for a point. however, I am using sorter before line builder. Sorter is used on longitude field and Transaction_ID still I don't get desired results.

Looks like @nielsgerrits has already come up with a solution but I do want to add that in general you shouldn't sort on longitude or latitude unless the features run consistently E-W or N-S


gis2020
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • February 19, 2019
redgeographics wrote:

VertexCreator and LineBuilder is the way to go but it does require that the points are in order before connecting them. Do you have an attribute that indicate the order of the points within each line? If so, sort on the "common" attribute and then the order attribute, using a Sorter, before trying to connect them.

@redgeographicsI agree with you. as results are not consistent i am trying with different fields.

I am still testing with wb which @nielsgerrits has shared earlier.


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