Select to view content in your preferred language

Create lines from points

104
3
yesterday
RITASHKOUL
New Contributor III

 

Hi,

I am creating a GP tool that will have a input feature layer and also have output feature class path. I have a custom logic which first is converting points layer data into a group of related points and then each group of related points are converted into single line or not.
But there are different types of relationship between these related points. One basic use is to create a straight line from the points. Next one can be there will always be 3 points in that case we need to create an arc. In another use case, points will be created as closed arc and also another one is where a closed square will be created. This will be identified using a custom logic into which related points will fall into.

My first question is can we handle all these cases and different shapes to put into a line/poly line output feature class.
And second question is what is a best way to handle this? Should we iterate through all these related points to create poly lines which will be inserted into some table and then at last will be converted to our mentioned output feature class. Or is there any existing GP tool that can help?

 

What I have done is first I created an empty feature class and then creating lines from related points into the feature class. But I can't seem to find any API to create arc or closed arc using arcpy.

@AlfredBaldenweck  @HaydenWelch @BlakeTerhune @JakeSkinner @Luke_Pinner 

Tags (1)
0 Kudos
3 Replies
BlakeTerhune
MVP Regular Contributor

It looks like the geometry object in arcpy does not support the creation of true curves.

Any true curves in the geometry will be densified into approximate curves in the WKT string.

A possible workaround seems to be to create your feature as GeoJSON and load it in a FeatureSet, then copy the features.

0 Kudos
RITASHKOUL
New Contributor III

@BlakeTerhune I am iterating and inserting straight line data as well. Can we also update/copy in the same iteration in the same feature class as well for arc and closed arc? I have a dictionary type data of a feature which represents points. Now how to create json out of it and then add curves data and the update the same in my output feature class?

0 Kudos
BlakeTerhune
MVP Regular Contributor

Yes, you can use the same method for creating regular (non-curve) polyline features. As for how to construct your GeoJSON, I don't have experience doing that with curves. I recommend reading the documentation. For practice, you can manually create sample features (with curves) in ArcGIS Pro, then export them to GeoJSON to see how the structure changes for different geometries.

0 Kudos