FRAMES | NO FRAMES

 

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

Map Report Endpoint

Creates a report which includes map image(s) accompanied with custom user data and graphics.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MapReport/execute

Specific Parameters

Parameter

Description

Maps (required)

This array specifies maps to be shown in the map report. Type array of Map. The first map in this array is the main map. It is required. Some map reports show more than one map. In this case, the additional maps could be specified within this array.

MapLegend

A complex object specifying properties of the map legend to be used in the output report. Properties that can be specified are the legend Title string and the LegendItems array containing Color/Label pairs.

Data

Data properties for "Site Details Map" report. Type array of KeyValue pairs. The following keys are available for this report: "City", "State", "ZIP", "County", "CBSA", "Tract", and "BlockGroup".

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this method include creating a report (GetReport). Type array of TaskOutputType.

StandardReportOptions (required)

Report parameters. Type ReportOptions. The TemplateName parameter specifies a map report template. The ReportHeader parameter allows subtitle, locationname, address, areadesc2, latitude, longitude, and logo or binarylogo options. Along with header options, you can set the ReportFooter parameter which is also an array of KeyValue. It allows ProductLabel, ProductUrl, PhoneNumber, TrialUrl, and TrialUrlText options. See examples below.
The report footer options described above are unique to the Map Report task.

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.

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.

token

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

Returns

Variable of type TaskResultOutput

Remarks

The Map Report allows Business Analyst Server users to create reports that allow for map images to be returned in the resulting report. The map image is based on a map area and an array of map description objects. Every map description includes a map service URL and a collection of custom graphic elements drawn over the map. Images produced with map descriptions will be combined into the map image using the Opacity value set for every map description object.

 

This endpoint allows creating a report using one of available map report templates. Some map report templates allow more than one map to be shown in the report. In this case, you could specify additional maps after the main map within the Maps array. The main map is required. Additional maps are optional.

 

The map report template is selected with the TemplateName parameter of the report options. There are five map report templates that are available now:

 

Template Name

Description

Map Report

This report template supports a main map and a map legend.

Map Report Landscape

This report template supports a main map and a map legend. It is formatted to use a landscape layout.

Map Report Extended

This report template supports a portrait report with a main map, one additional inset map, and a map legend. The additional map is shown in smaller size. If the additional map isn't set in the Maps array, it will be the same as the main map.

Site Map Report

This report template supports a portrait report with a main map and two inset maps. The map legend isn't supported with this template. The additional inset maps are shown in smaller size. If the first additional map isn't set in the Maps array, the main map with the extent of 1.25 size of the original extent is shown in place of it. If the second additional map isn't set in the Maps array, the main map with the extent of 0.75 size of the original extent is shown in place of it.

Site Details Map

This report template supports a portrait report with a main map and an additional information about the area mapped. The map legend isn't supported with this template. The additional information is specified with the Data parameter as an array of key/value pairs. This will help to fill in the values under the map image with the information provided in your request. The following keys are available for this report: "City", "State", "ZIP", "County", "CBSA", "Tract", and "BlockGroup".

 

Each map report template contains information on how many map images should be generated. The report template also defines image parameters such as width, height and resolution. The "Map Report", "Map Report Landscape", and "Site Detailed Map" templates contain descriptions for one map therefore these templates produce reports with one main image. The "Map Report Extended" and "Site Map Report" templates describe two and three maps, respectively.

 

It is not possible to generate a report with fewer images than what is defined in the corresponding report template. If the request is sent to Business Analyst Server containing parameters for one (main) map, other maps (if described in the report template) will be created using parameters set for the main map. The map area for additional maps will have the same center point as the main map and extent with size scaled from main map’s extent. This behavior is described above, specifically for the "Map Report Extended" and "Site Map Report" templates.

 

Every map consists of the MapArea and MapDescriptions properties. The first one specifies an extent for the map and the last one is an array of MapDescription items.

 

Every MapDescription consists of MapURL, spatialReference, CustomGraphics, and Opacity properties:

 

Example Usage

Example 1 - The example below generates a Map Report Landscape with a polygon and a legend. Also, the report is saved to the repository.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MapReport/execute?
Maps=[{
  "MapArea":{
    "xmin":-122.5,
    "ymin":37.67,
    "xmax":-122.38,
    "ymax":37.83,
    "spatialReference":{"wkid":4269}
  },
  "MapDescriptions":[{
    "mapUrl":"http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer",
    "spatialReference":{"wkid":4326},
    "CustomGraphics":[{
      "Type":"PolygonElement",
      "fillSymbol":{
        "color":"%23C73724",
        "alpha":50,
        "style":"esriSFSSolid",
        "outline":{"color":"%23C73724","alpha":200,"style":"esriSLSSolid","width":2}
      },
      "polygon":{
        "rings":[[
          [-122.45,37.8],
          [-122.41,37.8],
          [-122.41,37.7],
          [-122.45,37.7],
          [-122.45,37.8]
        ]],
        "spatialReference":{"wkid":4326}
      }
    }]
  }]
}]&
MapLegend={
  "Title":"Adults: Watch TV aired once/wk: American Idol by States", 
  "LegendItems":[
    {"Color":"%23FFFFB2","Label":"829,641 - 3,093,338"},
    {"Color":"%23FECC5C","Label":"491,877 - 829,640"},
    {"Color":"%23FD8D3C","Label":"256,916 - 491,876"},
    {"Color":"%23F03B20","Label":"120,569 - 256,915"},
    {"Color":"%23BD0026","Label":"46,454  - 120,568"}
  ]
}&
StandardReportOptions={
  "TemplateName":"Map Report Landscape",
  "ReportFormat":"PDF",
  "ReportHeader":[
    {"key":"subtitle","value":"Map Report custom subtitle"},
    {"key":"locationname","value":"locationname"},
    {"key":"address","value":"address"},
    {"key":"latitude","value":"latitude"},
    {"key":"longitude","value":"longitude"},
    {"key":"areadesc2","value":"areadesc2"}
  ], 
  "ReportFooter":[
    {"key":"ProductLabel","value":"Test Label"},
    {"key":"ProductUrl","value":"www.test.com/test"},
    {"key":"PhoneNumber","value":"000-000-0000"},
    {"key":"TrialUrlText","value":"Test: Try it Now!"},
    {"key":"TrialUrl","value":"http://www.test.com/test"}
  ]
}&
OutputType=GetReport&
OutputReportItem={
  "workspaceName":"Default Workspace",
  "projectName":"Default Project",
  "folderType":"esriFolderReports",
  "itemName":"MapReport"
}&f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"Map Report Landscape.PDF",
      "dataType":"GPDataFile",
      "value":
      {
        "url":"http://localhost/arcgisoutput/_ags_T45E8DC78E4FBBA20BE1CDAC01B320.pdf"
      }
    }
  ],
  "messages":
  [
  ]
}

 

The results of the above request are shown below:

 

 

Example 2 - The example below generates a Map Report using the Site Details Map template.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MapReport/execute?
Maps=[{
  "MapArea":{
    "xmin":-122.5,
    "ymin":37.67,
    "xmax":-122.38,
    "ymax":37.83,
    "spatialReference":{"wkid":4269}
    },
  "MapDescriptions":[{
    "mapUrl":"http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer",
    "spatialReference":{"wkid":4326},
    "CustomGraphics":[{
      "Type":"PolygonElement",
      "fillSymbol":{
        "color":"%23C73724",
        "alpha":50,
        "style":"esriSFSSolid",
        "outline":{"color":"%23C73724","alpha":200,"style":"esriSLSSolid","width":2}
      },
      "polygon":{
        "rings":[[
          [-122.45,37.8],
          [-122.41,37.8],
          [-122.41,37.7],
          [-122.45,37.7],
          [-122.45,37.8]
        ]],
        "spatialReference":{"wkid":4326}
      }
    }]
  }]
}]&
Data=[
  {"key":"City","value":"San Francisco"},
  {"key":"State","value":"California"},
  {"key":"ZIP","value":"94114"},
  {"key":"County","value":"San Francisco County"},
  {"key":"CBSA","value":"Riverside-San Bernardino-Ontario, CA Metropolitan Statistical Area"},
  {"key":"Tract","value":"060730083.15"},
  {"key":"BlockGroup","value":"060730083.151"}
]&
StandardReportOptions={
  "TemplateName":"Site Details Map",
  "ReportFormat":"PDF",
  "ReportHeader":[
    {"key":"subtitle","value":"Map Report custom subtitle"},
    {"key":"locationname","value":"locationname"},
    {"key":"address","value":"address"},
    {"key":"latitude","value":"latitude"},
    {"key":"longitude","value":"longitude"},
    {"key":"areadesc2","value":"areadesc2"}
  ], 
  "ReportFooter":[
    {"key":"ProductLabel","value":"Test Label"},
    {"key":"ProductUrl","value":"www.test.com/test"},
    {"key":"PhoneNumber","value":"000-000-0000"},
    {"key":"TrialUrlText","value":"Test: Try it Now!"},
    {"key":"TrialUrl","value":"http://www.test.com/test"}
  ]
}&
OutputType=GetReport&f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"Site Details Map.PDF",
      "dataType":"GPDataFile",
      "value":
      {
        "url":"http://localhost/arcgisoutput/_ags_T8D3FC72294F43AF0AC7FC63CD1EAD.pdf"
      }
    }
  ],
  "messages":
  [
  ]
}

 

Example 3 - The example below generates a Map Report using the Site Map Report template and specifies properties of a main map and two inset maps.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MapReport/execute?
Maps=[
  {
    "MapArea":{
      "xmin":-85.86,"ymin":38.1,"xmax":-85.5,"ymax":38.3,
      "spatialReference":{"wkid":4326}
    },
    "MapDescriptions":[{
      "mapUrl":"http://services.arcgisonline.com/ArcGIS/services/World_Imagery/MapServer",
      "spatialReference":{"wkid":4326},
      "CustomGraphics":[{
        "Type":"PolygonElement",
        "fillSymbol":{
          "color":"%23C73724",
          "alpha":50,
          "style":"esriSFSSolid",
          "outline":{"color":"%232424C7","alpha":200,"style":"esriSLSSolid","width":2}
        },
        "polygon":{
          "rings":[[[-85.7,38.2],[-85.6,38.2],[-85.6,38.15],[-85.7,38.15],[-85.7,38.2]]],
          "spatialReference":{"wkid":4326}
        }
      }]
    }]
  },
  {
    "MapArea":{
      "xmin":-85.86,"ymin":38.1,"xmax":-85.5,"ymax":38.3,
      "spatialReference":{"wkid":4326}
    },
    "MapDescriptions":[{
      "mapUrl":"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer",
      "spatialReference":{"wkid":4326},
      "CustomGraphics":[{
        "Type":"PolygonElement",
        "fillSymbol":{
          "color":"%23C73724",
          "alpha":50,
          "style":"esriSFSSolid",
          "outline":{"color":"%23C73724","alpha":200,"style":"esriSLSSolid","width":2}
        },
        "polygon":{
          "rings":[[[-85.7,38.2],[-85.6,38.2],[-85.6,38.15],[-85.7,38.15],[-85.7,38.2]]],
          "spatialReference":{"wkid":4326}
        }
      }]
    }]
  },
  {
    "MapArea":{
      "xmin":-85.86,"ymin":38.1,"xmax":-85.5,"ymax":38.3,
      "spatialReference":{"wkid":4326}
    },
    "MapDescriptions":[{
      "mapUrl":"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer",
      "spatialReference":{"wkid":4326},
      "CustomGraphics":[{
        "Type":"PolygonElement",
        "fillSymbol":{
          "color":"%23C73724",
          "alpha":50,
          "style":"esriSFSSolid",
          "outline":{"color":"%23C73724","alpha":200,"style":"esriSLSSolid","width":2}
        },
        "polygon":{
          "rings":[[[-85.7,38.2],[-85.6,38.2],[-85.6,38.15],[-85.7,38.15],[-85.7,38.2]]],
          "spatialReference":{"wkid":4326}
        }
      }]
    }]
  }
]&
OutputType=GetReport&
StandardReportOptions={
  "TemplateName":"Site Map Report",
  "ReportFormat":"PDF",
  "ReportHeader":[{"key":"subtitle","value":"Report title"}],
  "ReportFooter":[
    {"key":"ProductLabel","value":"Test Label"},
    {"key":"ProductUrl","value":"www.test.com/test"},
    {"key":"PhoneNumber","value":"000-000-0000"},
    {"key":"TrialUrlText","value":"Test: Try it Now!"},
    {"key":"TrialUrl","value":"http://www.test.com/test"}
  ]
}&
f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"Site Map Report.PDF",
      "dataType":"GPDataFile",
      "value":
      {
        "url":"http://localhost/arcgisoutput/_ags_T7841FBDD44AC39C9B61D36DA3F24B.pdf"
      }
    }
  ],
  "messages":
  [
  ]
}

 

The results of the above request are shown below:

 

 

See Also

Business Analyst Server REST Reference