Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

createReplica not downloading any result #178

Closed jiay0921 closed 8 years ago

jiay0921 commented 8 years ago

I am trying to create replica using ArcREST version 3.5_Release. The script works well, but the only problem is that it won't download the filegdb directly (this means nothing will be downloaded in out_path folder). I need to manually copy the url from result and download zip file. I am wondering if there is a way to download the filegdb directly. The script and result are shown below.

Script: result = fs.createReplica(replicaName='Demo', layers=[0], layerQueries={"0":{"where": "COUNTY_LAB = 'Ocean County'" }}, returnAttachments=True, attachmentsSyncDirection='bidirectional', dataFormat="filegdb", out_path=outDir)

Result: {u'replicaID': u'', u'responseUrl': u'http://services1.arcgis.com/QWdNfRs7lkPq4g4Q/ArcGIS/rest/services/Envr_admin_public_access_3857/replicafiles/9dcab46019a045cbbcb4612c44eaf89.zip', u'transportType': u'esriTransportTypeUrl', u'replicaName': u'Demo'}

cam-mcevenue commented 8 years ago

I too am having the same problem. The only difference is I am using v3.0.1. If I run the following code:

result = fs.createReplica(replicaName='Demo', layers='0', keep_replica=False, 
                          layerQueries=None, 
                          geometryFilter=None, 
                          returnAttachments=False, 
                          returnAttachmentDatabyURL=False, 
                          returnAsFeatureClass=True, 
                          out_path='C:\\temp')

print result

Result:

[]

The result is an empty list object. Setting returnAsFeatureClass=False, the result object is the same as the user above, the url to the zip file.

achapkowski commented 8 years ago

issue resolve with latest commit for v3.5.4 in dev. Thank you for bringing this to our attention. See commit 6a0cea9c71a5738542fa3636a1ed1c79eacd52d4

jiay0921 commented 8 years ago

@achapkowski Do you know why the create replica function doesn't return replicaID? Thanks!