Exercise ArcGISOnlineConnetor
Overall Goal To use ArcGISOnlineConnector to publish a Web Service
Demonstrates Uploading data to ArcGIS Online and Publishing that data controlled via FME.
Completed Workspace C:\FMEData2020\Workspaces\IMGS_ArcGIS\ArcGISOnlineConnector_Complete.fmw

This exercise will look at how the ArcGISOnlineConnector transformer can be used to both upload data to AGOL but also to publish a web service. The transformer allows a number of interactions with AGOL that can be controlled using FME based workflows.


1) Create a New Blank Workspace

Open FME Desktop and select New to create a new blank canvas.

New Workspace

2) Read in the Data

Add an Esri ArcGIS Server Feature Service Reader, setting the Coord System to EPSG:2157 and the Dataset to the following URL.

https://services-eu1.arcgis.com/FH5XCsx8rYXqnjF5/arcgis/rest/services/Administrative_Areas___OSi_National_Statutory_Boundaries___Generalised_20m/FeatureServer/

as shown below.

Once the Feature Type is added to the canvas as below

open the Feature Type parameters and add the following WHERE Clause which will filter the returned polygons to just the Fingal area.

"ENGLISH" = 'FINGAL COUNTY COUNCIL'

Go to the User Attributes tab and select just the ENGLISH attribute.

3) Reproject the Data

The data for the Administrative boundaries is in Irish Transverse Mercator however the data we want to read from the Planning Department is in Web Mercator. In order to get data back for our area we need to reproject the dataset.

To do this add a ProjReprojector transformer as below,

then configure as shown here.

4) Read in the Planning Data

We can pass the Fingal boundary into a FeatureReader transformer to use as a spatial filter when querying data.

Add a Feature Reader and select the ESRI ArcGIS Server Feature Service reader again. Then configure the Dataset to the following URL.

https://services.arcgis.com/NzlPQPKn5QF9v2US/arcgis/rest/services/IrishPlanningApplications/FeatureServer/

Set the Feature Type to Read too "Planning Application Sites (2010 onwards)" and in the WHERE Clause add the following "ReceivedDate" > '20180101'. Lastly set the Spatial Filter to Initiator Intersects Result as shown below.

Once configured run the transformer and using the visual preview confirm only those features in Fingal that where received after the 1st January 2018 are being returned.

5) Write the Data Locally for Publishing

Add a FeatureWriter connected to the Planning feature type created by the FeatureReader as shown below.

Set the Format to ESRI GeoDatabase (File), the Open API version of the writer is sufficient in this case or the full version can be used if available/required.

Configure as shown below, the output is only temporary so it can be written toC:\FMEData20200\Ouput\Training but ensure that from the drop down that Zip Output is checked.

A Geodatabase is a folder based format rather than a single file so will not be uploaded without being zipped.

Configure the Feature Class name, Geometry type and Coord System as below.

Run the Workspace and ensure the zipped Geodatabase is written out.

6) Create Upload Layer Name and Tags

In order to publish the data we need to provide a Layer Name and Tags for the data to do this we can add two attributes with appropriate values to the FeatureWriter.

Right click on the FeatureWriter Summary Feature type and from the context menu select Add Attribute.

Create the following two attributes

| Attribute Name | Attribute Value | | ----- | ----- | ---- | | LayerName | National Planning Data | | Tags | FME2020, Ireland, Planning |

7) Upload to ArcGIS Online

Note: ArcGIS Online will not allow duplicate files to be created or overwrite existing data. If you need to upload the file more than once you will need to go onto ArcGIS Online and delete the file present there. In a production scenario you can use the ArcGIS Online Connector to do this step for you, but you would need to use its list mode initially to find the ID to delete.

Add an ArcGISOnlineConnector transformer and connect it to the Summary port of the FeatureWriter as below.

Configure the transformer as below, to set the Action to Upload, the Upload to File and the File to Upload to the zipped GeoDatabase created by the FeatureWriter. Then set the Metadata Title to the LayerName attribute, the Item Type to File Geodatabase and the Tags parameter to the Tags Attribute as shown below.

The file path is hardcoded, but those of you familiar with the FileWriter may wonder why the _dataset attribute is not used. The challenge is that because we zipped its value points to the Geodatabase within the zip file not the zip file itself which confuses the uploader.

8) Publish the Uploaded Layer

Add a second ArcGISOnlineConnector transformer and connect it to the Output port of the first.

Configure the transformer as below, setting the Action to Publish, the Feature Layer Title and Tags to the appropriate attributes. Lastly set the Coordinate System to EPSG:2157.

The Content Source is set to the ID attribute which comes from the first ArcGISOnlineConnector transformer. This is the ID AGOL assigned the uploaded GeoDatabase.

9) Upload and Publish the Layer

Click on the Transformer and select run to this from the pop up menu, this will run both of the ArcGISOnlineConnector transformers (if you've not already run the Upload transformer) and upload then publish the dataset.

10) View the Data on ArcGIS Online

Go to ArcGIS Online and verify that the data has uploaded and is available to view.

Contents View:

Map View:


Advanced Task

The Workflow above requires the file location to be hard coded and has no ability to delete the data if it exists. Using your FME skills can create a suitable file name and checks to delete an existing copy of the data as required.


CONGRATULATIONS

The tasks above demonstrate how you can use the ArcGISOnlineConnector to upload support formats and carry out different operations using the transformer.