Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a pretty simple script which gets 2 parameters from the user:

1)Geodatabase location

2)Spatial reference

It then creates a dataset with 6 feature classes. It also adds a large amount of fields to each each feature class, and by large I mean no more than 20.

It also adds defaults to certain fields.

My question is:

Could I speed up the running of the tool by organizing the code differently?

Right now I have it so it creates the dataset, then creates the first feature class and then the fields it needs and any defaults for those fields.

Could it be quicker to have it make all the features classes at once, then all the fields, then all the defaults? Or would it make no difference?

Currently, it's taking about 4 minutes to do everything.

Thanks for any help.

share|improve this question
2  
Initial thoughts: 1) Why is Spatial reference a parameter? If you have more than a couple then I think you are asking for trouble when it comes to projections, datums and transformations. If you are at 10.1 then the ListTransformations method may come in handy. But you make no mention of projecting or loading data at all -- is that part of this script or a separate process entirely? –  blah238 Oct 31 '12 at 4:21
3  
2) If you could pre-author template geodatabases exactly as you want them, you could simply copy and paste them using Copy_management, for example, which would take no more than a few seconds. –  blah238 Oct 31 '12 at 4:25
3  
3) Can you post your script? –  blah238 Oct 31 '12 at 4:26
2  
@blah238 Could not agree more - empty template GDB with feature dataset per possible spatial reference would mean copy GDB then delete feature datasets with unwanted SRs. –  PolyGeo Oct 31 '12 at 5:25
1  
Empty GDBs take up practically no space, so I was thinking more along the lines of one GDB (or XML workspace document) per spatial reference but whatever works. :) –  blah238 Oct 31 '12 at 5:40
show 3 more comments

1 Answer

up vote 2 down vote accepted

If you have a sample Geodatabase that already has the Feature Dataset you can export the schema as an XML file. To do this, in ArcCatalog right click the feature dataset and select Export then select XML Workspace Document. Follow the wizard and save the XML file somewhere.

Now modify your script to run the Import Replica Schema tool with the XML file. This should create the Feature Dataset in your geodatabase in a matter of seconds instead of minutes.

Note, you may want to run checks in your script to ensure that the Feature Dataset doesn't already exist in the selected Geodatabase.

EDIT:

This tool as well as the ones that @blah238 mentions in the comment to this answer, require ArcGIS Standard or ArcGIS Advanced license.

share|improve this answer
1  
At 10.1 you also have the Import XML Workspace Document and Export XML Workspace Document geoprocessing tools. –  blah238 Oct 31 '12 at 5:21
1  
@blah238 I was looking at the 10.0 web-help and didn't see those. Those are probably better options. I edited my post to indicate that all those tools require ArcGIS Standard as a minimum. –  Fezter Oct 31 '12 at 5:39
1  
Yes they were added with little fanfare to 10.1: resources.arcgis.com/en/help/main/10.1/index.html#/… –  blah238 Oct 31 '12 at 5:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.