AnsweredAssumed Answered

Error when trying to generate offline areas

Question asked by parks_camp on Feb 12, 2020
Latest reply on Feb 28, 2020 by ldelarch_virginiatech

I'm attempting to automate the creation of a set of offline areas from a AGOL web map. I've created a couple of areas for this web map manually through AGOL with no problem. However, when attempting this with the Python API, I'm getting errors. My web map is very simple and only contains a vector basemap.

 

Any ideas on the source of this error?

 

In the example below, I use a bookmark for the area, but the same error occurs if I use an extent.

 

Using this command:

offlineItem = oWebMap.offline_areas.create(area='TAE', item_properties=oLine_properties)

 

where:

The bookmark itself:
{       "extent": {         "spatialReference": {           "wkid": 102100         },         "xmax": -9311960.288686637,         "xmin": -9457037.768371958,         "ymax": 3644687.9398760623,         "ymin": 3470105.7672726526       },       "name": "TAE"
}

oLine_properties = {'title': 'TAE1',
'tags': ['DAT'],
'snippet': 'Offline Map for TAE CWA'}

The error:

 

{"code": 24, "messageCode": "OffPkg_ 24", "message": "Parameter extent is invalid or exceeded limit.", "params": {"name": "extent"}} Failed to execute (CreateMapArea). Failed.
Submitted. Executing... Start Time: Thursday, February 13, 2020 2:06:55 AM Running script CreateMapArea... {"code": 24, "messageCode": "OffPkg_ 24", "message": "Parameter extent is invalid or exceeded limit.", "params": {"name": "extent"}} Completed script CreateMapArea... Failed to execute (CreateMapArea). Failed at Thursday, February 13, 2020 2:06:55 AM (Elapsed Time: 0.15 seconds) Failed.
---------------------------------------------------------------------------Exception                                 Traceback (most recent call last)<ipython-input-55-699c796e29ec> in <module>----> 1 offlineItem = oWebMap.offline_areas.create(area='TAE', item_properties=oLine_properties)~/opt/anaconda3/lib/python3.7/site-packages/arcgis/mapping/_types.py in create(self, area, item_properties, folder, min_scale, max_scale, layers_to_ignore, refresh_schedule, refresh_rates)   1269         from arcgis.geoprocessing._tool import Toolbox   1270         pkg_tb = Toolbox(url=self._url, gis=self._gis)-> 1271         oma_result = pkg_tb.create_map_area(self._item.id, _bookmark, _extent, output_name=output_name)   1272         # endregion   1273  ~/opt/anaconda3/lib/python3.7/site-packages/arcgis/geoprocessing/_tool.py in create_map_area(self, map_item_id, bookmark, extent, area_type, area, output_name)    101         #    print(k + " => " + str(v))    102 --> 103         return self._execute(kwargs)    104     105     code = call.__code__ ~/opt/anaconda3/lib/python3.7/site-packages/arcgis/geoprocessing/_tool.py in _execute(self, params)   1004             try:   1005                 isCan = False-> 1006                 job_info = super()._analysis_job_status(task_url, job_info)   1007             except KeyboardInterrupt:   1008                 cancel_url = "%s/jobs/%s/cancel" % (task_url, job_info['jobId'])~/opt/anaconda3/lib/python3.7/site-packages/arcgis/geoprocessing/_tool.py in _analysis_job_status(self, task_url, job_info)    505     506                     if job_response.get("jobStatus") == "esriJobFailed":--> 507                         raise Exception("Job failed.")    508                     elif job_response.get("jobStatus") == "esriJobCancelled":    509                         raise Exception("Job cancelled.")Exception: Job failed.

Outcomes