|
POST
|
If an arc exists, it's centroid and true centroid will be different values. Therefore you can search each feature class to see if any centroids do not match the true centroids. Ex: lstFCs = arcpy.ListFeatureClasses("*", "Polyline")
for fc in lstFCs:
rows = arcpy.SearchCursor(fc)
print fc
for row in rows:
type = row.Shape
geom = str(type.centroid.X)
truegeom = str(type.trueCentroid.X)
if geom != truegeom:
print row.ObjectID
del row, rows This will print the feature class and the OBJECTID of any arcs within that feature class.
... View more
06-03-2011
08:50 AM
|
0
|
0
|
1263
|
|
POST
|
I would try using the commands outside of the Raster Calculator. Ex: import arcpy
from arcpy import sa
from arcpy.sa import *
arcpy.CheckOutExtension("spatial")
forest = r"c:\test.gdb\forest"
forest_slope = arcpy.sa.Slope(forest, "DEGREE", "1")
sin = arcpy.sa.Sin(forest_slope)
divide = arcpy.sa.Divide(sin, 57.2958)
multiply = arcpy.sa.Times(divide, 200)
multiply.save(r"c:\test.gdb\forest_slope_cost")
... View more
06-01-2011
08:55 AM
|
0
|
0
|
2510
|
|
POST
|
I am using Flex 2.2 and I'm having an issue where a feature service in the web application will not update after a delete or attribute change has occurred. If a feature is added, the feature service will update correctly in the web application. For example, I open a flex app with a feature service. I have the same feature service being consumed on my mobile device using ArcGIS Mobile. I'll collect a feature using ArcGIS Mobile and then post the edit back to database. Next I pan/zoom around the flex app and the feature service updates dynamically and I can see the feature. However, if I delete a feature or update attributes of an existing feature using ArcGIS Mobile, post changes back to database, and then pan/zoom around the changes are not reflected. I have to refresh the entire flex app. After doing so the changes are reflected. The same happens no matter which client I'm using to update the service. For example if I make a delete/update to the feature class in ArcMap I have to refresh the flex app. I tried setting 'mode' equal to 'onDemand' in the config file, but this did not make a difference. Has anyone experienced this? Thanks!
... View more
05-20-2011
12:10 PM
|
0
|
2
|
814
|
|
POST
|
What user are you connecting to the database as? Is this user an administrator on the SQL Server machine? I was able to reproduce this behavior. I logged onto my machine as "Joe", created a connection SDE and created a feature called "Vector.Joe.Parcels". I then logged off of my machine and logged back on as an administrator. When I connect to SDE I can see the feature class, "Vector.Joe.Parcels" because I am an administrator. When I attempt to run my script I receive the error that the feature class does not exist. The reason being is that it is now using my current windows user, the administrator, and is therefore looking for "Vector.DBO.Parcels". Unless you are connected to the database as the feature class owner, you will need to specify the full feature class name.
... View more
05-13-2011
11:09 AM
|
0
|
0
|
773
|
|
POST
|
You can specify a query with the arcpy.UpdateCursor. The update will only update records that are returned from this query. Ex:
fc = "parcels"
rows = arcpy.UpdateCursor(fc, "Area1 = 10")
for row in rows:
row.Area2 = 200
rows.updateRow(row)
... View more
05-13-2011
03:37 AM
|
0
|
0
|
743
|
|
POST
|
1. Did you re-synch all the database authenticated logins after restoring the database onto the new machine: http://resources.arcgis.com/content/kbase?fa=articleShow&d=29672 2. Did you restore to a different version of SQL Server (ie 2005 to 2008)? If so, check to make sure the compatibility level updated: http://resources.arcgis.com/content/kbase?fa=articleShow&d=32979
... View more
05-12-2011
12:22 PM
|
0
|
0
|
773
|
|
POST
|
The 'mxd' variable will place a lock on the MXD. Without deleting this variable, the lock will remain. For example, you run a python script that makes some change to an MXD and you don't delete the 'mxd' variable. Then you open this MXD in ArcMap, make another change and then try saving. You will receive an error that it is in use.
... View more
05-12-2011
12:16 PM
|
2
|
0
|
1715
|
|
POST
|
What RDBMS are you using (i.e. Oracle, SQL Server, PostgreSQL....)?
... View more
05-12-2011
05:58 AM
|
0
|
0
|
415
|
|
POST
|
I have added to the code to capture the extent ID (it can fill in filename as 'mxd' and not sure how to capture scale) but it is giving errors in identifying the x'th entry in to the list -it prints just the x'th character. Also it's not clear where to put a print statment to give feedback that the program is working on the 2,3,4th etc mxd file. You will need to append the extent ID to a list. Ex: for el in arcpy.mapping.ListLayoutElements(mxd2, "DATAFRAME_ELEMENT"):
ExtentIDStore = str(el.name)
list2.append(ExtentIDStore) Then you can use print statement for the list: print list2[0] I also notice that it loops first through the mxd's creating extent 1, then loops through creating extent 2 etc. I was initially thinking that it opened the first mxd, cycled through and created all the extent polygons and then opened the next mxd and created the extents. You can code it to do it this way, but the end result will be the same. Also it's not clear where to put a print statement to give feedback that the program is working on the 2,3,4th etc mxd file. You can execute a print statement at the beginning of the first 'for' loop:
for mxd in mxdList:
mxd2 = mapping.MapDocument(mxd)
print mxd However, the same MXD name will be printed multiple times since the code loops through each MXD multiple times.
... View more
05-12-2011
04:45 AM
|
0
|
0
|
1580
|
|
POST
|
It appears that the feature datasets were not empty. Deleting table entries within SQL Server Management Studio is a last resort. When it comes to feature classes, there are a slew of other table entries/tables that need to be deleted as well. Attempting to delete other table entries can seriously corrupt your database. I would recommend restoring your database backup and contacting tech support. They will be able to determine why the feature datasets are still existing even though the database has been deleted. Also, I would recommend using a single geodatabase model in the future. I find they are much easier to maintain.
... View more
05-11-2011
10:47 AM
|
0
|
0
|
600
|
|
POST
|
You can do this using the UpdateCursor. Ex: table = "XY"
rows = arcpy.UpdateCursor(table)
for row in rows:
if row.field1 > row.field2:
row.Num = row.field1
elif row.field1 < row.field2:
row.Num = row.field2
rows.updateRow(row) del row, rows
... View more
05-11-2011
08:29 AM
|
0
|
0
|
685
|
|
POST
|
You can delete the empty feature datasets within SQL Server Management Studio. Before doing so be sure to make a database backup of your SDE geodatabase. After the backup is created you can run the following query: use SDE delete from sde.GDB_ITEMS where Name = 'TroutCreek.DBO.Model'
... View more
05-11-2011
08:03 AM
|
0
|
0
|
600
|
|
POST
|
Try creating a new feature class called test. Does it appear as: TroutCreek.DBO.Test
... View more
05-11-2011
06:22 AM
|
0
|
0
|
1280
|
|
POST
|
This is most likely because you are not connected to the database as the feature dataset owner. Look at the feature dataset name. It will be in the following format <database name>.<owner>.<feature class name>. Ex: Planning.Vector.Parcels In the above example, Vector is the owner. Next, I would check to make sure I'm connected to the database as Vector by right-clicking on the database > Connection Properties. If 'Vector' is not listed under 'username' I would change this and specify 'vector' for the username and it's corresponding password.
... View more
05-11-2011
05:42 AM
|
0
|
0
|
1280
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | 11-07-2025 01:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|