Closed henry296 closed 7 years ago
I switched to using the AddFeaturesToFeautreLayer tool from the Add features to service sample instead of the AddFeatures from the append to feature class sample so I could specific a chunk size. I'm still getting the HTTP 404 error from this section of code: try: fst = featureservicetools.featureservicetools(securityinfo) if fst.valid == False: print fst.message else:
fs = fst.GetFeatureService(itemId=itemId,returnURLOnly=False)
if not fs is None:
fs_url = fst.GetLayerFromFeatureService(fs=fs,layerName=layerName,returnURLOnly=True)
if not fs_url is None:
results = fst.AddFeaturesToFeatureLayer(url=fs_url, pathToFeatureClass=fc,
chunksize=1000)
if 'addResults' in results:
print "%s features processed" % len(results['addResults'])
I figured out how to use the chunk size. Since I had the chunk size at 1000 it was trying to load all of the features in a single load. I changed it to 1 and it loaded each feature one at a time. I will try to find the right sweet spot for this feature class.
I used the append features from feature class sample to build a script. It works fine with point features, but when I try to upload 745 polygon features, I get this error: HTTPError: HTTP Error 404: Not Found when executing the fl.addFeatures step. Here is the code. The itemID is defined earlier in the code because I first delete all of the features.
I download from GitHub about a month ago.
db_fc = "Database Connections\Connection to SQL12-P-0301.sde\MarketResearch.DBO.Location" HostedServices_gdb = "S:\Market Research\ESRI\HostedServices.gdb" layerName = "ExistingStoreTradeAreasHosted" #Layer name on ArcGIS Online to load data
ArcRest or ArcRestHelper
Version or date of download
Bug or Enhancement
Repo Steps or Enhancement details