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
|
339
|
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
|
698
|
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
|
698
|
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
|
698
|
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
|
698
|
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
|
277
|
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
|
698
|
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
|
191
|
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
|
931
|
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
|
931
|
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
|
1050
|
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
|
1200
|
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
|
1200
|
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
|
1050
|
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
|
541
|
Title | Kudos | Posted |
---|---|---|
3 | Thursday | |
2 | Thursday | |
1 | 2 weeks ago | |
2 | Thursday | |
1 | 07-26-2024 04:14 AM |
Online Status |
Online
|
Date Last Visited |
4 hours ago
|