<?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: Need a script to replace data in a network dataset in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420682#M33049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do something similar to what &lt;A href="https://community.esri.com/migrated-users/11604"&gt;Rhett Zufelt&lt;/A&gt;‌ suggests with the append tool. &amp;nbsp;Because my network is in GCS and my source data ( vesioned) is in state plane with a different schema, my work flow goes something like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way replicate from source enterprise gdb to file gdb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use delete features tool on the GCS data followed by the append tool with the no test option that allows me to map attributes from my child replica source data to the GCS feature class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recreate the network manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not aware of a tool or python function that creates a network. &amp;nbsp;Maybe &lt;A href="https://community.esri.com/people/jsandhu-esristaff"&gt;jsandhu-esristaff&lt;/A&gt;&amp;nbsp;can provide some insight for us.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Dec 2016 13:45:09 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2016-12-16T13:45:09Z</dc:date>
    <item>
      <title>Need a script to replace data in a network dataset</title>
      <link>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420679#M33046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - looking for help with a Python script - I have a feature class consumed in a network dataset (street centerlines). Once a month, we get new data, and&amp;nbsp;I need to replace the old with the new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to this Python script to do:- Replace the old data with the new data,&amp;nbsp;- Rebuild the network dataset and address locator.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Issues: - In a non-versioned dataset, the fc cannot be worked with the truncate tool, as the '&lt;EM style="font-size: 11.0pt;"&gt;Operation not supported on a feature class in a controller dataset',&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;aka, it is still part of the network dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;- In a versioned dataset, truncate is &lt;EM&gt;"n&lt;/EM&gt;&lt;EM&gt;ot supported on a versioned table’.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;EM&gt;-&amp;nbsp;&lt;/EM&gt;In a versioned dataset, and in an edit session within ArcMap,&amp;nbsp;&lt;SPAN&gt;truncate is also&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;"n&lt;/EM&gt;&lt;EM&gt;ot supported on a versioned table’.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Acknowledgements: - There is no way to remove the fc from the network dataset using Python, because of the inability to work with the feature class wizard. There is also no way to remove the fc from the dataset without removing it from the network dataset. Also, deleting the entire dataset and rebuilding it and the network dataset is not an option, for the same reason with Python/the wizard; (re)building the network dataset IS available to Python.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Current, manual workflow: 1. Remove the network dataset components, 2. Remove the old fc, 3. Import the new fc, 4. Rebuild the network dataset based on the new fc, and 5. Rebuild the address locator. This workflow is not repeatable through Python.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;In another attempt to find a fix, was able to work through the entire process of 1. Registering the dataset as versioned, 2. Start an edit session in ArcMap, 3. Select and delete all assets in the fc, 4. Copy and paste (I know, not the proper method) the new data to the original fc (identical schema), 5. Rebuild the network dataset with the new data, and 6. Unregister the dataset. I'm not able, to put this into a Python script successfully using an existing map document, edit session, select, delete, add, etc. From start to finish, it's clunky and very time-consuming, dealing with 35k assets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to use truncate and append, but that solution isn't looking like it will work for me. I want this 100% automated, no fingers to touch anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've gone through 30 variations of scripts - good learning experience - however... any ideas? Working with SDE database connections and datasets. New data resides in a different db.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 19:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420679#M33046</guid>
      <dc:creator>DanRose</dc:creator>
      <dc:date>2016-12-15T19:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need a script to replace data in a network dataset</title>
      <link>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420680#M33047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI 10.5 offers nothing new in that regard&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/get-started/introduction/whats-new-in-arcgis.htm" title="http://desktop.arcgis.com/en/arcmap/latest/get-started/introduction/whats-new-in-arcgis.htm"&gt;What's new in ArcMap—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 19:38:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420680#M33047</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-12-15T19:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need a script to replace data in a network dataset</title>
      <link>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420681#M33048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know if this helps, but I have a somewhat similar situation.&amp;nbsp; I have Water/Sewer/Storm geometric networks, versioned datasets. I often times do something similar to your last attempt, but after selecting and deleting the assets, I then use the append command to put the updated assets back in there instead of copy/paste.&amp;nbsp; A lot faster than trying to copy/paste, not to mention that will normally crash/seize me up if there are many assets to transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure on your network dataset as my geonets have edges and junctions (lines and points).&amp;nbsp; I only delete/append the line data, and when I append it back in, it automatically rejoins all the network stuff so I don't have to re-build.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I said, different but "similar", if you haven't tried the delete/append method, you may give it a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 01:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420681#M33048</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2016-12-16T01:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need a script to replace data in a network dataset</title>
      <link>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420682#M33049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do something similar to what &lt;A href="https://community.esri.com/migrated-users/11604"&gt;Rhett Zufelt&lt;/A&gt;‌ suggests with the append tool. &amp;nbsp;Because my network is in GCS and my source data ( vesioned) is in state plane with a different schema, my work flow goes something like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way replicate from source enterprise gdb to file gdb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use delete features tool on the GCS data followed by the append tool with the no test option that allows me to map attributes from my child replica source data to the GCS feature class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recreate the network manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not aware of a tool or python function that creates a network. &amp;nbsp;Maybe &lt;A href="https://community.esri.com/people/jsandhu-esristaff"&gt;jsandhu-esristaff&lt;/A&gt;&amp;nbsp;can provide some insight for us.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 13:45:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-a-script-to-replace-data-in-a-network-dataset/m-p/420682#M33049</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2016-12-16T13:45:09Z</dc:date>
    </item>
  </channel>
</rss>

