How draw lines between two point?

1017
8
03-19-2021 12:00 AM
Radzhabasda
New Contributor II

I try draw line between points, but on map i dont see results

input_table = r"C:\Users\Admin\table.csv"
out_lines = r"C:\Users\Проект.gdb\Результат"
#XY To Line
arcpy.management.XYToLine(input_table,out_lines,
                         "LOND1","LATD1","LOND2",
                         "LATD2","GEODESIC","idnum")

table.csv

idnum;LOND1;LATD1;LOND2;LATD2
1;47.43388800000008;42.983686000000034;47.43402500000008;42.98425700000007
2;47.43412900000004;42.98377300000004;47.43314600000008;42.981682000000035
3;47.433530000000076;42.983711000000085;47.43436800000006;42.985129000000086
Tags (4)
0 Kudos
8 Replies
nita14
by
Regular Contributor

Hi,

check if out_lines are automatically added to to the map. If not add it from your .gdb. Next, right click the layer and choose Zoom to Layer. Check the attachment below.

BR,

Adam

 

0 Kudos
Radzhabasda
New Contributor II

Outline is not created. How it create?

0 Kudos
nita14
by
Regular Contributor

What do you mean by outline? You can change the symbology as the respective ArcGIS Pro tab.

0 Kudos
Radzhabasda
New Contributor II

Sorry, no outline. I mean - feature out_lines is not created on map

 

0 Kudos
Radzhabasda
New Contributor II

Radzhabasda_0-1616143385977.png

I not see this feature in project

 

 

0 Kudos
nita14
by
Regular Contributor

ok. In ArcGIS Pro/ ArcMap Catalog window, navigate to

C:\Users\Проект.gdb

 Do you see Результат? If yes, drag and drop it into your map window.

0 Kudos
DanPatterson
MVP Esteemed Contributor

XY To Line (Data Management)—ArcGIS Pro | Documentation

requires a table of the appropriate structure

it won't take a semi-colon separated csv file as input, you need to make convert it into a geodatabase table first


... sort of retired...
0 Kudos
Radzhabasda
New Contributor II

Add some changes. Code works, but in arcgis i dont see changes

# -*- coding: utf-8 -*-

import arcpy
import os
import json
arcpy.env.workspace = r"C:\Project.GDB"

from arcpy import env

featureList = []

input_table = r"C:\Users\Admin\table.csv"
out_lines = r"C:\Project.GDB\Результат"

0 Kudos