Select to view content in your preferred language

Mapping points in ArcGIS pro using python

604
3
08-25-2022 12:54 PM
ColeHowell
New Contributor III

I guess the first thing for me to do is describe the problem I'm having. I've recently been hired into an engineering department for a water authority and I'm learning about GIS and how to use it. The GIS analyst at the company has shown me how things like hydrants and water meters are added to the map from the GPS probe and the method being used seems very tedious. He basically adds everything from ArcGIS pro manually, copying points from the GPS layer to the master layer with everything on it. He has to go in and transfer data from tables and manually put in points on the map. Considering the repetitive nature of this system, it seems like someone should be able to write a python script to automate all of this. I have some programming experience so I thought I would take a crack at it; however, I've found very little documentation on using python to put points onto the map itself. I've found plenty of stuff on editing the attribute tables and otherwise interacting with them which is great, but if I can't automate the insertion of points onto the map it feels like a moot point trying to write a script for this process. Any information would be appreciated, thanks in advance. I've attached the script I have so far to do this with

Tags (3)
0 Kudos
3 Replies
AlfredBaldenweck
MVP Regular Contributor

Try the Append tool; it copies geometry and attributes to another feature class.

0 Kudos
KATIEATKINSON
New Contributor III

This is really a job for a survey and editing map.

0 Kudos
TylerT
by
Occasional Contributor III

Hi @ColeHowell,

Lots of ways to go about this.  Here is one option which stays within Python using the Pandas and the Geoaccessor Namespace.

1) ETL your desired points and point attributes into a Pandas DataFrame.  Below is an example with one hard coded point (Old Faithful).  Ideally, you will not be hard coding your points, rather ETL'ing them from your source.  Pandas can load from many sources.

2) Convert the DataFrame to a Spatially Enabled DataFrame using the GeoAccessor Namespace.  Notice the new SHAPE column and Dtype of 'geometry'.

3) Write to a gdb. 

TylerT_0-1661809482144.png

HTH.

Tyler