Insert GEODESIC line through InsertCursor

663
1
10-17-2012 02:20 AM
demdeberanz
New Contributor II
Hi guys,
   I wrote a python script that takes in input two couples of coordinates and the generates a line feature(this line connect the points located at the coordinates of input couples)  adding it in an already existing feature class.
Basically the script creates two Point Features (using gp.CreateObject("Point") and setting x and y parameters),

after it adds this two points in an array (using gp.CreateObject("Array")).

Lastly, it creates a new row, through the method NewRow() of a previously declared InsertCursor and sets the shape attribute as the array that contains the two input Points, and then it adds the row using the InsertRow() method.

I realized that in this way what the script creates it isn't a GEODESIC line.

For example in the XYToLine Tool, that accomplish a similar task, the user can choose the kind of line the tool will create. Obviously I can't use this tool for my purposes


How can I fix this problem?
Tags (2)
0 Kudos
1 Reply
MarcinGasior
Occasional Contributor III

I realized that in this way what the script creates it isn't a GEODESIC line.

For example in the XYToLine Tool, that accomplish a similar task, the user can choose the kind of line the tool will create. Obviously I can't use this tool for my purposes


As far as I know, Python has no option to create geodesic features.

But you can use workaround to use XY To Line tool.
Just create empty table manually or in script with 4 fields (when in script it can be temporary in_memory table).
Then use InsertCursor to populate the table with your coordinates.
Now you have a table with coordinates which can be an input for the tool.

Edit:
Have you tried inserting a line into feature class which is in Geographic Coordinate System? Is such line non-geodesic either?
0 Kudos