Im trying to export polygons using .export(output_type=arcpy.nax.ServiceAreaOutputType.Polygons, output_features=<path>) after solving arcpy.nax.ServiceArea(). However the resulting featureclass shows up as points. Can somebody see what I'm getting wrong? The code is shown below.
xy_lists is a dictionary holding a list of facilities for each name
sa_obj = arcpy.nax.ServiceArea(in_network=sa_nd_layer)
sa_obj.travelMode = <string>
sa_obj.defaultImpedanceCutoffs= [5]
sa_obj.outputType = arcpy.nax.ServiceAreaOutputType.Polygons
sa_obj.geometryAtOverlap = arcpy.nax.ServiceAreaOverlapGeometry.Overlap
sa_fields= ['Name', 'SHAPE@XY']
with sa_obj.insertCursor(arcpy.nax.ServiceAreaInputDataType.Facilities,sa_fields) as insert_cursor:
for name, coord_pairs in xy_lists.items():
for coord_pair in coord_pairs:
insert_cursor.insertRow([name,coord_pair])
result = sa_obj.solve()
if not result.solveSucceeded:
print("Solved failed")
print(result.solverMessages(arcpy.nax.MessageSeverity.All))
else:
result.export(output_type=arcpy.nax.ServiceAreaOutputType.Polygons, output_features=solved_sa)
print('SA exported')
del sa_obj