Can't Make XY Event Layer from a table in ModelBuilder ArcGIS 10.3

4739
8
06-21-2016 02:57 PM
StacyStrickland
New Contributor II

Had a model built that worked about a month ago and today I can't figure out why it is getting stuck at the Make XY Layer step. Here is the Python code from the model:

arcpy.MakeXYEventLayer_management(CopiedTbl_View, "Lon", "Lat", XYLayer, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision", "")

I made sure that the table being imported from an Access database in previous steps has the Lat/Lon field in numeric format and still it doesn't work. I have attached a pic of the whole model for reference.

8 Replies
BlakeTerhune
MVP Regular Contributor

What does the error message say?

0 Kudos
StacyStrickland
New Contributor II
0 Kudos
andrewj_ca
Occasional Contributor II

Hey Stacy,

I use the below syntax in python very successfully.  Does the output from model builder differ from this?

# Process: Make Query Table...
  try:
       print "Making table..."
       arcpy.MakeQueryTable_management(tbl_source, event_table, "NO_KEY_FIELD", "", "", "")
  except:
       print arcpy.GetMessages()


  # Process: Make XY Event Layer...
  print "Creating XY event layer..."
  arcpy.MakeXYEventLayer_management(event_table, "X", "Y", event_layer, "PROJCS['NAD_1983_UTM_Zone_17N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-81.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 1000;0 1;0 1;0.002;0.002;0.00002;IsHighPrecision")

Cheers

0 Kudos
StacyStrickland
New Contributor II

Other than the projection differences, your Make XY Event Layer code is the same as mine. Thanks, though.

0 Kudos
JamesCrandall
MVP Frequent Contributor

Does it work if done manually in ArcMap?  How about if you run the Make XY Event Layer tool on your input? 

These might uncover if there's an issue with the input itself.

StacyStrickland
New Contributor II

It does work manually in ArcMap using the Make XY Event Layer tool.

I have tried deleting the tool in ModelBuilder and adding it back in with no success. I'm truly stumped!

0 Kudos
GregSnelling
New Contributor III

Stacy-

Have you found a solution for this yet?  I'm having the same problem.  

I'm running on ArcGIS Desktop advance 10.4.1.

Thanks,

Greg

0 Kudos
GregSnelling
New Contributor III

Stacy,

I receive a response to one of my posts today on this same issue I had in model builder.  Layers (eg. feature layers, table views, or event layers) are stored temporarily in memory.  Your script may be getting stuck because it might need to convert to a feature class after creating the xy event layer.  Alternatively, you can use Convert Coordinate Notation, which goes from a flat file or excel spreadsheet directly to a point feature class.

Best,

Greg

0 Kudos