NumPy Array to Feature: Expected a readable buffer object

المشرف العام

Administrator
طاقم الإدارة
I am consuming data from a json web service with NumPy array to feature class an am receiving a TypeError: expected a readable buffer object. What is the cause of this?

containerItems = [] for sr in decoded2['Response']['ListOfServiceRequest']['ServiceRequest']: ContainerAddress = sr['SRAddress'] if sr['Latitude'] != '': container_y = sr['Latitude'] if sr['Longitude'] != '': container_x = sr['Longitude'] if sr['Latitude'] == '': container_blanky = sr['Latitude'] if sr['Longitude'] == '': container_blankx= sr['Longitude'] Containers = sr['ListOfLa311Containers'] Container_ReasonCode = sr['ReasonCode'] Container_SRNumber = sr['SRNumber'] Container_FirstName = sr['FirstName'] Container_LastName = sr['LastName'] Container_ResolutionCode = sr['ResolutionCode'] Container_HomePhone = sr['HomePhone'] Container_CreatedDate = sr['CreatedDate'] Container_UpdatedDate = sr['UpdatedDate'] try: if sr['ListOfLa311GisLayer'] != '{},': Container_GISLayer = sr['ListOfLa311GisLayer']['La311GisLayer'][0]['DistrictName'] print GISLayer except Exception: pass try: k_container_size = ' ' container_info = " " for sr in Containers: if("La311Containers" in Containers): lcontainers311 = Containers ["La311Containers"] for Containers in lcontainers311: k_container_size= Containers['ContainerSize'] k_container_type = Containers['ContainerType'] k_damage_lid = Containers['DamageonLid'] k_damage_axle = Containers['DamageonAxle'] k_damage_on_body = Containers['DamageonBody'] k_damage_on_handle = Containers['DamageonHandleEndcap'] k_damage_on_wheels = Containers ['DamageonWheels'] k_container_number = Containers['ContainerNumber'] k_container_reason = Containers['PickupReason'] k_container_request_for= Containers['RequestFor'] k_type_containers = Containers['Type'] if("La311Containers" in Containers): lcontainers311 if '90' in k_container_size: k_container_size = '90' elif '60' in k_container_size: k_container_size = '60' elif '30' in k_container_size: k_container_size = '30' if k_damage_lid == 'Y' and k_container_type == 'BLU': k_damage_lid = 'LDR' elif k_damage_lid == 'Y' and k_container_type == 'BLK': k_damage_lid = 'LDB' elif k_damage_lid == 'N' and k_container_type in ('BLK'): k_damage_lid = ' ' if 'Blue Recycling' in k_container_type: k_container_type = 'BLU' elif 'Black Refuse' in k_container_type: k_container_type = 'BLK' elif 'Green Yard Trimmings' in k_container_type: k_container_type = 'GRN' if k_damage_lid == 'Y' and k_container_type == 'BLU': k_damage_lid = 'LDR' elif k_damage_lid == 'Y' and k_container_type == 'BLK': k_damage_lid = 'LDB' elif k_damage_lid == 'Y' and k_container_type == 'GRN': k_damage_lid = 'LDG' if k_damage_on_body == 'Y': k_damage_on_body = 'BFT' if k_damage_on_handle == 'Y': k_damage_on_handle = 'HAN' if k_damage_on_wheels == 'Y': k_damage_on_wheels = 'WHL' if k_container_reason == 'Abandoned': k_container_reason = 'DAM' # # elif k_container_reason == 'Abandoned': # k_container_reason = 'ABD' if k_container_request_for == ' Damage': k_container_request_for = 'DAM' #request for = service type print k_container_type print k_container_size print k_damage_on_handle print k_damage_on_body except: print "No Container Info" Prior_Resolution_Code = ' ' CYLA_DISTRICT = " " Container_FullName = Container_FirstName + " " + Container_LastName + "Placeholder String" Containerdt = np.dtype([('Address', 'U40'), ('Y_CoordShape', '
 
أعلى