Select to view content in your preferred language

Update data in a network dataset using python

1329
1
Jump to solution
05-26-2021 01:48 PM
AliciaShyu
Frequent Contributor

I'm working with SDE database connections and want to write a python script that will do the following:

  1. Replace old data with new data
  2. Rebuild the network

So far truncate and delete row tools don't work. 

My dilemma is very similar to this Need a script to replace data in a network dataset, which was posted 4 years ago. 

Is everyone refreshing their data manually?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

If you are really replacing your old data with a completely new dataset, you can use the Create Template From Network Dataset tool to create an XML template storing the network dataset schema, delete the network dataset, swap out your data, and then use Create Network Dataset From Template to re-create the network dataset referencing the new data. Then run Build Network to finalize it.

 

(These tools did not exist when that previous post was under discussion.)

View solution in original post

0 Kudos
1 Reply
MelindaMorang
Esri Regular Contributor

If you are really replacing your old data with a completely new dataset, you can use the Create Template From Network Dataset tool to create an XML template storing the network dataset schema, delete the network dataset, swap out your data, and then use Create Network Dataset From Template to re-create the network dataset referencing the new data. Then run Build Network to finalize it.

 

(These tools did not exist when that previous post was under discussion.)

0 Kudos