Downloading Feature Layer Attachments via the ArcGIS webservices JSON and dotNet

634
0
10-04-2017 08:22 PM

Downloading Feature Layer Attachments via the ArcGIS webservices JSON and dotNet

Hi everyone

 

I use this .Net code to extract the photos and attributes of a collector dataset with location tracking on. The attributes of the feature dataset and photos can be download to your box. The web services of the features should be shared.

To use this, one will need to change the Url and hardcoded attributes.

The video is here Dropbox - AGOLdownloadData.mp4 

 

One will have to configure the Url correctly. Below are assumed values

Srl#

Caption

Details

1

Assumed Url for feature service

http://somesampleserver.com/FeatureservicePath/ArcGIS/rest/services/LabOfflineGdbT3/FeatureServer/0/

 

query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&
distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&
outSR=&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&
resultOffset=&resultRecordCount=&returnZ=false&returnM=false&quantizationParameters=&sqlFormat=none&f=pjson&token=

2

Assumed Url for download attachment

http://somesampleserver.com/FeatureservicePath/ArcGIS/rest/services/LabOfflineGdbT3/FeatureServer/0/

 

queryAttachments?objectIds={0}&f=pjson&token=

3

Assumed Url for location service url

http://somesampleserver.com/FeatureservicePath/ArcGIS/rest/services/LabOfflineGdbT3/FeatureServer/0/

 

query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&
distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=&returnGeometry=true&multipatchOption=xyFootprint&maxAllowableOffset=&
geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&
groupByFieldsForStatistics=&outStatistics=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&quantizationParameters=&
sqlFormat=none&f=pjson&token=

 

 

 

How to use the executable

  1. Fill the main tab

Screenshot index

Value

Description

(1)

Enter your feature service url

http://somesampleserver.com/FeatureservicePath/ArcGIS/rest/services/LabOfflineGdbT3/FeatureServer/0/

JSON location

(2)

Hardcoded but need to change if esri changes it

search url for the webservice

(3)

Hardcoded but need to change if esri changes it

download JSON url 

 

  1. Fill the locations tab

Screenshot index

Value

Description

(1)

http://somesampleserver.com/FeatureservicePath/ArcGIS/rest/services/LabOfflineGdbT3/FeatureServer/0/

 

query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope
&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&
returnGeodetic=false&outFields=&returnGeometry=true&multipatchOption=xyFootprint&
maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&
returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&
outStatistics=&resultOffset=&resultRecordCount=&
returnZ=false&returnM=false&quantizationParameters=&sqlFormat=none&f=pjson&token=

if your collector dataset has location analytics on.

Combination of 

a. Json web service

b. Search all attribute of webserice which can be hardcoded

 

  1. Processing (Check video of processing)
  2. Click the “extract” button.
  3. Wait for the values to get populated
  4. Check the “logs” tab to check success of processing.
  5. Click the download button, select a folder. A CSV and folder for photos are created.
  6. Next to do
  7. Automatically iterate the attributes of dataset
  8. Validate the webservice urls entered
Attachments
Version history
Last update:
‎10-04-2017 08:22 PM
Updated by:
Contributors