Select to view content in your preferred language

Creating shp. from txt

1144
6
03-21-2024 04:48 PM
Labels (3)
anxiousvole214
Emerging Contributor

Hi all,

I'm having trouble creating a shapefile from a starting txt file. I've opened the table for the file and have added the fields of latitude and longitude (Float) but the problem is that, when I try to enter the instructed fields in the Calculate Field dialogue box, I get an error message. 

Input table: PlotXY

Field name: latitude1

Expression type: Python 3

lat: !latitude!/3600

I've tried doing this for both latitude and longitude, but I keep getting a null field in both of them, and an error message pops up saying I have invalid fields.

I've spent days trying to figure out what's wrong and I've scoured forums and various help sites but nothing works. 

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

why are you dividing latitude by 3600?  

Decimal degree values are expected for latitude and longitude and the field should be a Double type, from there you can create geometry objects


... sort of retired...
0 Kudos
anxiousvole214
Emerging Contributor

Those were the instructions in the document. Float type, divide by 3600

0 Kudos
anxiousvole214
Emerging Contributor

I'll try this though

0 Kudos
anxiousvole214
Emerging Contributor

So I succeeded in getting past this last step. The fields of latitude and longitude now say 0 instead of null. In the contents pane, there is now a "Plot_XYTableToPoint" with a little green dot under it. How do I get this to a shapefile?

0 Kudos
Dale_Honeycutt
Frequent Contributor

There's always the XY Table To Point geoprocessing tool, but won't do you much good if your lat/long's are all zero.  

Just spit balling here: What are the data types of your fields?  I'm thinking your input fields are text?  If so, try this expression:

 float(!latitude!)/3600.0

 If your longitude field is text, add another field of type double and calculate that field using float() as well.

I've no clue what the little green dot means -- never seen it.

anxiousvole214
Emerging Contributor

I will try this, thanks!

0 Kudos