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:
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
featureSet <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"geometryType"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"esriGeometryPoint"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"spatialReference"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"wkid"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3857</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"fields"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"name"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"alias"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"type"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"esriFieldTypeString"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"features"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"geometry"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"x"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">7929427</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"y"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5910701</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"attributes"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Foo"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN>
facilities <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>AsShape<SPAN class="punctuation token">(</SPAN>feature_set<SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
Network_Dataset_Path <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"\\vnageop1"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"geod"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Geobase"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Network Analyst"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Reseau routier - AQ.gdb"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NetworkAnalystAQ"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NetworkAnalystAQ_ND"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>GenerateServiceAreas_na<SPAN class="punctuation token">(</SPAN>facilities<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"10"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Meters"</SPAN><SPAN class="punctuation token">,</SPAN> Network_Dataset_Path<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"in_memory/ServiceAreasOutput"</SPAN><SPAN class="punctuation token">,</SPAN> Maximum_Facilities<SPAN class="operator token">=</SPAN><SPAN class="number token">10</SPAN><SPAN class="punctuation token">,</SPAN> Maximum_Number_of_Breaks<SPAN class="operator token">=</SPAN><SPAN class="number token">5</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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?