Hot answers tagged

12

Which part of the script is actually taking up most of the time? There are about 5 other steps going on before you actually start deleting stuff. You might want to break your script down into bite-sized tests. For example, instead of creating a temporary connection file, listing a bunch of datasets, listing their contents, counting their records, and then ...


8

Strings, even when marked as r"Raw strings", cannot end with a slash, it needs to be escaped. Should be: fullPath = WSpace + FDSName + "\\" + FCName Or better yet, use os.path.join: fullPath = os.path.join(WSpace, FDSName, FCName)


7

I've had problems importing features into a feature dataset if there is another feature anywhere else in the geodatabase with the same name, even if it's not in the same dataset. I don't remember the error I got and whether it was apparent to me at the time, but I guess if nothing else is working so far that's one more thing you could check...


6

First answer - No, you can not have duplicate names in a geodatabase. Yes, this is the expected functionality since the Feature-Dataset is only a record reference in a database. Any database will balk at having tables with duplicate names. It sounds like you are trying to use the Feature-Dataset model for organizational purposes versus the true purpose of ...


6

Typical organization methods that I've seen are by prefixing. In an enterprise geodatabase, this can be done with an owner/schema name (e.g. UTIL.WMETER or by prefixing the featureclass/table name itself with a prefix string, then underscore, then name UTIL_WMETER). Prefixing the featureclass/table name also works in personal/file geodatabases. Because of ...


6

If upgrading to ArcGIS 10.1 (now released) is an option then I just found this in the What's New in ArcGIS 10.1 PDF: New tool to delete all rows from a table The TruncateTable geoprocessing tool in the Tables toolset can be used to delete all rows from a table or feature class. You should use the Truncate Table tool instead of the Delete Rows ...


6

You could get a list of the featuredatasets using the ListDatasets function, then loop through that list to get at the featureclasses within each featuredataset. From the docs: datasetList = arcpy.ListDatasets("C*", "Feature") for dataset in datasetList: print dataset


6

Only if you plan to have users easily editing data in the feature-datasets. The biggest kick you will have is record locking; since editing a layer in a feature dataset will close out users from making other changes there.That is probably your biggest functional killer, if that isn't a issue; then yes you can use it to try and make things pretty.


4

From the help on About importing feature classes: Suppose you want to import a feature class that's in another coordinate system. For example, you may want to import a feature class that uses the North American Datum (NAD) 1927 coordinate system into a feature dataset that uses the NAD 1983 coordinate system. To import the feature class, use the Project ...


4

AFAIK there is no feature dataset analog in Postgis. But you can use database schemas for grouping data


4

Yes - you need to use a Python list and process it using a for loop: import arcpy arcpy.CreateFileGDB_management("I:/python/MultipleFD2GDB", "HabitatAnalysis.gdb") fdList = ["EMI_EMF", "Cultural_Resources", "Parcels", "Hazardous_Materials", "Footprint", "Checkpoint_B", "Wetlands", "Botany", "Land_Use", "Buffers", "Air_Quality", "Transportation", ...


3

This is indeed a bug: NIM-070258 - The Extract Values to Points tool creates an output in the geodatabase when a feature dataset is specified as the destination. Found in 10.0 SP2 and solved in 10.2!


3

Have you considered, or is it possible, to save your temporary featureclasses into the "in_memory" workspace? ArcGIS & Modelbuilder will automatically clean up your temporary datasets once the process is complete. Also, you will likely see a dramatic improvement in processing speed with your models. Working with data in memory is tremendously faster ...


3

Why not just delete the feature datasets themselves with arcpy.DeleteFeatures_management(dataset)? If you still need the feature dataset to exist, you could simply recreate it after it's been deleted.


3

Although some people use feature datasets as "geodatabase folders" they are not intended for that purpose and quite poor at it. For example, feature datasets cannot contain tables, cannot contain feature classes with different coordinate systems, and only one level of "geodatabase sub-folder" is possible. The GIS Dictionary definition of a geodatabase ...


2

Grouping, in absolute terms, is not good and bad, it depends a lot on your data design and use of data. Feature datasets are provided to allow you group spatially related FCs. The categorization, however, depends a lot on how you use the data. For example, say, you have the world data for "Streets" and "Places to Visit". This data can be grouped either by ...


2

Try using Feature Class To Feature Class instead of Copy Features. The same coordinate system is not the same thing as identical; also see ArcCatalog 10.0 complains that spatial references don't match between a feature dataset and a feature class that have the same coordinate system? Fc-to-Fc is more thorough than copy and will automatically take care ...


2

I know this has been solved already, but I was having the same issue and it turned out that my feature dataset was located in a personal geodatabase that had reached its size limit and that was causing the problem. ...just in case anyone else stumbles upon this and the above isn't the issue...


2

If you need to update records based on edits to the origin, there are several ways to do it. What it boils down is to listen to the Relationship Class events and to update accordingly. That is one way to do it. Another one is to do it as an Editor Extension.


2

I think you will need to use ArcPy for this and the code needed can be found at http://forums.arcgis.com/threads/23078-how-to-delete-all-featuresclasses-in-a-featuredataset-using-arcpy


2

When the FeatureClass gets imported into a FeatureDataset it gets projected to the coordinate system because all FeatureClasses inside a FeatureDataset must have the same Spatial Reference. If you are curios as to the exact process in terms of code, the Import process grabs the ISpatialReference object from the Destination FeatureDataset and, as it loops ...


2

In version 9.3 there is a toolbox called Create Features from Text File, which can do what you require. The help files are quite detailed and are found here. The following code sample should be simple enough to adapt to reflect your dataset: # Create geoprocessing dispatch object import arcgisscripting gp = arcgisscripting.create() # Set up inputs to tool ...


2

If you exported the oid, fid or some other unique identification field. Then I would do a join back to that field. Then if you need to add a new field (actually create prior to the join) and calculate the join value to the fc. Note that if you edit/split/delete features after the csv export the oid can change. The csv will be on the end of the attribute ...


2

Below is the code you require: import arcpy xls = r"C:\Scratch\Book1.xls" table =r"C:\Scratch\tempxls.dbf" arcpy.ExcelToTable_conversion(xls,table) with arcpy.da.SearchCursor(table,["Feature"]) as cursor: for row in cursor: fd = row[0] print "Creating FeatureDataset: " + fd ...


2

When creating a feature class from a table (or a text file), you cannot export directly into a feature dataset; this is just an existing limitation of the software. but there could be a good reason behind it. The recommended workaround is to use the Make XY Event Layer GP tool first and then exporting the event layer into a feature class within the feature ...


2

No you cannot have a Feature Dataset within a Feature Dataset. Feature Datasets do not hold data (they are not like a folder in a file system). They group data together when displayed in a geodatabase, but they don't hold the data themselves. Feature Datasets should be used only for holding related data such as in Networks, Topology, or Geometric ...


1

From the ArcGIS Server 9.3 Help: “Feature class names must be unique in a geodatabase—you can't have more than one feature class with the same name. This is true of all feature classes in the same geodatabase, even those grouped with other feature classes in a feature dataset.”


1

Maybe the IFeatureDataConverter2.ConvertFeatureClass Method does what you need: http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/d/0025000002w5000000.htm It takes a source Featureclass Name and an Output featuredataset Name as Parameter.


1

You can download the shapefiles then create a Geodatabase and a new feature class of the desired coordinate system with the same field mapping as the source data. (You can import fields from the source shapefile during the process) Once created, right click on the feature class --> Load Data This way you can load many source shapefiles into one ...


1

You might be able to do this using IDatasetContainer.AddDataset. From the IDatasetContainer documentation: The IDatasetContainer interface lets you move datasets between feature datasets and workspaces. Both objects implement the interface. It should only be used to move datasets between feature datasets and the workspace level within a single ...



Only top voted, non community-wiki answers of a minimum length are eligible