Publish layer as feature service on ArcServer using model builder?

2330
6
Jump to solution
10-30-2016 08:37 PM
MichaelTorbett1
Occasional Contributor

Is it possible to just use Model Builder to publish a feature service to an ArcServer? I have a geodatabase feature class that is linked to an sql table using model builder. This layer will auto update every time  the model runs on my machine. However, I want to have the model publish the layer as a feature service on my agency's Arcserver so that it can be added to a web map on ArcGIS Online. That way the web map will update as well.  I cannot figure out the best way to do this. Any help would be greatly appreciated. I am using ArcGIS  10.4 with a 10.2.2 Server. Also, ArcGIS is not installed on the server, just my computer.

Thanks,

Michael

1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

I would recommend doing a manual export of the XY Event layer to your enterprise geodatabase.  This will only need to happen once.  Then, you can set up a model that performs a truncate table and append from the event layer to the feature class.  After the table updates, you can execute the model that will update the enterprise geodatabase feature class. 

One thing to note is that the feature class does not have to be registered as versioned in order to do online edits.  If you do register the feature class as versioned, you want to make sure that you perform a geodatabase compress frequently as the A & D tables will grow quite large due to the truncate and append operation.

View solution in original post

6 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Michael,

Can you explain how the layer is updating?  It's possible that you do not have to re-publish the service after the update.  For example, if you have the geodatabase and SQL database registered with ArcGIS Server, as the data is updated the new edits will be read without having to re-publish the service.

0 Kudos
MichaelTorbett1
Occasional Contributor

Hey Jake,

Thanks for the reply,

I'm sure there is a better way to do this, but here is the model so far. I am making a database connection to our SQL server and creating an xy event layer, then storing it as a feature class on Arcserver. I'm working right now to register the sql server as well (although it's taking a while). What's the next step to getting this to ArcGIS Online? It needs to be stored as a feature service on the server correct?

  

0 Kudos
JakeSkinner
Esri Esteemed Contributor

You do not have to publish a feature service, unless you require editing.  You can publish a map service instead.  Is there a need to edit the data in an enterprise geodatabase, or through a web map/app in ArcGIS Online?  If you do not need to edit the data in either circumstances, I would recommend simply publishing the XY Event layer as a map service.  Then, you will not need to do anything for the service to update.  As the SQL table is updated, so with the event layer, as well as the map service.

MichaelTorbett1
Occasional Contributor

Jake,

 I didn't realize automating a layer was this easy. I would however like to be able to make edits within ArcGIS Online. Any advice for publishing and automating a feature service? 

Thank you for your help!

Michael

0 Kudos
JakeSkinner
Esri Esteemed Contributor

I would recommend doing a manual export of the XY Event layer to your enterprise geodatabase.  This will only need to happen once.  Then, you can set up a model that performs a truncate table and append from the event layer to the feature class.  After the table updates, you can execute the model that will update the enterprise geodatabase feature class. 

One thing to note is that the feature class does not have to be registered as versioned in order to do online edits.  If you do register the feature class as versioned, you want to make sure that you perform a geodatabase compress frequently as the A & D tables will grow quite large due to the truncate and append operation.

MichaelTorbett1
Occasional Contributor

Thanks for your help Jake. I apologize for the late response but I've been out due to wildfires the past couple of  weeks. The model changes you suggested are working well. Now all I have to do is export it to script and modify the code to work with task scheduler on our GIS Server. 

0 Kudos