|
POST
|
Log onto the geodatabase as the feature dataset owner. Then right-click on the feature dataset > Delete.
... View more
05-11-2011
05:08 AM
|
0
|
0
|
1428
|
|
POST
|
In SQL Server Management Studio, open the 'sde.GDB_ITEMS' table. Under the 'Name' column see if you see the Feature Datasets listed there. It will be in the format "<database name>.<owner name>.<Feature Dataset name>". If they exist here, they will exist when viewing the database in ArcCatalog.
... View more
05-11-2011
04:54 AM
|
0
|
0
|
1428
|
|
POST
|
You can publish a File Geodatabase for Query and Extract Data capabilities. For example, if you wanted users to be able to download a local copy of feature classes within your File Geodatabase you can perform the following steps: 1. Add the feature classes from the FGD to a map document 2. Save the MXD 3. Publish the MXD to ArcGIS Server enabling the 'Geodata Access' capability The client can then add the published map service to ArcMap. When the user enables the 'Distributed Geodatabase' toolbar the 'Extract Data' tool will be enabled. They can use this to make a local copy of the feature classes within the map service. Here is more information on Geodata Services.
... View more
05-11-2011
04:47 AM
|
0
|
0
|
506
|
|
POST
|
Could you explain how these feature datasets were tied to other geodatabases? Did they participate in a replication? What is the error you receive when you try to delete the feature datasets?
... View more
05-11-2011
04:04 AM
|
0
|
0
|
1428
|
|
POST
|
Is your master feature class stored in an ArcSDE geodatabase? If it is I would recommend replication. You can replicate subsets of the feature class to other SDE, Personal, or File Geodatabases. Then after making changes to the master feature class you can synchronize changes to the child geodatabases.
... View more
05-11-2011
03:18 AM
|
0
|
0
|
410
|
|
POST
|
Jake, 1. while y < 7: === this loop creates a shp file with the extents of each dataframe? I guess I can use the same loop to also add in the scale and name of the dataframe into the shp file? 2. for fc in lstFCs: ==== take all the "polygon_extent_*.shp" files and merge them into extents.shp? 3. for item in list: ==== delete the "polygon_extent_*.shp"? The script is intended to create feature classes within the Extents.gdb, which you will need to create before running the script. This is why you were receiving errors referencing shapefiles. I believe since the file geodatabase did not exist, the script attempted to create a shapefile. The 'env.workspace' is set to the Extents.gdb, so all output should be written here. 1. The while loop with iterate through each mxd starting with the first dataframe , where x = 0. X will then increase by 1 and iterate through each mxd with the next dataframe[1]. If the dataframe does not exist, for example the mxd does not contain dataframe[4], the script will execute the 'except' and pass the index error. Yes, you could use the same loop to add the scale and dataframe name to the feature class, but this will take some more coding. 2. This will take all 'polygon_extent' feature classes and merge them into one feature class. 3. After the 'polygon_extent' feature classes are merged into one, it will delete the individual 'polygon_extent' feature classes. Hope this helps!
... View more
05-11-2011
02:44 AM
|
0
|
0
|
1742
|
|
POST
|
Thanks for sending your code and MXDs. I didn't take into consideration that you had multiple dataframes within your MXDs. I've updated the code to work with this. There were a few small syntax errors within the code you sent. For example: env.workspace = path + 'extents.gdb' There is a '\' missing. Should be: env.workspace = path + '\extents.gdb' Another error: for mxd in mxdList:
mxd = mapping.MapDocument(mxd)
print mxd # Printing status for error checking
dataframe = mapping.ListDataFrames(mxd2, "*")[0] Need to change the second 'mxd' to 'mxd2': for mxd in mxdList:
mxd2 = mapping.MapDocument(mxd)
print mxd # Printing status for error checking
dataframe = mapping.ListDataFrames(mxd2, "*")[0] I also removed the 'Tempfile' from the code. This isn't really needed, but the code may still work with it added (did not test though). Below is the updated code. This code will also iterate through all dataframes in each MXD: import arcpy, glob, os
from arcpy import env
from arcpy import mapping
env.overwriteOutput = True
path = os.getcwd() # Script in same directory as files being processed
mxdList = glob.glob(path + "\*.mxd")
env.workspace = path + '\extents.gdb' # Directory as files being processed
print env.workspace
x = 0
y = 1
z = 1
while y < 7:
for mxd in mxdList:
mxd2 = mapping.MapDocument(mxd)
try:
dataframe = mapping.ListDataFrames(mxd2, "*")
frameExtent = dataframe.extent
XMAX = frameExtent.XMax
XMIN = frameExtent.XMin
YMAX = frameExtent.YMax
YMIN = frameExtent.YMin
pnt1 = arcpy.Point(XMIN, YMIN)
pnt2 = arcpy.Point(XMIN, YMAX)
pnt3 = arcpy.Point(XMAX, YMAX)
pnt4 = arcpy.Point(XMAX, YMIN)
array = arcpy.Array()
array.add(pnt1)
array.add(pnt2)
array.add(pnt3)
array.add(pnt4)
array.add(pnt1)
polygon = arcpy.Polygon(array)
arcpy.CopyFeatures_management(polygon, "Polygon_Extent" + "_" + str(z))
z = z + 1
except IndexError:
pass
x = x + 1
y = y + 1
list = []
lstFCs = arcpy.ListFeatureClasses("Polygon_Extent*")
for fc in lstFCs:
list.append(fc)
arcpy.Merge_management(list, "Extent")
for item in list:
arcpy.Delete_management(item)
For "while > 7:", the number can be any value that is larger than the max amount of dataframes in any individual MXD. For example, if you had an MXD that has 10 dataframes you should increase this number to 10 (dataframe indexing begins at 0).
... View more
05-10-2011
08:29 AM
|
0
|
0
|
1742
|
|
POST
|
To set the environment workspace, you will use arcpy.env.workspace. Ex: arcpy.env.workspace = r"C:\data\Philadelphia.gdb" It will still help to post all of your code. I can check to see if there are any errors with the changes you made.
... View more
05-09-2011
02:22 AM
|
0
|
0
|
1967
|
|
POST
|
Here is some sample code if interested: list = []
# Specify feature class whose features you want to rotate
# Append to list to find the Max OBJECTID/FID
lstFCs = arcpy.ListFeatureClasses("Parcels")
for fc in lstFCs:
rows = arcpy.SearchCursor(fc)
for row in rows:
list.append(row.OBJECTID)
del row, rows
maxOID = list[-1]
x = 1
y = 1
# Loop through each feature, convert to a feature layer, then to raster, rotate raster, convert back to polygon feature class
while y <= maxOID:
for fc in lstFCs:
feat_lay = arcpy.MakeFeatureLayer_management(fc, fc + str(x), "OBJECTID = " + str(x))
ras_lay = arcpy.PolygonToRaster_conversion(feat_lay, "OBJECTID", fc + str(x) + "_ras") # Can improve processing time by specifying a larger cell size
feat_lay2 = arcpy.Rotate_management(ras_lay, "ras_rotate" + str(x), 45)
arcpy.RasterToPolygon_conversion(feat_lay2, fc + "_rotate_" + str(x))
y = y + 1
x = x + 1
# Print extent of rotated feature classes
lstFCs2 = arcpy.ListFeatureClasses("*rotate*")
for fc2 in lstFCs2:
rows2 = arcpy.SearchCursor(fc2)
for row2 in rows2:
geom = row2.Shape
Extent = geom.extent
print Extent
del row2, rows2
# Deleted rasters
lstRasters = arcpy.ListRasters("*ras*")
for raster in lstRasters:
arcpy.Delete_management(raster)
... View more
05-06-2011
12:22 PM
|
0
|
0
|
2231
|
|
POST
|
There is a Rotate GP tool, but this is only for raster datasets. You could create a script to convert the features to a raster dataset (Polygon to Raster), rotate the raster datasets (Rotate), then convert the rasters back to a feature class (Raster to Polygon). You will then be able to retrieve the new extent of the rotated feature.
... View more
05-06-2011
05:08 AM
|
0
|
0
|
2231
|
|
POST
|
Do you have your env.workspace set to a File Geodatabase? Can you post the entire code you are using?
... View more
05-06-2011
02:48 AM
|
0
|
0
|
1967
|
|
POST
|
You can also add 'arcpy.env.overwriteOutput = True' at the start of your code. This will overwrite the feature layer.
... View more
05-05-2011
08:22 AM
|
0
|
0
|
1061
|
|
POST
|
Here is some sample code that I was able to get working. You will need to create an array and add the XMAX, XMIN, etc to the array to create the polygon feature. Then you can create a feature class/shapefile from this array. I had trouble getting the Append tool to work with the array feature so I created a feature class for each extent, merged them together, and then deleted the original extent feature classes. import arcpy, glob, os
from arcpy import env
from arcpy import mapping
env.overwriteOutput = True
path = r"C:\temp"
mxdList = glob.glob(path + "\*.mxd")
env.workspace = r"C:\temp\Test.gdb"
y = 1
for mxd in mxdList:
mxd2 = mapping.MapDocument(mxd)
dataframe = mapping.ListDataFrames(mxd2, "*")[0]
frameExtent = dataframe.extent
XMAX = frameExtent.XMax
XMIN = frameExtent.XMin
YMAX = frameExtent.YMax
YMIN = frameExtent.YMin
pnt1 = arcpy.Point(XMIN, YMIN)
pnt2 = arcpy.Point(XMIN, YMAX)
pnt3 = arcpy.Point(XMAX, YMAX)
pnt4 = arcpy.Point(XMAX, YMIN)
array = arcpy.Array()
array.add(pnt1)
array.add(pnt2)
array.add(pnt3)
array.add(pnt4)
array.add(pnt1)
polygon = arcpy.Polygon(array)
arcpy.CopyFeatures_management(polygon, "Polygon_Extent" + "_" + str(y))
y = y + 1
list = []
lstFCs = arcpy.ListFeatureClasses("Polygon_Extent*")
for fc in lstFCs:
list.append(fc)
arcpy.Merge_management(list, "Extent")
for item in list:
arcpy.Delete_management(item)
... View more
05-05-2011
07:10 AM
|
0
|
0
|
1967
|
|
POST
|
You can register a feature class via command line using the 'sdetable -o alter_reg' command with the '-V MULTI' option. Ex:
sdetable -o alter_reg -t building -V MULTI -i sde:sqlserver:esri -D vector -u vector -p **** You could also register a feature class as versioned using python. Ex: import arcpy
from arcpy import env
env.workspace = r"Database Connections\SQL.sde"
fc = "Parcels"
arcpy.RegisterAsVersioned_management(fc)
... View more
05-04-2011
11:20 AM
|
0
|
0
|
1001
|
|
POST
|
Here is an example on how you can sum the Area field into a new field (SUM_Area). From there you can calculate the percentage. list = []
lstRasters = arcpy.ListRasters("*")
for raster in lstRasters:
rows = arcpy.SearchCursor(raster)
for row in rows:
list.append(row.Area)
S = sum(list)
arcpy.CalculateField_management(raster, "SUM_Area", S)
list = []
del row, rows
... View more
05-04-2011
04:40 AM
|
0
|
0
|
782
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 12-01-2025 05:58 AM | |
| 1 | 11-21-2025 03:55 AM | |
| 1 | 11-14-2025 09:01 AM | |
| 1 | 11-13-2025 12:28 PM |
| Online Status |
Online
|
| Date Last Visited |
2 hours ago
|