So here is the problem. I have a text file with space delimited values. A standard text file with the headings separated by spaces and then on each next line values for these headings (columns) also separated with spaces. Each row represents a certain geographic point feature; however no coordinates (XY-pair) are stored in this text file.

My ultimate goal is to view each row in ArcMap individually (like one can do with the attribute table in ArcMap), edit the attribute values (if needed) and specify the point geometry of the feature by clicking on a map. And here is my issue – it seems as I cannot create a feature class without SHAPE field, but because I don’t have any coordinates in the source text file I cannot populate SHAPE field upon creating a new feature class.

What is the most efficient way of achieving this? I am a bit puzzled due to the workflow when all the attributes are populated yet the geometry is to be created. Ideally the solution would be to let user see the attribute table (obtained from the text file), then user selects a certain row user wants to work with, she digitizes a point on the map and the SHAPE field is populated with this point geometry. I understand that this is not how ArcMap was designed, but how one can come closest to this without investing too much in writing an advanced add-in or using ArcObjects?

I have considered so far:

  • creating a feature class from this text file with some random coordinates, but it is not an applicable alternative because to edit a point feature a user would need to zoom to this point and then move it to another geographic area (using the ArcMap editing session). Since the geographic extent of the points in this collection might be quite large, it would be nearly impossible to use this approach.

  • creating a geodatabase table from the text file and then let user click on the map to digitize a map point which would represent a certain row in the table (however creating a point feature in a separate feature class). Thereafter, user can choose to transfer all the attributes of a geodatabase table row to the newly created feature (was thinking of using arcpy.da.UpdateCursor here or running a Python script with the join table & feature class > export logic). However, this would imply that when user digitizes a point feature, he would need to enter a custom ID that would match the ID of the row in the table. Right now it seems as there is no maintained unique ID heading in the text file and since multiple text files can be received independently, this approach looks also pretty cumbersome.

Any other suggestions folks?

2 Answers 2


I would use your second approach. As part of your import to geodatabase table process, create a unique ID (using Calculate Field, for example -- see the "Calculate a sequential ID or number based on an interval" example). Create a point feature class with an ID field that your editors would populate when they create new points. Join the point feature class to the table on the ID and as soon as the ID is populated and matches a row in the table it should display the joined attributes.

This is probably about as good as it gets without custom development.

  • 2
    A possible extension of @blah238s idea. I don't know if this is possible but if you can control the order in which the editors digitize the points you could skip having them manually add the id to the point. Instead keep the IDs blank on the points and then at then use the same sequence generating field calculation on the points. This should cause IDs to match and then you can join. Will save the editors a step but introduces a huge potential error.
    – Dowlers
    Apr 17, 2013 at 18:45
  • Thanks very much. I was almost on my way to automate this in Python but then decided to try the Python add-in first. It did worked out very well. @Dowlers, thanks, that is also a valuable thought. I'd definitely have used this if I had chosen going the blah238 way. Apr 20, 2013 at 17:10

I've ended up writing a Python add-in with some simple logic behind it:

  1. User selects a feature in the attribute table of the feature class created from the text file (here inserting null geometries or just 0,0 for coordinates would work fine).

  2. User chooses what location this feature will have by double-clicking this location on the map. This fires up several things.

2a. The add-in's onMouseDownMap(self, x, y, button, shift) function gets XY coordinates of where the user clicks (in fact, only the first click of the mouse is required here).

2b. The add-in's onDblClick(self) function starts running. The logic checks with the Get Count GP tool if there is exactly one feature selected. Here is the arcpy.da.UpdateCursor comes into play. I am updating the geometry of the selected feature based on the XY values received earlier in another function.

Lastly, refreshing active view.

The Python add-ins turned out to be powerful and easy to develop, highly recommended. The add-in works fine and does what it needs to get done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.