POST
|
This code works.It will create a table in an SDE database - recreating it each time. Lists all the domains used in the workspace. import arcpy inWorkspaceString = arcpy.GetParameterAsText(0) arcpy.env.workspace = inWorkspaceString outTable = "OTHER_ListDomains_tbl" # Delete old and Create new output table each time if arcpy.Exists(outTable): arcpy.Delete_management(outTable) # arcpy.CreateTable_management(inWorkspaceString, outTable) arcpy.AddField_management(outTable, "DomainName", "TEXT", "", "", 255, "", "NULLABLE", "REQUIRED") arcpy.AddField_management(outTable, "Versioned", "TEXT", "", "", 1, "", "NULLABLE", "NON_REQUIRED") # newRows = arcpy.InsertCursor(outTable, "") # Create cursor to store new rows for output table arcpy.MakeTableView_management(outTable, "outTableView", "", "", "") # Create table view for output table (for searching for existing records) # # Create list of domains desc = arcpy.Describe(inWorkspaceString) domains = desc.domains domains.sort() # Sorts list for domain in domains: # Write items from list to output table if they don't already exist there arcpy.SelectLayerByAttribute_management("outTableView", "NEW_SELECTION", "\"DomainName\" = \'" + domain + "\'") if int(arcpy.GetCount_management("outTableView").getOutput(0)) == 0: newRow = newRows.newRow() newRow.DomainName = domain newRows.insertRow(newRow) del newRows # Removes lock on output table
... View more
06-28-2017
11:50 AM
|
1
|
0
|
1063
|
IDEA
|
I am trying to write just such a tool in python but it keeps bombing when I do a describe on the fields for the layer. Anyone have any ideas? Code below import arcpy # inWorkspaceString = arcpy.GetParameterAsText(0) arcpy.env.workspace = inWorkspaceString outTable = "OTHER_ListDomains_tbl" # Delete old and Create new output table each time if arcpy.Exists(outTable): arcpy.Delete_management(outTable) # arcpy.CreateTable_management(inWorkspaceString, outTable) arcpy.AddField_management(outTable, "DomainName", "TEXT", "", "", 255, "", "NULLABLE", "REQUIRED") arcpy.AddField_management(outTable, "Feature_Class", "TEXT", "", "", 255, "", "NULLABLE", "NON_REQUIRED") # newRows = arcpy.InsertCursor(outTable, "") # Create cursor to store new rows for output table arcpy.MakeTableView_management(outTable, "outTableView", "", "", "") # Create table view for output table (for searching for existing records) # layers = arcpy.ListFeatureClasses() # Adds feature classes to list for layer in layers: desc = arcpy.Describe(layer) if desc.featureType == "Simple": # Create list of fields fields = arcpy.ListFields(layer) for field in fields: descf = arcpy.Describe(field) dom = descf.domain # Write items from list to output table if they don't already exist there arcpy.SelectLayerByAttribute_management("outTableView", "NEW_SELECTION", "\"DomainName\" = \'" + dom + "\' AND \"Feature_Class\" = \'" + layer + "\'") if int(arcpy.GetCount_management("outTableView").getOutput(0)) == 0: newRow = newRows.newRow() newRow.DomainName = dom newRow.Feature_Class = layer newRows.insertRow(newRow) del newRows # Removes lock on output table
... View more
06-28-2017
11:45 AM
|
0
|
0
|
599
|
POST
|
import arceditor # # Import arcpy module import os import arcpy from arcpy import env inSDE = "\\\\server\\ArcSDE Connection Files\\GENgis_GISDB.sde" env.workspace = inSDE # # Get List of Rasters in workspace fcList = arcpy.ListFeatureClasses() for fc in fcList: # desc = arcpy.Describe(fc) if desc.dataType == "FeatureClass": # Process: Register As Versioned arcpy.AddMessage("Trying: " + fc) # outFC = os.path.join(inSDE, fc) arcpy.RegisterAsVersioned_management(outFC, "NO_EDITS_TO_BASE") arcpy.AddMessage(fc + " Registered as Versioned") # # Process: Change Privileges arcpy.ChangePrivileges_management(outFC, "public", "GRANT", "") arcpy.AddMessage(fc + " Granted Public permissions") # # Process: Add Global IDs arcpy.AddGlobalIDs_management(outFC) arcpy.AddMessage(fc + " now has Global IDs") # else: arcpy.AddMessage("Skip table: " + fc)
... View more
05-15-2017
02:24 PM
|
0
|
1
|
1159
|
POST
|
I'm getting this error in a script trying to loop through a SQL Enterprise GeoDB and Register As Versioned all the Feature Classes within it. It keeps telling me I'm trying to do this on a Feature Dataset but there aren't any feature datasets in the GeoDB. I'm doing a describe to check for feature class since there are some tables. What is this about? Tried in 10.4.1 and 10.5.
... View more
05-15-2017
01:41 PM
|
1
|
6
|
1427
|
POST
|
It turns out that using Add Raster to Mosaic Dataset will work with Raster Catalog - you just have to select Raster Type "Table" and then you can see the Raster Catalog as input. It seemed to work fine.
... View more
03-22-2017
10:53 AM
|
0
|
0
|
594
|
POST
|
It sounds like we are supposed to use mosaic datasets to store raster imagery, like DRG topos for instance, instead of raster catalogs. What is the best way to convert from raster catalog to mosaic dataset? There does not look to be an easy way. All the individual rasters are embedded into the raster catalog. Do you have to export them first and then have the mosaic dataset reference these? We are upgrading our SQL Server from 2008 to 2016 and ArcGIS Server from 10.3.1 to 10.5 so just trying to get everything in the latest and greatest formats.
... View more
03-21-2017
02:59 PM
|
0
|
2
|
1282
|
POST
|
The "fix" to this was to manually take down the ArcGIS Service on the SDE data, kick off the users, do a compress, analyze datasets, and rebuild indexes. We were doing this with a script weekly but not sure if it was working. We did find some orphan replicas, posted data from a version and with the compress workflow this did the trick.
... View more
08-31-2015
12:53 PM
|
1
|
0
|
1932
|
POST
|
That's it - incredibly fun flight that day. The air's pretty bad around here.
... View more
08-25-2015
11:51 AM
|
0
|
0
|
661
|
POST
|
Not so easy to "rename" since it's a feature class in Enterprise GDB that has internal ArcServer services off of it. I did export to a file gdb with the same feature class name and it published fine. I will export to another feature class and try publishing to a different name with a different name.
... View more
08-25-2015
10:54 AM
|
0
|
1
|
661
|
POST
|
That was the Tehipite Fire in 2008 - Kings Canyon National Park - just east of the current Rough Fire.
... View more
08-25-2015
10:51 AM
|
1
|
2
|
661
|
POST
|
I already have a help ticket into ESRI but I have yet to be contacted. That's an underscore not a ".". Everything I have is 10.3.1. The name of the feature class is correct in SQL Server. The real point of all this is that is was working. It just randomly decided not to work and I have no idea why.
... View more
08-25-2015
07:49 AM
|
0
|
6
|
1271
|
POST
|
I exported the data from SDE into a file gdb and it then published fine. However now there is a problem with our SDE DB that seems only to apply to AGOL and nothing else. Wish I knew what it was.
... View more
08-24-2015
11:53 AM
|
0
|
8
|
1271
|
POST
|
It creates the Service Definition however and so when I try and publish out of AGOL in the web version I get the attached error - something about Base Tables.
... View more
08-24-2015
09:59 AM
|
0
|
9
|
1271
|
POST
|
Even more interesting - it published the Service Definition - it just doesn't create the Service.
... View more
08-24-2015
09:30 AM
|
0
|
10
|
1271
|
POST
|
There are no Custom Symbols - it's all ESRI symbols. There is a multi-part polygon however. The message says Server Side publishing failed at the last step. It packages everything likes it's ready to publish and fails on what seems like the ESRI side.
... View more
08-24-2015
09:26 AM
|
0
|
11
|
1271
|
Title | Kudos | Posted |
---|---|---|
1 | 08-31-2015 12:53 PM | |
1 | 03-17-2015 08:40 AM | |
2 | 03-04-2020 03:07 PM | |
2 | 02-27-2013 02:17 PM | |
1 | 06-28-2017 11:50 AM |
Online Status |
Offline
|
Date Last Visited |
09-01-2021
09:24 AM
|