FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.0   R E S T   A P I    R E P O R T    T A S K

Market Ranking Endpoint

Generates a report to rank data based on a selected variable.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/MarketRanking/execute

Specific Parameters

Parameter

Description

NameField (required)

The attribute field in the RankingData layer which specifies a name of every feature. Type string.

PrimaryRankField (required)

The attribute field in the RankingData layer which specifies a field to rank features. Type string.

RankingData (required)

A point or polygon layer containing features to be ranked. Type PointLayer.

AdditionalFields (optional)

Array of additional fields of the RankingData layer to be shown in the output report and to be exported to the output feature class. The additional fields must have a numerical type because they are used in calculation the summary rank.

AnalysisExtent (optional)

Data extent to restrict the analysis. Type ExtentData.

FeaturesLimit (optional)

The maximum number of ranked features to be shown in the output report and to be exported to the output feature layer. Type int.

Default: 1000.

IncludeSummaryField (optional)

An option that shows summary rank values in the report. Type boolean.

Default: false.

PercentField (optional)

The attribute field in the RankingData layer which specifies a field to be used for calculation the percentage of the PrimaryRankField field with respect to this field. Type string.

RankPercentages (optional)

An option that shows percentage of the PrimaryRankField field with respect to PercentField field in the output report. Type boolean.

Default: false.

UseAllFeatures (optional)

An option specifying the use of all features of the RankingData layer in the analysis. Type boolean.

Default: false.

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this endpoint include rendering an output image (GetMapImage), creating a feature layer for subsequent analysis (GetFeatureClass), and creating a report (GetReport). Type array of TaskOutputType.

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

f (optional)

Response format. Type string. Available formats: HTML, JSON, PJSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

OutputAnalysisItem (optional)

Configuration options for storing the output feature layer in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputReportItem (optional)

Configuration options for storing the output report in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputSpatialReference (optional)

An option specifying the spatial reference to return the output feature layer in. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference. Available with Business Analyst Server 10.0 SP1.

RenderingParameters (optional)

Configuration options for rendering output when GetMapImage option is specified in the OutputType parameter. Type RenderingParameters.

ReturnGeometry (optional)

An option specifying the presence of the shape attribute in the returned record set. Type boolean. Available with Business Analyst Server 10.0 SP1.

Default: true.

StandardReportOptions (optional)

Report parameters. Type ReportOptions. The TemplateName parameter is ignored. Available with Business Analyst Server 9.3.1.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type TaskResultOutput

Remarks

The analysis can be restricted to an analysis extent if the AnalysisExtent parameter is specified. The optional UseAllFeatures parameter expands the analysis on all features of the RankingData layer including those out of the analysis extent.

 

Features of the RankingData layer are ranked by the primary ranking field specified with the PrimaryRankField parameter. If the RankPercentages parameter is true, the PercentField parameter should specify a field to calculate the percentage of the primary ranking field. Features having top FeatureLimit values of the primary ranking field are shown in the report and are exported to the output feature layer.

Usage Tips

• Use this report to determine how well a market will rank based on one or more attributes.

• You can rank either point data or polygon data.

• The report will rank a given set of features based on a primary rank field.

• You can use the AdditionalFields option to create a ranking report with two or more attributes.

• Set the UseAllFeatures option to the true value if you want to rank all features in the input layer.

• If you want to rank your market and display only the top N number of features, set this value for the FeaturesLimit option.

Example Usage

The example below generates a Market Ranking report from a standard geography layer.

 

Request

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/MarketRanking/execute?
RankingData={"StdLayer":{
  "ID":"US.ZIP5",
  "Query":"ID IN ('19703', '19706', '19707', '19708', '19709', '19710', '19711', '19712', '19714')"
}}&
NameField=NAME&
PrimaryRankField=TOTHH_CY&
ActiveDatasetID=USA_ESRI&
AdditionalFields=MEDHINC_CY;MEDDI_CY;MEDNW_CY&
IncludeSummaryField=false&
StandardReportOptions={
  "ReportFormat":"PDF",
  "ReportHeader":[{"key":"subtitle","value":"Custom Report Title"}]
}&
OutputType=GetFeatureClass;GetReport&
f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPolygon",
        "spatialReference":
        {
          "wkid":4326
        },
        "features":
        [
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -75.788382,
                    39.648226
                  ],
                  ...
                  [
                    -75.788382,
                    39.648226
                  ]
                ],
                ...
                [
                  [
                    -75.750547,
                    39.67434
                  ],
                  ...
                  [
                    -75.750547,
                    39.67434
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":1,
              "NAME":"Newark",
              "TOTHH_CY":19381,
              "MEDHINC_CY":79211,
              "MEDDI_CY":58694,
              "MEDNW_CY":160210
            }
          },
          ...
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -75.5973,
                    39.555732
                  ],
                  ...
                  [
                    -75.5973,
                    39.555732
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":5,
              "NAME":"Delaware City",
              "TOTHH_CY":582,
              "MEDHINC_CY":56298,
              "MEDDI_CY":43999,
              "MEDNW_CY":106521
            }
          }
        ]
      }
    },
    {
      "paramName":"Market Ranking.PDF",
      "dataType":"GPDataFile",
      "value":
      {
        "url":"http://localhost/arcgisoutput/_ags_TBE1B045644F27BB14E72C83D7664B.pdf"
      }
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.


JSON Response Example Rendered with the ArcGIS API for JavaScript

Example Usage Rendering

See Also

Business Analyst Server REST API Reference