|
POST
|
Yes these property's are not listed in the 10.0 class documentation: ArcGIS Desktop But are present in the 10.1 ArcGIS Help 10.1 So its a version issue. I feel your pain on a remote secure system and Imageine upgrading will not be easy, so best of luck I think you will have to use ArcObjects or VBA to get access to these in this version which is a lot more complex! Hopefully someone can correct me here, but I dont think so...
... View more
06-09-2015
09:59 AM
|
1
|
1
|
2862
|
|
POST
|
Hi, I can confirm that Arcs Python Script window autocomplete options do include both 'symbology' and 'symbologyType' as of version 10.1. (Possibly SP1) Therefore either your doing something wrong to not get these, or you are using an older version of ArcMAP. (10.0 I guess?). These properties are new to the 10.1 line of Arc as far as I can tell. I dont think it is caused by security, as the autocomplete would still function,
... View more
06-09-2015
09:49 AM
|
0
|
3
|
2862
|
|
POST
|
1) He means copy the layer (is it small, if not just grab 1 or 2 features) onto your local machine. (That is not hot on security), also save the mxd file here. Is the issue still present in this instance? The code above looks fine and is referring to a local document as you say, however if security is causing an issue doing this should avoid that. 2) Python is very Case Sensitive, in the help files these are referred to as shown, have you tried referring to them in this case instead of capital letters? definitionQuery symbologyType symbology
... View more
06-09-2015
07:59 AM
|
0
|
5
|
2862
|
|
POST
|
Here's some half written code that would work if you sort out the names of the files etc. import arcpy
from arcpy import env
def process (folder):
env.workspace = folder
for file in arcpy.listFeatureclasses (folder):
arcpy.clip (file, study area, output)
#If there were no features in the study area
if arcpy.getcount (output) == 0:
arcpy.delete(output)
workspaces = arcpy.listWorkspaces()
for workspace in workspaces:
process(workspace )
inputfolder = r'C:\where\is\the\data'
process(inputfolder)
... View more
06-02-2015
09:13 AM
|
1
|
0
|
1322
|
|
POST
|
I would try one of these: #1 - Use different types of quote. (EG Outer double quotes, inner single quote)
print "Hello there I'm Luke"
#2 - Use Triple quotes
print '''Hello there I'm Luke'''
#3 - Use ASCI Codes
print "Hello there I" + chr(39) + "m Luke"
... View more
06-02-2015
08:57 AM
|
0
|
0
|
3454
|
|
POST
|
The problem is because when you use "CURRENT", it does the process using the map that you have open already, so the file is not "locked". When you hard code the path, it opens the file again (as well as keeping it open in the CURRENT arcmap session), then crashes as the current session has the file locked. If you hard code the path, close the mxd, and publish it, it will work without error, as long as you dont have the map open when it try to save, as this locks the file. Only one process can access the mxd at once, if you are inside ArcMAP that locks the file, if you use "CURRENT" it uses the locks you have open already, if you hardcode it, it trys to open a new lock. I cant explain it better sorry, hopefully that is ok.
... View more
05-28-2015
09:43 AM
|
1
|
0
|
661
|
|
POST
|
the weird part is because when you add a shapefile to the map, it doesnt add a shapefile to the map, it adds a "link to a shapefile" to the map. As you have added the link to the shapefile into the map already, when you run the script, it overwrites the shapefile so it updates inside the map. The script itself hasn't changed anything to do with this, except update the shapefile itself, which is already in the map as you added it manually. Without the line mxd.save(), any changes that you make to the mxd will not be saved, however the shapefiles in the map which the script has managed to edit, will be updated. When you say you closed everything except one Arc window, is that the window you then ran the script in? Try opening the Python window (Geoprocessing Menu --> Python) Then type: >>> mxd = arcpy.mapping.MapDocument("CURRENT") >>> mxd.save() Does this crash also?
... View more
05-28-2015
06:26 AM
|
0
|
1
|
2005
|
|
POST
|
For the 1st part (and the 2nd but well get to that later), you dont define 'row' anywhere, so I dont know where its getting the variable from! To correct try adding the line 'for row in cursor:' as I have below: import arcpy
import os
from arcpy import env
arcpy.env.workspace = "c:/Win/Sik"
input = "s3s2c10"
fields = ['X', 'Y', 'MOSAIC']
#NEW TXT FILE "MOON"
outFile = open("c:/Win/Sik/moon.text", "w")
with arcpy.da.SearchCursor(input, fields, 'OID = 1') as cursor:
for row in cursor:
X = row[0]
Y = row[1]
IPSOS = row[2]
outFile.write('x is '+str(X)+'meters,'\n' Y is'+str(Y)+'and '\n' ipsos is'+str(IPSOS))
outfile.close()
... View more
05-28-2015
05:45 AM
|
2
|
1
|
2690
|
|
POST
|
The reason I asked is because that error is usually caused by having the same MXD file being read at the same time by 2x processes, for example if you were running the script using one ArcMAP window, and you had the same mxd open in a different ArcMAP window, or computer. Try closing everything except one ArcMAP window and running the script, does the error still occur? From your reply I guess you are using ArcMAP to run the script, not notepad ++.
... View more
05-28-2015
05:24 AM
|
0
|
3
|
2005
|
|
POST
|
Are you able to try storing it inside an SQL Server, according to this help I gather that if so, for any terrain dataset which has pyramids, a table should be made with the name: DTM_<ID>_MRFC The ID is specific to each terrain dataset. Can you see if you have these tables, then you just need to find the table that has the terrain dataset names and IDs in to associate the two. Try the query: select * from GDB_EXTENSIONDATASETS ArcGIS Server for the Microsoft .NET Framework 9.3 Help These tables wont be visible in ArcCatalog, you will have to connect using SQL Server client. You may need to be an admin as they may be owned by SDE not your user. Seperately, this link may also be of use: ESRI File Geodatabase (FileGDB) If you have OGR setup as I do, this command worked to retrieve the features using SQL from my table 'a': ogrinfo -dialect FileGDB -sql "select * from a" "pathto\Geodatabase.gdb"
... View more
05-28-2015
05:06 AM
|
1
|
2
|
1843
|
|
POST
|
Are you trying to save the mxd via web service or an external python editor or similar?, whilst you also have the mxd open in desktop GIS?
... View more
05-27-2015
01:30 PM
|
0
|
5
|
2005
|
|
POST
|
I know nothing about terrain files sorry, but I do know for a jpg, if you add it into ArcMap and build pyramids, it will create a file on the file system disk with a .ovr extension to hold the pyramids. Perhaps you could look and see if this file exists using standard python OS. (It wont show up in any Arcpy listing data as far as I know) E.g: image.jpg image.jpg.ovr
... View more
05-27-2015
08:45 AM
|
1
|
1
|
3075
|
|
POST
|
Glad I helped, I have no idea what was wrong with your code, but it was possibly something like: The feature classes: FC1 FC2 FC3 Ok loop throught these FCs. Check list[0]: FC1 - it has Bad field name, remove from loop. (List now looks like) FC2 FC3 Next loop Item - check list [1] list[1] = FC3 So it skipped FC2. Hopefully that makes sense, although I could be wrong!
... View more
05-26-2015
09:00 AM
|
1
|
1
|
2010
|
|
POST
|
Hows about this code: (Not indented properly) #Create an empty list to store the BAD FCs in BadFCs = [] for f in fclist: desc = arcpy.Describe(sdeConn + os.sep + f) foid = desc.OIDFieldName # If the filed is not the right one if foid != "OBJECTID": BadFCs.append(f) #Print the outputs for f in BadFCs: print (f)
... View more
05-26-2015
08:35 AM
|
1
|
3
|
2010
|
|
POST
|
If you are running the script from ArcMap, then it should work with the edit session, however you are not referencing the "Layer" in the map, just pointing to it on disk, so that particular instance is not in an edit session! In the TOC rename the layer to something like "EditLayer" Then in the code, instead of pointing to the path on disk: fc = r'Database Connections\DEFAULT@Ozark.sde\Ozark.DBO.Storm\Ozark.DBO.BoxCulvert' try: fc = 'EditLayer' If this doesnt work, you will have to use Arcpy.Mapping to point to the mxd, and then find the layer within the MXD. Alternatively, as Neil Ayres has said, start an end the edit session in the code! (Then make sure you are not in an edit session in ArcMAP else the layer may be locked) Hopefully this makes sense and explains what is happening.
... View more
05-26-2015
08:14 AM
|
1
|
1
|
2513
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-29-2019 07:45 AM | |
| 1 | 05-13-2013 07:11 AM | |
| 1 | 05-24-2011 07:53 AM | |
| 1 | 05-22-2017 05:01 AM | |
| 2 | 07-29-2019 05:34 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-22-2024
10:40 AM
|