Select to view content in your preferred language

Create lines from two point feature classes.

273
2
12-03-2024 12:00 PM
AdamTerrell
Occasional Contributor

I have a layer called Water_Meters that shows all the locations of water meter points in the city.

I also have an address layer called THECAN_LG_LX that shows all the address points in the city.

Both these layers have a field in their attribute table called LOCID. LOCID is a unique identifier associated with addresses.

I have joined the THECAN_LG_LX layer to the Water_Meters layer using LOCID.

I need to draw a line from each water meter point to the address associated with that meter.

I have had no luck with this. I have been utilizing ChatGPT and Point to Line, XY to Line, and Python script have been suggested. Nothing has worked so far. Results have varied from an empty line feature and lines being drawn from all the meters.

If anyone has any suggestions on tools and wouldn't mind pointing me in the right direction, it would be much appreciated.

0 Kudos
2 Replies
Brian_McLeer
Frequent Contributor

The XY to line tool may work for this, but you may need to add x and y fields to both datasets and the common LOCID field would be the common join. Is the relationship 1:1? When you did the XY to line, did you add and calculate the x and y fields or are the in the data already?

 

https://www.youtube.com/watch?v=p7Qxy1TWWfc

Brian
AdamTerrell
Occasional Contributor

The relationship is many to one. There can be multiple meters for one address. I did not really attempt the XY to Line tool because the address dataset is administered by another department (city problems) and I did not want to have to add any fields. I finally was able to get a Python script from ChatGPT that worked.

I honestly felt like this should have been more of a straightforward process. If time allows, I will attempt your recommendations and see how that works.

When I attempt this, should the tables be joined before running the XY to Line tool?

0 Kudos