- I have a Hosted Feature service that I own and also have the Extract capability enabled.
- Contains two layers, of which I want to download the first layer into a file geodatabase
I was hoping to find a sample that uses arcgis.extract_data
This post is similar, but looks like the op ended up using ArcPy.
Have tried a few things:
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">.</SPAN>manage_data <SPAN class="keyword token">import</SPAN> extract_data
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmydevplan.maps.arcgis.com%2F" target="_blank">https://mydevplan.maps.arcgis.com/</A><SPAN>"</SPAN></SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"un"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"pw"</SPAN><SPAN class="punctuation token">)</SPAN>
waze_hfs_item <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'5c80a03f09154b2bb845f986dce325cd'</SPAN><SPAN class="punctuation token">)</SPAN>
waze_alerts_layer <SPAN class="operator token">=</SPAN> waze_hfs_item<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="comment token"># REST Endpoint for layer returned</SPAN>
<SPAN class="comment token"># outputGDB = arcgis.extract_data(['Alerts']) # Exception: Job failed.</SPAN>
<SPAN class="comment token"># outputGDB = arcgis.extract_data(waze_hfs_item) # Exception: Job failed.</SPAN>
outputGDB <SPAN class="operator token">=</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>extract_data<SPAN class="punctuation token">(</SPAN>waze_alerts_layer<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># TypeError: 'FeatureLayer' object is not iterable</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I believe all I really need to supply to extract_data is :
input_layers :Required list of strings
Was wondering if someone could point me to a working sample that leverages extract_data. I am sure this is a simple one.