Using Your Own Data with GeoEnrichment

With recent updates to the GeoEnrichment service, you can use your own custom data along with sophisticated geographical retrieval methodologies for aggregating data into rings and other polygons. Feature layers with accompanying metadata from ArcGIS Online and ArcGIS Enterprise can be leveraged for apportioning numeric data and summarizing it for input study areas when enriching layers and creating reports.

There are a number of existing workflows which use custom data within the Business Analyst & Community Analyst applications, for more information link to this excellent blog from my colleague Anna: https://blogs.esri.com/esri/arcgis/2017/07/20/custom-data-setup/

However, this blog will focus on how to use the GeoEnrichment REST API directly with your own data.

Build Custom Data

To begin, we need to create metadata for any polygon layer with numeric data to specify how it will be used by the GeoEnrichment service when apportioning the data into study areas. This metadata is referred to as a statistical data collection and it describes how the data is gathered and summarized. Tools are available in the Business Analyst web and Desktop applications for authoring this metadata.

The custom data setup workflow in the BA applications is described here in detail:

http://doc.arcgis.com/en/business-analyst/web/custom-data-setup.htm

http://desktop.arcgis.com/en/arcmap/latest/extensions/business-analyst/custom-data-setup-tool.htm

The file resides in your portal content in a folder called Custom Data, if this folder does not exist it will be created automatically when you build your first data collection:

 

 

Use Custom Data

Now that you’ve created a data collection, the next step is to use it with the GeoEnrichment service for data enrichment and reports. Let’s take a look at how to build a custom report template with your variables and some example requests for the Enrich and Create Report methods. 

 

Reports:

To use your variables within reports, custom report templates can be built with authoring tools provided in the Business Analyst web & Desktop applications. For more details on building reports with custom variables from the My Data category, see this topic:

http://doc.arcgis.com/en/business-analyst/web/building-reports.htm

With a report template created, you can now pass the item ID to the GeoEnrichment service in the ‘report’ parameter using the Create Report method. For more details on this method, take a look at the REST API reference: https://developers.arcgis.com/rest/geoenrichment/api-reference/create-report.htm

Create Report Example Usage:

1. Request an accessible report template from ArcGIS Online:

Report={“itemid”: portalItemId}

https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment/Createreport?studyareas=[{"geometry":{"x": -122.435, "y": 37.785}}]&report={“itemid”: PortalitemID}&format=PDF&f=bin&token=

2. Request a report template with the portal url and token. This is optional and can be done in the case of a non ArcGIS Online portal or inaccessible item:

Report={“itemid”: “portalItemId”,”url”: portal_url,”token”: portal_token}

https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoEnrichmentServer/Geoenrichment/Createreport?studyareas=[{"geometry":{"x": -122.435, "y": 37.785}}]&report={“itemid”:”PortalitemID”,”url”:”www.arcgis.com”,”token”:”YourToken”}&format=PDF&f=bin&token=

Enrich:

To use your own data with the enrich method, you can pass the Item ID of the statistical data collection using the dataCollections parameter to return all variables or to the analysisVariables parameter to request a subset of fields. For more details on this method, take a look at the API reference:

https://developers.arcgis.com/rest/geoenrichment/api-reference/input-xy-locations.htm

Enrich Example Usage:

1. Request all variables from an accessible data collection from ArcGIS Online using the ‘report’ parameter

Datacollections=[{"itemid": PortalitemId}]

https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment/Enrich?studyareas=[{"geometry":{"x": -122.435, "y": 37.785}}]&datacollections=[{"itemid": PortalitemID}]&f=pjson&token=

2. Request all variables from a data collection with the portal url and token. This is optional and can be done in the case of a non ArcGIS Online portal or inaccessible item:

Datacollections=[{"itemid": portalItemId,"url": portal_url,"token": portal_token,}]

https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment/Enrich?studyareas=[{"geometry":{"x": -122.435, "y": 37.785}}]&datacollections=[{"itemid": "PortalitemID","url":"www.arcgis.com","token":"YourToken"}]&f=pjson&token=

3. Request a subset of the data collection’s variables using the ‘analysisVariables’ parameter:

Analysisvariables=[{"itemid": portalItemId,"outfields":["Field1","Field2"], “portalURL”: portal_url,”token”: portal_token}]

https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment/Enrich?studyareas=&analysisvariables=[{"itemid":"YourItemID","url":"www.arcgis.com","outFields":["Field1","Field2"],”token”:”YourToken”}]&f=pjson

This entry was posted in ArcGIS Enterprise, ArcGIS Online and tagged , , . Bookmark the permalink.

Leave a Reply