|
POST
|
I would double-check to make sure who the owner of the domain is. Take a look at the following link for the correct query: http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_java_help/index.html#//0092000013v7000000.htm Note: The SQL Server query is for a repository owned by the DBO schema. If your schema is owned by SDE, you will need to update the dbo owner to sde. Ex: --SQL Server
SELECT items.Name AS "Domain Name",
items.Definition.value('(/*/Owner)[1]','nvarchar(max)') AS "Owner"
FROM sde.GDB_ITEMS AS items INNER JOIN sde.GDB_ITEMTYPES AS itemtypes
ON items.Type = itemtypes.UUID
WHERE itemtypes.Name IN ('Coded Value Domain', 'Range Domain')
... View more
08-08-2011
06:03 AM
|
0
|
0
|
2414
|
|
POST
|
A mosaic dataset would be the best option. You may not see the mosaic dataset at smaller scales because Overviews are not built. To build overviews right-click on the mosaic dataset in ArcCatalog > Build Overviews.
... View more
08-04-2011
04:52 AM
|
0
|
0
|
307
|
|
POST
|
Do you have a stretch applied to the raster? If the stretch is set to 'Standard Deviations', try changing it to 'None' and see if this helps. You can change this in the Properties > Symbology tab, or use the new Image Analysis windows for ArcGIS 10.
... View more
08-04-2011
04:48 AM
|
0
|
0
|
441
|
|
POST
|
I believe the problem is with the Search cursor. You have: sCur = arcpy.SearchCursor("test.shp", "","","ID_1") When specifying "ID_1" you are limiting the search cursor to this specific field, but you are trying to query the "Shape" field's extent. I would recommend keeping this parameter empty, or including the ''Shape'' field. Ex: sCur = arcpy.SearchCursor("test.shp", "","","ID_1; Shape") or sCur = arcpy.SearchCursor("test.shp")
... View more
08-04-2011
03:43 AM
|
0
|
0
|
879
|
|
POST
|
Your code will work with no problems. You can also use the 'arcpy.ListFields' function. Ex: lstFields = arcpy.ListFields(fc)
x = False
for field in lstFields:
if field.name == "USNG":
print "Field exists"
x = True
if x <> True:
print "Field does not exist" I tested the Describe function vs the ListFields function using the time module, and the ListFields function was slightly faster by a tenth of a second. Also, to preserve indentation when copying/pasting your code, select your code and click the '#' button at the top. It will wrap it in CODE tags.
... View more
08-03-2011
01:08 PM
|
2
|
0
|
16557
|
|
POST
|
I could not find a way to access an ArcScene document (.sxd) using python either. The best approach I found was to copy your group layer to ArcMap by right-clicking on the group layer in ArcScene > Copy > right-click on ArcMap's data frame > Paste Layer(s). Next save the map document. Once you have the saved MXD you can run python on the group layer to sort the layer alphabetically. After the group layer is sorted in ArcMap, you can copy/paste the group layer back into the SXD. Here is an example how to sort the Group Layer: import arcpy
from arcpy import env
from arcpy import mapping
env.overwriteOutput = True
env.workspace = r"C:\temp\python"
folder = env.workspace
mxd = mapping.MapDocument(r"C:\temp\python\Scene.mxd")
list = []
for df in mapping.ListDataFrames(mxd, "*"):
for lyr in mapping.ListLayers(mxd, "*", df):
# Find layers within Group Layer
if "\\" in lyr.longName:
lyrName = str(lyr.name) + ".lyr"
list.append(lyrName)
# Save layers to .lyr files
arcpy.SaveToLayerFile_management(lyr, lyrName)
# Remove layers from Group Layer
mapping.RemoveLayer(df, lyr)
print "Successfully created layer files and removed layers"
# Order layer files in alphabetical order
list.sort(key=lambda x: x.lower())
# Add layer files to Group Layer in alphabetical order
for df in mapping.ListDataFrames(mxd, "*"):
for n in list:
for lyr in mapping.ListLayers(mxd, "3D", df):
targetGroupLayer = lyr
addLayer = mapping.Layer(folder + "\\" + n)
mapping.AddLayerToGroup(df, targetGroupLayer, addLayer, "BOTTOM")
print "Successfully reorderd Group Layer"
# Delete lyr files
lstFiles = arcpy.ListFiles("*.lyr")
for file in lstFiles:
arcpy.Delete_management(file)
print "Sucessfully deleted layer files"
mxd.save()
del mxd
... View more
08-03-2011
08:13 AM
|
0
|
0
|
650
|
|
POST
|
Sounds like the problem is just with this specific MXD, so I don't think reverting back to 9.3.1 will help. There are a couple other things you can try: 1. Save the MXD to a new MXD (you can even try an earlier version of ArcGIS by using 'Save A Copy') 2. Run the 'ArcGIS Document Defragmenter' on the MXD 3. Run the 'MXD Doctor' on the MXD Both of the utilities mentioned in 2 and 3 are located at Start > Programs > ArcGIS > Desktop Tools.
... View more
08-03-2011
04:59 AM
|
0
|
0
|
784
|
|
POST
|
Have you considered using a mosaic dataset? This is essentially a raster dataset and raster catalog hybrid. It renders much faster due to the mosaic datasets overviews. This is the recommended approach when dealing with a large collection of rasters. Here is another helpful link and a video on mosaic datasets.
... View more
08-02-2011
03:10 AM
|
0
|
0
|
650
|
|
POST
|
Glad to see you got this working! The lock will only remain while the feature class is being updated. Once the points have been moved, the lock is released. A lock will be placed on the feature class using the 'arcpy.Snap_Edit' funciton as well, the difference being is that it is automatically released afterwards. Below is the code that I was able to get working: mxd = arcpy.mapping.MapDocument("CURRENT")
rows = arcpy.UpdateCursor("Points")
for row in rows:
POINTNO = row.getValue("Line_ID")
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name in "AllLines":
lyr.definitionQuery = "\"LINENO\" = " + str(POINTNO)
arcpy.RefreshActiveView()
if lyr.name in "Points":
lyr.definitionQuery = "\"POINTNO\" = " + str(POINTNO)
arcpy.RefreshActiveView()
snapEnv = ["AllLines", "EDGE", "5"]
arcpy.Snap_edit("Points", [snapEnv])
print "Snapped point successfully"
del row, rows, mxd Also, as a hint, after copying/pasting your code you can select it and click the '#' symbol to wrap CODE tags around it. This will preserve the indentation of your script.
... View more
08-02-2011
03:01 AM
|
0
|
0
|
707
|
|
POST
|
Using the Update, Search, or Insert cursor function will place a lock on the feature class. You will need to delete the 'row' and 'rows' variables. You can do this by running 'del row, rows' at the end of your code. Also, I noticed an error within your code. You will need to change AllLines to "AllLines" within your snapEnv variable. Ex: import arcpy
rows = arcpy.UpdateCursor("Points")
mxd = arcpy.mapping.MapDocument("CURRENT")
print mxd.filePath
for row in rows:
LINENO = row.getValue("Line_ID")
print "LINENO " + str(LINENO)
for lyr in arcpy.mapping.ListLayers(mxd):
print "lyr.name " + lyr.name
lyrname = lyr.name
if lyr.name in ["AllLines"]:
print "LINENUMBER = '" + str(LINENO) + "'"
lyr.definitionQuery = "LINENUMBER = '" + str(LINENO) + "'"
snapEnv = ["AllLines", "EDGE", "2 Meters"]
arcpy.Snap_edit("Points", [snapEnv])
del row, rows, mxd
... View more
08-01-2011
05:07 AM
|
0
|
0
|
707
|
|
POST
|
Here is an example: import arcpy
from arcpy import env
from arcpy import mapping
env.workspace = r"C:\temp\python"
mxd = mapping.MapDocument(r"C:\temp\python\Airports.mxd")
for df in mapping.ListDataFrames(mxd, "*"):
lyr = mapping.Layer(r"C:\temp\python\Airports.lyr")
addLayer = mapping.AddLayer(df, lyr)
mxd.save()
del mxd
... View more
07-29-2011
12:23 PM
|
0
|
0
|
934
|
|
POST
|
You will just need to specify the path to mxd rather than "CURRENT": mxd = arcpy.mapping.MapDocument(r"C:\data\Philadelphia.mxd") After your code, be sure to save your mxd with: mxd.save()
... View more
07-29-2011
11:52 AM
|
0
|
0
|
934
|
|
POST
|
If a user is accessing a version there should be a state lock. You can query the version table for the version that is locked: SQL> select state_id from sde.versions where name = 'Child_Version'
1864 Then you can query the state locks table to get to the sde_id of the user: SQL> select sde_id from sde.state_locks where state_id = '1864'
4371 Next, you can query the process information table to get the user's name: SQL> select owner from sde.process_information where sde_id = '4371'
VECTOR You can request this user to disconnect, or you can use the 'sdemon -o kill' command to kill this specific user: C:\> sdemon -o kill -t 4371 -i sde:oracle11g
... View more
07-29-2011
09:57 AM
|
0
|
0
|
2138
|
|
POST
|
What error messages are you receiving? You can add the try...except block to you code to retrieve the error messages. Ex: try:
arcpy.DeleteRows_management(GIS_NMBCC)
except arcpy.ExecuteError:
print arcpy.GetMessages()
... View more
07-29-2011
08:51 AM
|
0
|
0
|
665
|
|
POST
|
Let's try recreating the MXD. Open the corrupted MXD and select all the layers within the Table of Contents > right-click on one of the selected layers > Copy. Next, start a new MXD and right-click on the data frame > Paste Layers. Save this MXD with a new name and try exporting to a PDF using your script. Do you still receive the same error?
... View more
07-29-2011
02:51 AM
|
0
|
0
|
2226
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 11-21-2025 03:55 AM | |
| 1 | 11-14-2025 09:01 AM | |
| 1 | 11-13-2025 12:28 PM | |
| 1 | 11-07-2025 01:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|