Skip to main content
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
In my opinion, `arcgis-desktop` tag should be. Because the error is related arcgis desktop. ArcGIS 10.2.2 uses Python 2.7.5 and ArcGIS 10.7 uses Python 1.7.16
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404
import arcpy
import sys
import os

#arcpy.env.workspace = "C:\\Test\\addresspoint"
#arcpy.env.overwriteOutput = True

input_database = "C:\\Test\\addresspoint\\connection\\Test.sde"
out_layer_name = "addPointtbv"

Query = """ SELECT S_ID, S_Key, Address, City, State, ZipCode, Latitude, Longitude FROM [ST].[dbo].[ST] """
Unique_Identifier_Field_s_ = ["S_ID", "S_Key"]
Shape_Type = "POINT"
SRID = "3857"
Coordinate_System = """PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],
PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]];-20037700 -30241100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"""

# Process: Make Query Layer (Make Query Layer) 
add_pnt = arcpy.MakeQueryLayer_management(input_database, out_layer_name, Query, Unique_Identifier_Field_s_,Shape_Type, SRID, Coordinate_System)                                              
print(out_layer_name + " query layer is created")

X_Field="Latitude"
Y_Field="Longitude"  
Spatial_Reference = Coordinate_System

# Process: Make XY Event Layer (Make XY Event Layer) 
in_layer = out_layer_name
out_layer = "xyeventlayer"

arcpy.MakeXYEventLayer_management(in_layer, X_Field, Y_Field, out_layer, Spatial_Reference)
print(out_layer + " is saved")

Error:

arcgisscripting.ExecuteError: ERROR 000223: Cannot extract event table properties

Failed to execute (MakeXYEventLayer).

It does work in ArcGIS Pro based python 3.6.9 (64 bit) anaconda, It is not working at all in 2.7.5 and 2.7.16 which desktop based installation and it is 32 bit.

import arcpy
import sys
import os

#arcpy.env.workspace = "C:\\Test\\addresspoint"
#arcpy.env.overwriteOutput = True

input_database = "C:\\Test\\addresspoint\\connection\\Test.sde"
out_layer_name = "addPointtbv"

Query = """ SELECT S_ID, S_Key, Address, City, State, ZipCode, Latitude, Longitude FROM [ST].[dbo].[ST] """
Unique_Identifier_Field_s_ = ["S_ID", "S_Key"]
Shape_Type = "POINT"
SRID = "3857"
Coordinate_System = """PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],
PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]];-20037700 -30241100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"""

# Process: Make Query Layer (Make Query Layer) 
add_pnt = arcpy.MakeQueryLayer_management(input_database, out_layer_name, Query, Unique_Identifier_Field_s_,Shape_Type, SRID, Coordinate_System)                                              
print(out_layer_name + " query layer is created")

X_Field="Latitude"
Y_Field="Longitude"  
Spatial_Reference = Coordinate_System

# Process: Make XY Event Layer (Make XY Event Layer) 
in_layer = out_layer_name
out_layer = "xyeventlayer"

arcpy.MakeXYEventLayer_management(in_layer, X_Field, Y_Field, out_layer, Spatial_Reference)
print(out_layer + " is saved")

Error:

arcgisscripting.ExecuteError: ERROR 000223: Cannot extract event table properties

Failed to execute (MakeXYEventLayer).

It does work in ArcGIS Pro based python 3.6.9 (64 bit) anaconda, It is not working at all in 2.7.5 and 2.7.16 which desktop based installation and it is 32 bit.

import arcpy
import sys
import os

#arcpy.env.workspace = "C:\\Test\\addresspoint"
#arcpy.env.overwriteOutput = True

input_database = "C:\\Test\\addresspoint\\connection\\Test.sde"
out_layer_name = "addPointtbv"

Query = """ SELECT S_ID, S_Key, Address, City, State, ZipCode, Latitude, Longitude FROM [ST].[dbo].[ST] """
Unique_Identifier_Field_s_ = ["S_ID", "S_Key"]
Shape_Type = "POINT"
SRID = "3857"
Coordinate_System = """PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],
PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]];-20037700 -30241100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"""

# Process: Make Query Layer (Make Query Layer) 
add_pnt = arcpy.MakeQueryLayer_management(input_database, out_layer_name, Query, Unique_Identifier_Field_s_,Shape_Type, SRID, Coordinate_System)                                              
print(out_layer_name + " query layer is created")

X_Field="Latitude"
Y_Field="Longitude"  
Spatial_Reference = Coordinate_System

# Process: Make XY Event Layer (Make XY Event Layer) 
in_layer = out_layer_name
out_layer = "xyeventlayer"

arcpy.MakeXYEventLayer_management(in_layer, X_Field, Y_Field, out_layer, Spatial_Reference)
print(out_layer + " is saved")

Error:

arcgisscripting.ExecuteError: ERROR 000223: Cannot extract event table properties

Failed to execute (MakeXYEventLayer).

It does work in ArcGIS Pro based python 3.6.9 (64 bit) anaconda, It is not working at all in 2.7.5 and 2.7.16 which desktop based installation and it is 32 bit.

edited tags; edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
added 14 characters in body; added 118 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Rollback to Revision 1 - Edit approval overridden by post owner or moderator
Source Link
Loading
Source Link
Loading