POST
|
Yes, programmatically at 10.8.1+, at least for ArcGIS Server Map/Feature services: Add the new item with the item_id you desire using the ContentManager and the (Available at 10.8.1+) item_id property. In the ArcGIS Server admin console, edit the portal properties of the referenced service to match the new item_id Republish (overwrite) the new Portal layer with service content (from ArcGIS Pro) - this might be optional but would allow you to confirm your settings Delete the 'old' item(s) from Portal
... View more
07-19-2022
08:03 AM
|
0
|
0
|
1102
|
POST
|
I had this issue; what I found was that the service I was trying to overwrite was having a pre-existing problem. In other words, make sure the current service functions properly before attempting to overwrite it. Stopping, re-starting, then reviewing the ArcGIS Server logs.
... View more
07-01-2020
08:00 AM
|
0
|
0
|
1309
|
POST
|
Regarding Ishmael's post on Multiple Choice questions, I see the ability to review individual items within a select_multiple type; is it possible to review if a list of items are selected? I have a client who is observing activities, and which observed activities are unsafe, both fields reference the same choice list. I'd like to add a constraint that ensures that if a item is selected in the 'unsafe' field it is also selected in the 'observed' field. Can something along these lines be done? type name label constraint constraint_message select_multiple Activities observed Observed Activities select_multiple Activities unsafe Unsafe Activities selected(${observed}, ${unsafe} ) Unsafe Activities must also be noted as Observed above
... View more
09-26-2017
09:40 AM
|
0
|
8
|
2026
|
POST
|
Scoping it inside an edit session will likely be your ticket here. ## CREATE VERSIONED EDIT SESSION
with arcpy.da.Editor(gisConn) as edit:
edit.startEditing(True, True) #see the Help; multi-user mode
edit.startOperation()
#Do work
## STOP EDITING
edit.stopOperation()
edit.stopEditing(True) # True saves edits
... View more
07-02-2015
05:34 AM
|
0
|
0
|
685
|
POST
|
1) You'd need something to denote the processing values to separate into which text file. This could be a separate field, or (if you dare) hard-code your Python... but I'd only recommend the latter if your separations are static. Assuming you have a way to separate, I'd push the separate value and their output text file to a dict, and move the process of writing the data to a separate function. Then while processing the rows, you can specify which file they go to. Something like: import arcpy, os, time # you don't need os or time if you use a constant log file name (line 18)
def log(txt, inFile, newRun):
try:
if newRun == True:
csvFile = open(inFile, 'w')
elif newRun == False:
csvFile = open(inFile, 'a')
csvFile.writelines(txt)
csvFile.flush()
csvFile.close()
except IOError:
print 'Unable to write to file ' + inFile
def main():
inDS = r"C:\TEMP\JUNK\ServiceRequest.gdb\ServiceRequests"
whereClause = r"STATUS = 'Unassigned'"
statusField = "STATUS"
deptField = u'DEPT_ASSIGNEE' ##determines how to separate the tables (see table separation note below)
logDir = r"C:\TEMP\JUNK"
updateTo = "Assigned"
fieldArr = []
for fld in arcpy.ListFields(inDS):
fieldArr.append(fld.name)
fieldArr.remove('SHAPE')
##Table Separation Note
##Create the list of output text files (must be based on a common value) - note does not have to be a field in the data...
##you could create a dictionary to hold these values in code, but doing so would cause the code to go stale upon new unbeforeseen values
with arcpy.da.SearchCursor(inDS,fieldArr) as sc:
fileStore = {}
for scr in sc:
for j in range(len(scr)):
if j == fieldArr.index(deptField) and not in fileStore.keys():
fileStore[scr ] = logDir + os.sep + time.strftime('%Y%m%d', time.localtime(time.time())) + str(scr ) + '.csv'
headerLine = ""
for i in range(len(fieldArr)):
if i != len(fieldArr) - 1:
headerLine += str(fieldArr) + ","
else:
headerLine += str(fieldArr) + "\n"
for k,v in fileStore.iteritems():
log(headerLine, v, True)
fieldxi = fieldArr.index(statusField)
sepxi = fieldArr.index(deptField)
try:
with arcpy.da.UpdateCursor(inDS, fieldArr, whereClause) as cursor:
for row in cursor:
rowLine = ""
fileWrite = ""
for i in range(len(row)):
if i == sepxi:
fileWrite = fileStore[row]
if i != len(row) - 1:
rowLine += str(row) + ","
else:
rowLine += str(row) + "\n"
row[fieldxi] = updateTo
cursor.updateRow(row)
log(rowLine, fileWrite, False)
except:
print 'Error updating the dataset'
if __name__ == '__main__':
main() 2) The smtplib module should be able to assist you with sending email as attachments. 3) Using a try/except is considered good practice for error handling you should add in anyhow; to expand this you could add an if statement with a break to exit a segment of code. Good Luck
... View more
06-23-2014
09:19 AM
|
0
|
1
|
685
|
POST
|
Something like this maybe? import arcpy
connectionFile = r"<path\to>\connection.sde"
#block new connections to the database.
arcpy.AcceptConnections(connectionFile, False)
#disconnect all users from the database.
arcpy.DisconnectUser(connectionFile, "ALL")
# do work here
#allow new connections to the database.
arcpy.AcceptConnections(connectionFile, True)
... View more
06-20-2014
09:57 AM
|
0
|
0
|
437
|
POST
|
Try this link as another possible solution to this error.
... View more
12-12-2013
05:27 AM
|
0
|
0
|
1328
|
POST
|
I believe you are getting this error because the dataset is not registered as versioned with the database? Try changing to:
...
edit.startEditing(True,False)
...
or register the dataset as versioned before opening the edit session
... View more
12-12-2013
05:23 AM
|
0
|
0
|
579
|
POST
|
When you unregister a replica, be sure to do it on both ends; you need to 'cut the cord' between parent and child on the parent end and the local/ child end as well. This poses somewhat of a problem. If an ArcGIS Server administrator is using a Geodata Service to accept data updates from users, the client controls when they make (register) the replica and if/when they choose to unregister it. As the data administrator, one can very quickly end up with many replicas and not know which ones are being used, and/or which ones have been unregistered client-side. http://ideas.arcgis.com/ideaView?id=087E00000004rvpIAA For the near-term its probably best to have pretty tight permissions on the ArcGIS Server as to who can access your GeoData services.
... View more
09-13-2013
10:06 AM
|
0
|
0
|
254
|
POST
|
The default Search in ArcGIS for Sharepoint... any way to modify which locators are used and in what order? i.e. we'd prefer it so search through some of our data before going out to an Esri Geocoder. Customizing Locators adds the capability to items in a list, but not when browsing around the map. Thanks! Paul
... View more
04-19-2013
07:07 AM
|
0
|
0
|
381
|
POST
|
Used this today... Utilized the .GetDataSource method of the IMapServerDataAccess ...
[LEFT]IMapServer3 mapServer = serverObjectHelper.ServerObject as IMapServer3;
IStandaloneTableInfos satInfos = _MapServerInfo.StandaloneTableInfos;
IStandaloneTableInfo satInfo;
string myTableName;
for (int i = 0; i < satInfos.Count; i++)
{[INDENT]satInfo = satInfos.get_Element(i);
if (myTableName.Equals(satInfo.Name, StringComparison.InvariantCultureIgnoreCase) == true)
{
[INDENT]ITable myTable = setNonSpatialTable(mapServer.DefaultMapName, i);
break;[/INDENT]}[/INDENT]}
...
private ITable setNonSpatialTable(string mapName, int tablei)
{
[INDENT]if (tablei != null)
{
[INDENT]tablei = tablei + _MapServerInfo.MapLayerInfos.Count; //Tables listed after layers
ITable outTable = (ITable)_MapServerDataAccess.GetDataSource(mapName, tablei);
return outTable;[/INDENT]}
return null;[/INDENT]}
...[/LEFT] Thanks!
... View more
01-25-2013
06:46 AM
|
0
|
0
|
381
|
POST
|
ERROR 001272: Analyzer errors were encountered (codes = 90) When trying to publish a feature service of a single SDE feature class: default symbology, no definition query, non-versioned data. All 'Analyze' results have been remedied. ERROR 001272: Analyzer errors were encountered (codes = 52) When trying to publish the same service with two non-versioned tables from the same data source Suggestions anybody? Took a little digging and some help from here http://resources.arcgis.com/en/help/main/10.1/index.html#/00090_value_requires_a_registered_database/00sq000000m4000000/ Adjusted my connection settings and.... money. Hope this helps someone else!
... View more
12-18-2012
10:27 AM
|
2
|
1
|
708
|
POST
|
ERROR 001272: Analyzer errors were encountered (codes = 90) When trying to publish a feature service of a single SDE feature class: default symbology, no definition query, non-versioned data. All 'Analyze' results have been remedied. ERROR 001272: Analyzer errors were encountered (codes = 52) When trying to publish the same service with two non-versioned tables from the same data source Suggestions anybody?
... View more
12-18-2012
09:54 AM
|
0
|
2
|
6056
|
POST
|
We were having a similar issue, only on SQL Server. In the first step of the Geometric Network Wizard we had been selecting 'Yes' to 'Snap Features within a specified tolerance'; and specifying a looser tolerance level than the feature dataset is based on. By selecting 'No', we were able to create and build the geometric network successfully. We still needed to snap our features however, so we used the Snap Tool (Editing Tools Toolbox); which gave us a little more control over how snapping was carried out anyway. Maybe this will work for your Feature Dataset?
... View more
11-16-2011
06:13 AM
|
2
|
0
|
1168
|
POST
|
I have an ETL tool that converts a SDE feature dataset into a Microstation V8 file. I would like it to run automatically on a weekly basis. What is the easiest way to go about this? Thanks!
... View more
09-01-2011
06:02 AM
|
0
|
1
|
1921
|
Title | Kudos | Posted |
---|---|---|
2 | 11-16-2011 06:13 AM | |
2 | 12-18-2012 10:27 AM |
Online Status |
Offline
|
Date Last Visited |
02-08-2023
07:34 PM
|