I would like to know if there is a way to access the archive class in a Map Service on ArcGIS Server.
I have a Map Service with feature class stored in a SDE GeoDatabase with Archiving and Versionning enabled.
My questions are:
Layer's data source is not registered with the geodatabase (Feature Service). Does it means it's not possible to publish an Archive Class?
1. Enabling Archiving is a database action, nothing to do with ArcGIS Server. When the feature is edited, the triggers put in place for Archiving to work take over, regardless if the edit came from ArcGIS Server or ArcDesktop.
2. Enable Time aware when creating ArcGIS Server Services
3. I dont quite understand why one would publish the archived tables directly. You dont add the archived tables directly in arcmap, you work with the archived items through the featureclass in which the archived was enabled.
The aim to publish an archived table through ArcGIS Server is simply to enable making queries on it. It could be interesting for a web application to allow user to see how the data changed for a period of time.
I realize that an archived table cannot be published into a map service if the Features Access capability is enabled, but there is no problem if it's desabled.
I'm experiencing the exact same issue. I would like to publish the archive table as a layer to allow a user to see what the data looked like at specific times in history, including data that has been deleted in the current version. I also tried to create a view with the archive table and publish that, but was also unsuccessful.
any tips would be helpful!
I realize that an archived table cannot be published into a map service if the Features Access capability is enabled
That is not correct. You can publish a Feature Access Service on an Archived FeatureClass. Further, it is one of only two methods you CAN use if you plan to do SYNC and OFFLINE capabilities.
You need to add a Global GUID before enabling Archiving for providing database level unique keys for syncing or editing.
How would one use REST services to detect what features have been deleted during a certain period of time? More to the point, how would one synchronize two identical feature types using only REST services? The trouble I'm seeing is there is no way of querying for deleted features because, well, they're deleted. I would think archiving would provide a mechanism for seeing what was deleted within a time period.
How does one detect what features have been deleted?
The trouble I'm seeing is there is no way of querying for deleted features because, well, they're deleted.
First, no features are deleted. Archiving does not work this way.
Archiving is applied on the database level, before the GIS Web Stack. When you Archive enable a featureclass, what happens is a VIEW is created. it will be a table name ending with _EVW. The 'featureclass' table will have ALL records created / Inserted. Any current record is given a 9999 date stamp in an auto generated field when archiving. Any time a new feature is added, it is given this stamp. Any existing record that is EDITED or DELETED has its record / feature COPIED into the same table, the new record is given a 9999 stamp and the original record or 'deleted' record is given a real time stamp.
No records are ever deleted or edited, only created. This of course is something to be aware of for scaling the db size and performance.
when adding the layer in ArcGIS Desktop, add the feature layer, enable TIME on the layer, publish to ArcGIS Server. ALL records are accessible. You can also use the Feature Access Service and allow edits... and it will all work. Showing the layer will show only 9999 stamped records aka current. Enabling a time slider allows you to select Timestamped records...this would show records you have 'deleted' (which in the db, is not deleted) or edited changes.
Hope this helps.
thanks for your replies, I'm having trouble replicating some of the items you mentioned and am wondering what I'm misunderstanding.
If it makes a difference I'm talking about a SQL Server 2012 Geodatabase at ArcGIS 10.4.0 for my current DB environment, with ArcGIS Server 10.4.0 unfederated. I'm not sure it does, but you never know.
When I enable Archiving it looks to be creating a "FeatureClass"_H table. So if the feature class is GIPractice the historical (or archive table) is GIPractice_H (checking the source of the "Historical Archive" layer added with the Geodatabase History Toolbar backs this up). The time control fields in there seem to be GDB_FROM_DATE and GDB_TO_DATE, although the created_date and last_edited_date also appear.
When I look at the GIPractice_evw view query in SQL Server manager I don't see any reference to the GPIPractice_H table, and can't seem to find records that are deleted, but are visible in the "_H" table. Also, when I pull the feature class into ArcMap and make it time aware the GDB_FROM_DATE and GDB_TO_DATE fields are missing, only the created_date and last_edited_date fields are available, and they only seem to show the current data.
what am I missing here? I felt like I was finally getting a hold on some of this background DB stuff and it seems like I'm missing something important here.
thanks in advance!