AnsweredAssumed Answered

Arcpy - GenerateServiceAreas_na throw error when using some parameters

Question asked by DemersM on Mar 9, 2018
Latest reply on Mar 12, 2018 by dmandloi-esristaff

Hi,

 

I encounter a non-explicit error when using arcpy.GenerateServiceAreas with those parameters:

 

  • Maximum_Facilities
  • Maximum_Number_of_Breaks

 

This is how I can reproduce the error:

 

import arcpy, os

arcpy.env.overwriteOutput = True

featureSet = {
    "geometryType": "esriGeometryPoint",
    "spatialReference": {
        "wkid": 3857,
    },
    "fields": [
        {
            "name": "Name",
            "alias": "Name",
            "type": "esriFieldTypeString"
        },
    ],
    "features" : [
        {
            "geometry" : {
                "x" : -7929427,
                "y" :  5910701
            },
            "attributes" : {
                "Name": "Foo"
            }
        }
    ]
}

facilities = arcpy.AsShape(feature_set, True)

Network_Dataset_Path = os.path.join(r"\\vnageop1", "geod", "Geobase", "Network Analyst", "Reseau routier - AQ.gdb", "NetworkAnalystAQ", "NetworkAnalystAQ_ND")

arcpy.GenerateServiceAreas_na(facilities, "10", "Meters", Network_Dataset_Path, "in_memory/ServiceAreasOutput", Maximum_Facilities=10, Maximum_Number_of_Breaks=5)

 

The error is the following:

 

Traceback (most recent call last):
  File "G:\testNA.py", line 34, in <module>
    arcpy.GenerateServiceAreas_na(facilities, "10", "Meters", NA_Path, "in_memory/ServiceAreasOutput", Maximum_Facilities=10)
  File "c:\app\arcgis\desktop10.3\arcpy\arcpy\na.py", line 3878, in GenerateServiceAreas
    raise e
ExecuteError: A python error occurred.
Failed to execute (GenerateServiceAreas).

 

If I remove the Maximum_Facilities and Maximum_Number_of_Breaks parameters, I have a correct output.

 

What could be the problem?

Outcomes