POST
|
Thanks, George. Based on your link, it looks like I do not want to register my database as managed but I'm not sure what I'm supposed to do in order to get where I need to go. Here's what I'm trying to do: I have an ArcSDE/SQL database. It's a registered data source in ArcGIS Server Manager. This database contains a featureclass which will be the only data layer in a web service. I want to be able to update the featureclass in the SDE database and have the updates appear in the web service without republishing the web service. Is this possible? If so, how would I do it? When I try to publish the MXD, I get a warning about how the data will be published to the server because it's not a registered data source (even though it is). I'm confused as to which path to take.
... View more
06-12-2014
12:05 PM
|
0
|
0
|
754
|
POST
|
I'm having this same problem with SQL/SDE. Is there an article that will give me a little more information as to what Joanne is referring to? I don't quite follow the explanation there. Thanks for your help!
... View more
06-12-2014
09:57 AM
|
0
|
0
|
754
|
POST
|
I've got a geoprocessing service based on a python script. The script works great from ArcGIS Desktop but when run as a geoprocessing service, it does not update the geodatabase. It also does not provide any errors and I'm not seeing anything helpful in the server logs. Here's what it does perfectly from the desktop: 1) Receive a username and street address. 2) Geocode that address to an XY coordinate using ArcGIS Online. 3) Write the data to a feature class in a file geodatabase. 4) Use Intersect_analysis to combine this data with a totally unrelated data set in another geodatabase. 5) Use Append_management to concatenate this new row of data onto a final feature class. When I publish this script a geoprocessing tool, it simply doesn't work - at least not completely. All I get by way of user feedback from the REST endpoint is the following: Job Status: esriJobSucceeded Results: None The geodatabase does not get updated. This seems like it might be a permissions issue, so here's what I've done: 1) Registered the geodatabase in ArcGIS Server Manager. 2) Gave the ArcGIS User account Read, Write, and Modify permissions on the directory which contains the geodatabase. FWIW, my code is below. Any help would be much, much appreciated!
# Import arcpy module
import arcpy, os
arcpy.AddMessage("Starting the script...")
varWorkingDirectory = r"C:\Data\GISData\SalesForceDemo"
#varWorkingDirectory = os.getcwd()
# Capture the user input
varCustomerName = arcpy.GetParameterAsText(0)
varAddress = arcpy.GetParameterAsText(1)
varCity = arcpy.GetParameterAsText(2)
varState = arcpy.GetParameterAsText(3)
varZip = arcpy.GetParameterAsText(4)
# Delete any old data in the TestAddresses table
arcpy.AddMessage("Deleting any old data in the TestAddresses table...")
try:
rows = arcpy.UpdateCursor(varWorkingDirectory + r"\SFTest.gdb\TestAddresses")
for row in rows:
rows.deleteRow(row)
del row
del rows
except:
arcpy.AddMessage("Could not delete the old data from TestAddresses.")
# Insert the new data into the TestAddresses table so that it can be geoprocessed
arcpy.AddMessage("Inserting new data into the TestAddresses table...")
try:
rows = arcpy.InsertCursor(varWorkingDirectory + r"\SFTest.gdb\TestAddresses")
row = rows.newRow()
row.Name = varCustomerName
row.Address =varAddress
row.City = varCity
row.State = varState
row.Zip = varZip
rows.insertRow(row)
# Delete cursor and row objects to remove locks on the data
del row
del rows
except:
arcpy.AddMessage("Could not insert the new data into TestAddresses.")
# Delete the old output feature classes
arcpy.AddMessage("Deleting the old output feature classes...")
try:
arcpy.Delete_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults")
arcpy.Delete_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In")
except:
arcpy.AddMessage("Could not delete the old data from CompletedGeocodingResults and CompletedGeocodingResults_In.")
# Local variables:
TestAddresses = varWorkingDirectory + r"\SFTest.gdb\TestAddresses"
World_GeocodeServer = "GIS Servers\\arcgis on geocode.arcgis.com (user)\\World.GeocodeServer"
RadonNew = "C:\\Data\\GISData\\ROE\\NewRadonData.gdb\\RadonNew"
CompletedGeocodingResults = varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults"
FinalGeocodingResultsWithRadon = varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In"
# Process: Geocode Addresses
try:
arcpy.GeocodeAddresses_geocoding(TestAddresses, World_GeocodeServer, "Address Address VISIBLE NONE;Neighborhood <None> VISIBLE NONE;City City VISIBLE NONE;Subregion <None> VISIBLE NONE;Region State VISIBLE NONE;Postal Zip VISIBLE NONE;PostalExt <None> VISIBLE NONE;CountryCode <None> VISIBLE NONE", CompletedGeocodingResults, "STATIC")
except:
arcpy.AddMessage("Could not perform GeocodeAddresses_geocoding.")
# Process: Intersect
arcpy.AddMessage("Performing Intersect_analysis...")
try:
arcpy.Intersect_analysis(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults #;C:\Data\GISData\ROE\NewRadonData.gdb\RadonNew #", FinalGeocodingResultsWithRadon, "ALL", "", "INPUT")
except:
arcpy.AddMessage("Could not perform Intersect_analysis.")
# Append the new data onto the master featureclass
# Append_management (inputs, target, {schema_type}, {field_mapping}, {subtype})
arcpy.AddMessage("Performing Append_management...")
try:
arcpy.Append_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In", r"\SFTest.gdb\FinalGeocodingResults", "TEST","","")
except:
arcpy.AddMessage("Could not perform Append_management.")
... View more
06-02-2014
02:13 PM
|
0
|
0
|
1707
|
POST
|
Hello, everyone. I'm having trouble getting ArcGIS 10.1 License Manager to run on our new Windows Server 2012 machine. I've tried turning the server firewall off but that hasn't helped. The network firewall is configured to allow communication over port 27000. The error from the log file is: 16:07:10 (lmgrd) Since this is an unknown status, license server 16:07:10 (lmgrd) manager (lmgrd) will attempt to re-start the vendor daemon. 16:07:10 (lmgrd) Starting vendor daemon at port 27000 16:07:10 (lmgrd) Using vendor daemon port 27000 specified in license file 16:07:10 (lmgrd) REStarted ARCGIS (pid 7228) 16:07:10 (ARCGIS) FLEXnet Licensing version v11.10.0.0 build 95001 i86_n3 16:07:10 (ARCGIS) Server started on ServerName for: ACT 16:07:10 (ARCGIS) EXTERNAL FILTERS are OFF 16:07:10 (lmgrd) ARCGIS using TCP-port 0 16:07:10 (ARCGIS) tcp_s is bad!!! Exiting 16:07:10 (ARCGIS) EXITING DUE TO SIGNAL 28 Exit reason 5 16:07:10 (lmgrd) ARCGIS exited with status 28 (Communications error) I'm totally stumped. Any help would be much appreciated! Thanks in advance.
... View more
06-04-2013
06:23 AM
|
0
|
2
|
9160
|
POST
|
Hmmm... It looks like you're running code from within ArcGIS Desktop and I'm trying to run this as a stand-alone script. Perhaps that's the difference. I need this to run as a stand-alone automated script. I've tried using a variation of your code (as follows) but the error remains. I've also attached a screenshot of the MXD in case that adds any clarity. I really appreciate your help.
import arcpy, os
from arcpy import env
env.workspace = os.getcwd()
mxd = arcpy.mapping.MapDocument(env.workspace + r"\CoastalCurrentsData.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "CoastalCurrentsData")[0]
# Refresh the layers unique value symbology so that it is referencing the current data
lyr = arcpy.mapping.ListLayers(mxd, "RecentData", df)[0]
lyr.symbology.addAllValues()
# AttributeError: 'Layer' object has no attribute 'symbology'
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
... View more
12-27-2012
07:52 AM
|
0
|
1
|
1565
|
POST
|
Thank you for taking a look at my code. Unfortunately, I could not solve the problem with the code you provided. The code and error are as follows: import arcpy, os
from arcpy import env
env.workspace = os.getcwd()
mxd = arcpy.mapping.MapDocument(env.workspace + r"\CoastalCurrentsData.mxd")
# Dataframe stuff - perform an arcpy.mapping UpdateLayer (using the above pre-authors layer file)
df = arcpy.mapping.ListDataFrames(mxd, "CoastalCurrentsData")[0]
updateLayer = arcpy.mapping.ListLayers(mxd, "RecentData", df)[0]
sourceLayer = arcpy.mapping.Layer(env.workspace + "/USWC_1km_WGS_1984.lyr")
arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer, True)
# Refresh the layers unique value symbology so that it is referencing the current data
# HERE'S WHERE THE ERROR HAPPENS #######
sourceLayer.symbology.addAllValues()
# AttributeError: 'Layer' object has no attribute 'symbology'
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
... View more
12-27-2012
06:46 AM
|
0
|
0
|
1565
|
POST
|
Hello, everyone. I have a layer file that points at a FeatureClass. This FeatureClass periodically receives new data. I need to update the layer file so that it recognizes the new data. I'm trying to use the code found at: http://resources.arcgis.com/en/help/main/10.1/#/UpdateLayer/00s30000003p000000/ as a starting point but it's erroring out saying "AttributeError: 'Layer' object has no attribute 'symbology'" Ive been grinding on this for a week now and I'm totally stumped here. The layer file does have symbology set up (see attached screenshot), so I've no idea what the problem is. I'm in desperate need of help and would appreciate any suggestions. My code is as follows:
import arcpy, os
from arcpy import env
env.workspace = os.getcwd()
mxd = arcpy.mapping.MapDocument(env.workspace + r"\CoastalCurrentsData.mxd")
# Dataframe stuff - perform an arcpy.mapping UpdateLayer (using the above pre-authors layer file)
df = arcpy.mapping.ListDataFrames(mxd, "CoastalCurrentsData")[0]
updateLayer = arcpy.mapping.ListLayers(mxd, "RecentData", df)[0]
sourceLayer = arcpy.mapping.Layer(env.workspace + r"\USWC_1km_WGS_1984.lyr")
arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer, True)
# Refresh the layers unique value symbology so that it is referencing the current data
lyr = arcpy.mapping.ListLayers(mxd, "RecentData", df)[0] # HERE'S WHERE THE ERROR HAPPENS #######
lyr.symbology.addAllValues()
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
... View more
12-27-2012
05:44 AM
|
0
|
8
|
4567
|
POST
|
Hello, everyone. I've got a script that downloads a large number of shapefiles from an FTP site. Those shapefiles are then imported into a FileGeodatabase FeatureClass. I need to use a python script to automate a few MXD modifications each time the data are downloaded and I???m not sure if it???s even possible. I don???t need a fully scripted solution but if anyone here could tell me which, if any python objects to use, that would be stellar. The tasks are as follows: 1) Categorize the symbology of data based on the TimeStamp field in the FeatureClass. 2) Use the Up Arrow as the symbol for all data points. 3) Assign the Rotation of the Up Arrow based on the Bearing field. I've attached a screenshot, showing the conversion which I need to perform in terms of symbology. Thanks a million for any help!
... View more
12-07-2012
05:34 AM
|
0
|
3
|
3204
|
POST
|
Hello, everyone. I'm a little late to the discussion but was hoping one of you could point me in the right direction. I've got a script that downloads a large number of shapefiles from an FTP site. Those shapefiles are then imported into a FileGeodatabase FeatureClass and their datestamp is used for graphically differentiating them. These datestamps change over time, so three days from now, thousands of new datestamps will appear in the database. I want all of these data to be represented by a an arrow whose rotation is defined by a field in the featureclass. I've attached a screenshot, showing the conversion which I need to perform in terms of symbology. Could someone please tell me if this task is possible through Python and if so, how would I do it? Thanks a million! I'm the guilty one, that was my presentation and my quote. Now I want to give it some context and ask a couple of questions... Help me understand, in a real mapping scenario, why do you need to dynamically change these symbol properties?... I'm not trying to argue here, I'm looking for well documented scenarios to help us continue expanding the capabilities of arcpy.mapping where absolutely needed for map automation tasks. At 10.1, we added quite a few new capabilities including some symbology classes that are needed to support map automation: GraduatedColorSymbology, GraduatedSymbolsSymbology, etc. Thanks for your help, Jeff
... View more
12-03-2012
07:31 AM
|
0
|
0
|
1383
|
POST
|
As it turns out, the script works great. I had to copy GpMetadataFunctions.dll and MetadataTranslator.dll to the Global Assembly Cache (GAC) directory. If you have this problem, you may need to open up a command-line windows as Administrator and copy the files that way.
... View more
10-12-2012
09:10 AM
|
1
|
0
|
839
|
POST
|
I'm trying to write a script for updating the metadata in a geodatabase by importing XML files. What the script does is to loop through a geodatabase and collect the names of every feature class. Then, it looks for an XML file whose name is equal to the name of the feature class + ".xml". Unfortnately, I'm getting the following error and I don't know what it means "Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly GpMetadataFunctions". The XML file is in the same directory that houses the GDB and the python script. My script and the full error are as follows. Any help would be tremendously appreciated.
import arcgisscripting, arcpy, os, sys
from arcpy import env
from arcpy import mapping
gp = arcgisscripting.create(9.3)
# Set the current workspace by passing the name of the geodatabase
# for example: python ImportMetadata2.py HomeViewGeoPlatfrom.gdb
gdb = sys.argv[1]
folder = gdb
env.workspace = folder
# The following file will serve as a list of what we've done and will provide links for pasting into the config file
LogFile = open(folder.replace('.gdb','')+'LogFile.csv', 'w')
LogFile.write("FeatureClass,XMLFileNameGuess,Results" + "\n")
def listFcsInGDB(gdb):
''' list all Feature Classes in a geodatabase, including inside Feature Datasets '''
gp.workspace = gdb
print 'Processing ', gp.workspace
# create an array that contains the names of all of the FeatureClasses in the geodatabase
# this info will be used for making a list of XML files with similar names
fcs = []
for fds in gp.ListDatasets('','feature') + ['']:
for fc in gp.ListFeatureClasses('','',fds):
# If you want to include the name of the FeatureDataset in the XML file name, use this line
# fcs.append(os.path.join(fds, fc))
# The following line does not include the FeatureDataset name in the XML file name
fcs.append(os.path.join(fc))
return fcs
fcs = listFcsInGDB(gdb)
for fc in fcs:
print fc
# the field name, type, and length.
layer = fc
# Phase to add in between Popup and Layer Name.xml
LookForThisXMLFile = layer.replace("\\","_") + ".xml"
try:
arcpy.MetadataImporter_conversion (LookForThisXMLFile,fc)
LogFile.write(layer + "," + LookForThisXMLFile + "," + "Success" + "\n")
except Exception, e:
LogFile.write(layer + "," + LookForThisXMLFile + "," + e + "\n")
continue
LogFile.close()
C:\Data\GISData\>python ImportMetadata2.py Test.gdb
Processing Test.gdb
CD_112th
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'GpMetadataFunctions, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8f
c3cc631e44ad86' or one of its dependencies. The system cannot find the file specified.
File name: 'GpMetadataFunctions, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boo
lean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence as
semblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at GetManagedType(Char* _assembly, Char* _path, Char* _className)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
... View more
10-11-2012
03:45 PM
|
0
|
3
|
5055
|
POST
|
I tried running pyversioncheck.py from the following location: C:\Python27\ArcGIS10.1 I got the following output: --- TEST VERBOSE=1 --- Testing existing and identical version file VersionTestPackage: No correctly formatted current version file found --- Testing existing package with new version VersionTestPackage: No correctly formatted current version file found --- Testing package with non-existing version file VersionTestPackage: No correctly formatted current version file found --- Test package with 2 locations, first non-existing second ok VersionTestPackage: No correctly formatted current version file found --- TEST VERBOSE=2 --- Testing existing and identical version file VersionTestPackage: Checking http://www.cwi.nl/~jack/versiontestdir/Version10.txt No "Current-Version:" header in URL or URL not found --- Testing existing package with new version VersionTestPackage: Checking http://www.cwi.nl/~jack/versiontestdir/Version11.txt No "Current-Version:" header in URL or URL not found --- Testing package with non-existing version file VersionTestPackage: Checking http://www.cwi.nl/~jack/versiontestdir/nonexistent.txt No "Current-Version:" header in URL or URL not found --- Test package with 2 locations, first non-existing second ok VersionTestPackage: Checking http://www.cwi.nl/~jack/versiontestdir/nonexistent.txt No "Current-Version:" header in URL or URL not found Checking http://www.cwi.nl/~jack/versiontestdir/Version10.txt No "Current-Version:" header in URL or URL not found Not sure what to make of that....
... View more
08-24-2012
03:02 PM
|
0
|
0
|
324
|
POST
|
Thank you very much for your reply. The thing is, I can't run all my python scripts from the python27 directory. I need to be able to run them from anywhere on the computer. It seems like I must need to update a registry setting or something? I need windows to understand that Python27 is the new and only way to go. I went into Control Panel (Windows Server 2008) but did not see python listed in the Add/Remove programs area. Any other ideas? Thanks a lot in advance!
... View more
08-24-2012
02:54 PM
|
0
|
0
|
324
|
POST
|
My server was updated to ArcGIS 10.1 last week and now I'm unable to run python code from the command line. The error I get is: The program can't start because python26.dll is missing from your computer. Try reinstalling hte program to fix the problem. If I double-click on the C:\Python27\ArcGIS10.1\python27.exe executable, it will successfully open the command line interface. The C:\Python26\ArcGIS10.0\python26.exe throws the above error. All I need to do is to be able to run python scripts from the Windows command line, for example: c:\FolderName\python ScriptName.py Anyone know what I need to do?
... View more
08-24-2012
02:10 PM
|
0
|
5
|
2319
|
POST
|
Thank you, Christopher. Unfortunatley, I'm not working with the same data types. I need to go into a FeatureClass from either a geodatabase table or a layer (.lyr) file.
... View more
07-27-2012
08:57 AM
|
0
|
0
|
743
|
Title | Kudos | Posted |
---|---|---|
1 | 10-12-2012 09:10 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|