<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111677#M8678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for sharing and I think I&amp;nbsp;figured out most of the conversion to the arcpy.nax module. I was wondering if you can point me to anything that can provide a list of fields for the fieldmapping associated with service area facilities?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My original code added locations as follows and note that I assigned "Breaks_Meters" to the variable cutoff:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.na.AddLocations(layer_object, facilities_layer_name, facilities, "Name CentreID #;CurbApproach # 0;Attr_Minutes # 0;Attr_Meters # 1;Breaks_Minutes # #;&lt;STRONG style="text-decoration: underline; "&gt;Breaks_Meters cutoff&lt;/STRONG&gt; 1", "5000 Meters", None, "RoadsNetwork SHAPE;NetworkDataSet_Junctions NONE", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "EXCLUDE", "RoadsNetwork #;NetworkDataSet_Junctions #")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When I tried to use a similar code below I get an error message:&amp;nbsp;File "&amp;lt;string&amp;gt;", line 12, in &amp;lt;module&amp;gt;&amp;nbsp;KeyError: 'Breaks_Meters'&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.nax.MakeNetworkDatasetLayer(nds, nd_service_area)&lt;BR /&gt;ServArea = arcpy.nax.ServiceArea(nd_service_area)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServArea.distanceUnits = arcpy.nax.DistanceUnits.Meters&lt;BR /&gt;ServArea.travelMode = travel_mode&lt;BR /&gt;ServArea.outputType = arcpy.nax.ServiceAreaOutputType.Polygons&lt;BR /&gt;ServArea.geometryAtOverlap = arcpy.nax.ServiceAreaOverlapGeometry.Overlap&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# MAP FIELDS FOR FACILITIES&lt;BR /&gt;fm_sa = ServArea.fieldMappings(arcpy.nax.ServiceAreaInputDataType.Facilities, True)&lt;BR /&gt;fm_sa["Name"].mappedFieldName = "CentreID"&lt;BR /&gt;fm_sa["Breaks_Meters"].mappedFieldName = "cutoff"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServArea.load(arcpy.nax.ServiceAreaInputDataType.Facilities, Scratch + r"\fac_p", fm_sa)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;result_sa = ServArea.solve()&lt;/P&gt;&lt;P&gt;result_sa.export(arcpy.nax.ServiceAreaOutputDataType.Polygons, gdb + "\FinalAnalysis\SrvArea_Final")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2019 20:57:38 GMT</pubDate>
    <dc:creator>AndrewClark2</dc:creator>
    <dc:date>2019-07-17T20:57:38Z</dc:date>
    <item>
      <title>How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111675#M8676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am building a toolbox&amp;nbsp;using Python 3 in ArcGIS Pro 2.4. It involves a series of network analysis processes, including closest facility and service area. I am&amp;nbsp;using&amp;nbsp;arcpy.na.MakeClosestFacilityAnalysisLayer and&amp;nbsp;arcpy.na.MakeServiceAreaAnalysisLayer. I am able to create them no problem, but I am having lots of trouble with manipulating them, including:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I cannot select the location where they are stored - they always get placed in the default GDB even though I am trying to put them "in_memory";&lt;/LI&gt;&lt;LI&gt;I cannot name them something meaningful - They always are named ServiceArea1, Service Area2; and&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I cannot delete the final layer using python (arcpy.Delete_management) once I am done with it - so every time I rerun the syntax it&amp;nbsp;adds a new file with the wrong name (e.g., ServiceArea2) and my tool crashes.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any suggestion on how to fix this and make it work correctly? I want to be able to create it in a&amp;nbsp;specified location, name it something that is meaningful and then delete the file when it is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Jul 2019 01:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111675#M8676</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-14T01:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111676#M8677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using ArcGIS Pro 2.4, there is a new arcpy network analysis module&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/what-is-network-analyst-module.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/what-is-network-analyst-module.htm"&gt;What is the Network Analyst module (arcpy.na)—Network Analyst module | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The differences between the *.na and *.nax module are briefly discussed here&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/choosing-between-the-two-modules-arcpy-nax-versus-arcpy-na-.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/choosing-between-the-two-modules-arcpy-nax-versus-arcpy-na-.htm"&gt;Choosing between the modules (arcpy.na and arcpy.nax)—Network Analyst module | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Migration differences, here&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/migratingfrom10xarcpynetworkanalyst.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/migratingfrom10xarcpynetworkanalyst.htm"&gt;Migrating arcpy.na to ArcGIS Pro—Network Analyst module | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course the one you aren't going to like&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" title="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm"&gt;Write geoprocessing output to memory—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can't remember if this was the same for pre-2.4&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 15.8px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; list-style-position: outside; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Memory-based workspaces do not support geodatabase elements such as feature datasets, subtypes, domains, representations, topologies, geometric networks, or network datasets.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So file geodatabases are a need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Jul 2019 02:51:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111676#M8677</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-07-14T02:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111677#M8678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for sharing and I think I&amp;nbsp;figured out most of the conversion to the arcpy.nax module. I was wondering if you can point me to anything that can provide a list of fields for the fieldmapping associated with service area facilities?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My original code added locations as follows and note that I assigned "Breaks_Meters" to the variable cutoff:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.na.AddLocations(layer_object, facilities_layer_name, facilities, "Name CentreID #;CurbApproach # 0;Attr_Minutes # 0;Attr_Meters # 1;Breaks_Minutes # #;&lt;STRONG style="text-decoration: underline; "&gt;Breaks_Meters cutoff&lt;/STRONG&gt; 1", "5000 Meters", None, "RoadsNetwork SHAPE;NetworkDataSet_Junctions NONE", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "EXCLUDE", "RoadsNetwork #;NetworkDataSet_Junctions #")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When I tried to use a similar code below I get an error message:&amp;nbsp;File "&amp;lt;string&amp;gt;", line 12, in &amp;lt;module&amp;gt;&amp;nbsp;KeyError: 'Breaks_Meters'&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.nax.MakeNetworkDatasetLayer(nds, nd_service_area)&lt;BR /&gt;ServArea = arcpy.nax.ServiceArea(nd_service_area)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServArea.distanceUnits = arcpy.nax.DistanceUnits.Meters&lt;BR /&gt;ServArea.travelMode = travel_mode&lt;BR /&gt;ServArea.outputType = arcpy.nax.ServiceAreaOutputType.Polygons&lt;BR /&gt;ServArea.geometryAtOverlap = arcpy.nax.ServiceAreaOverlapGeometry.Overlap&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# MAP FIELDS FOR FACILITIES&lt;BR /&gt;fm_sa = ServArea.fieldMappings(arcpy.nax.ServiceAreaInputDataType.Facilities, True)&lt;BR /&gt;fm_sa["Name"].mappedFieldName = "CentreID"&lt;BR /&gt;fm_sa["Breaks_Meters"].mappedFieldName = "cutoff"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServArea.load(arcpy.nax.ServiceAreaInputDataType.Facilities, Scratch + r"\fac_p", fm_sa)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;result_sa = ServArea.solve()&lt;/P&gt;&lt;P&gt;result_sa.export(arcpy.nax.ServiceAreaOutputDataType.Polygons, gdb + "\FinalAnalysis\SrvArea_Final")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 20:57:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111677#M8678</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-17T20:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111678#M8679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/space/2089"&gt;Network Analyst&lt;/A&gt;‌ shared to there to see if some of the experts can follow up&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 00:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111678#M8679</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-07-18T00:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111679#M8680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/space/2089"&gt;Network Analyst&lt;/A&gt;‌ &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ experts. Does anyone have any suggestions for me to accomplish this? I am using NAX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 06:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111679#M8680</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-19T06:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111680#M8681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew.&amp;nbsp; Glad you're putting nax to good use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Documentation for the Service Area input fields is here:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/servicearea-input-data-types.htm"&gt;https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/servicearea-input-data-types.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 15:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111680#M8681</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2019-07-19T15:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111681#M8682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to confirm. If I want to assign dynamic buffer sizes, I need to assign&lt;/P&gt;&lt;P&gt;the field name to breaks? Or do I need to cursor through each row of&lt;/P&gt;&lt;P&gt;facilities and place the actual value in the breaks field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just want to make sure I understand the process correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 17:04:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111681#M8682</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-19T17:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111682#M8683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use the load() method to load your input features into Facilities, use field mapping to assign your breaks field to the Breaks field in Facilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, if you are loading facilities using an insert cursor, you just need to set the desired values directly into the Breaks field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load() and insert cursor are just two ways of accomplishing the same thing - inserting facilities.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 19:05:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111682#M8683</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2019-07-19T19:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111683#M8684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This makes perfect sense to me &lt;A href="https://community.esri.com/migrated-users/32389"&gt;Melinda Morang&lt;/A&gt;‌. I am still getting an error for some reason.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'''python&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;import os, datetime&lt;BR /&gt;import numpy as np&lt;BR /&gt;import math&lt;/P&gt;&lt;P&gt;arcpy.CheckOutExtension("network")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;path = r"C:\afclark82\ChildCare_Final"&lt;BR /&gt;gdb = r"C:\afclark82\ChildCare_Final\ChildCare_Final.gdb"&lt;BR /&gt;nds = gdb + r"\Network\NetworkDataSet"&lt;BR /&gt;facilities = gdb + r"\Locations\ChildCareLocations"&lt;BR /&gt;incidents = gdb + r"\Locations\ChildHomeLocations"&lt;BR /&gt;nd_close_fac = "ShortRoute"&lt;BR /&gt;nd_service_area = "ServiceArea"&lt;BR /&gt;Scratch = r"C:\afclark82\ChildCare_Final\Scratch.gdb"&lt;BR /&gt;shortPath = Scratch + r"\ShortestPaths"&lt;BR /&gt;serviceAreas = Scratch + r"\ServiceAreas"&lt;BR /&gt;travel_mode = "Driving"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if arcpy.Exists(shortPath)==False:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CreateFeatureDataset_management(path+ r"\Scratch.gdb", "ShortestPaths")&lt;/P&gt;&lt;P&gt;if arcpy.Exists(Scratch + r"\ServiceAreas")==False:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CreateFeatureDataset_management(Scratch,"ServiceAreas")&lt;BR /&gt; &lt;BR /&gt;########################################&lt;BR /&gt;### CALCULATE SERVICE AREAS FOR MAPS ###&lt;BR /&gt;########################################&lt;BR /&gt;if len(arcpy.ListFields(facilities,"cutoff"))==0: &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddField_management(facilities, "cutoff", "TEXT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.CalculateField(facilities, "Per50", "np.around(!Per50!,2)", "PYTHON3", "import numpy as np")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.CalculateField(facilities, "Per62", "np.around(!Per62!,2)", "PYTHON3", "import numpy as np")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.CalculateField(facilities, "Per75", "np.around(!Per75!,2)", "PYTHON3", "import numpy as np")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.CalculateField(facilities, "cutoff", '"{} {} {}".format(!Per50!,!Per62!,!Per75!)', "PYTHON3", None)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print("Create a new service area")&lt;BR /&gt; &lt;BR /&gt;#############################&lt;BR /&gt;## INITIALIZE THE ANALYSIS ###&lt;BR /&gt;##############################&lt;/P&gt;&lt;P&gt;arcpy.nax.MakeNetworkDatasetLayer(nds, nd_service_area)&lt;BR /&gt;ServArea = arcpy.nax.ServiceArea(nd_service_area)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####################&lt;BR /&gt;## SET PROPERTIES ###&lt;BR /&gt;#####################&lt;/P&gt;&lt;P&gt;ServArea.distanceUnits = arcpy.nax.DistanceUnits.Kilometers&lt;BR /&gt;ServArea.travelMode = travel_mode&lt;BR /&gt;ServArea.outputType = arcpy.nax.ServiceAreaOutputType.Polygons&lt;BR /&gt;ServArea.geometryAtOverlap = arcpy.nax.ServiceAreaOverlapGeometry.Overlap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;######################&lt;BR /&gt;## LOAD THE INPUTS ###&lt;BR /&gt;######################&lt;/P&gt;&lt;P&gt;# MAP FIELDS FOR FACILITIES&lt;BR /&gt;fm_sa = ServArea.fieldMappings(arcpy.nax.ServiceAreaInputDataType.Facilities, True)&lt;BR /&gt;fm_sa["Name"].mappedFieldName = "CentreID"&lt;BR /&gt;fm_sa["Breaks"].mappedFieldName = "cutoff"&lt;/P&gt;&lt;P&gt;whereclause = "cutoff &amp;lt;&amp;gt; 'None None None'"&lt;BR /&gt;fac = arcpy.SelectLayerByAttribute_management(facilities,"NEW_SELECTION", whereclause)&lt;BR /&gt;arcpy.CopyFeatures_management(fac, Scratch + r"\fac_p")&lt;/P&gt;&lt;P&gt;ServArea.load(arcpy.nax.ServiceAreaInputDataType.Facilities, Scratch + r"\fac_p", fm_sa)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#########################&lt;BR /&gt;## SOLVE THE ANALYSIS ###&lt;BR /&gt;#########################&lt;BR /&gt;result_sa = ServArea.solve()&lt;/P&gt;&lt;P&gt;result_sa.export(arcpy.nax.ServiceAreaOutputDataType.Facilities,gdb + "\FinalAnalysis\SrvArea_Facil")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Export the results to a feature class&lt;BR /&gt;if result_sa.solveSucceeded:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;result_sa.export(arcpy.nax.ServiceAreaOutputDataType.Polygons,gdb + "\FinalAnalysis\SrvArea_Final")&lt;BR /&gt;else:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage("Solved failed")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(result_sa.solverMessages(arcpy.nax.MessageSeverity.All))&lt;/P&gt;&lt;P&gt;'''&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2019 03:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111683#M8684</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-20T03:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111684#M8685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the error:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Running script Service ARea Testing...&lt;BR /&gt;Solved failed&lt;BR /&gt;[[30194, 'Data values longer than 128 characters for field [Facilities:Breaks_Meters] are truncated.'], [30024, 'Solve returned a failure.'], [-2147200977, 'Invalid break values.']]&lt;BR /&gt;Completed script Service ARea Testing...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The issue is that there are no long fields as I truncated the values to 2 decimal places. The longest current format is 14 characters long. So something weird is going on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2019 03:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111684#M8685</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-20T03:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111685#M8686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would it be possible for you to share your facilities with me so I can test your script?&amp;nbsp; I can't tell from looking at it what's going wrong, but I'd like to get to the bottom of it.&amp;nbsp; I don't need your network dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2019 20:43:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111685#M8686</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2019-07-21T20:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111686#M8687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the file. I have zipped it into Google Drive as a shapefile. Let me know you if you have any issue!&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://drive.google.com/file/d/1syDsIuj-oPqLQrBmDwO8u7r5zbsFUW26/view?usp=sharing" title="https://drive.google.com/file/d/1syDsIuj-oPqLQrBmDwO8u7r5zbsFUW26/view?usp=sharing"&gt;Locations.zip - Google Drive&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 15:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111686#M8687</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-22T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111687#M8688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew.&amp;nbsp; Your script works fine with the addition of this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServArea.defaultImpedanceCutoffs = [1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems like you shouldn't need this because all your facilities have explicitly-set break values in the Breaks field, but for some reason it's getting confused.&amp;nbsp; I'll log a bug on our end to address this item of confusion, but I think if you add this to your code in the part where you're setting the service area properties, you should be good to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 15:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111687#M8688</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2019-07-22T15:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete a network analyst layer (i.e., Service Area, Closest Facility) using python 3 (ArcGIS Pro)?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111688#M8689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 16:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-delete-a-network-analyst-layer-i-e/m-p/111688#M8689</guid>
      <dc:creator>AndrewClark2</dc:creator>
      <dc:date>2019-07-22T16:27:07Z</dc:date>
    </item>
  </channel>
</rss>

