2

I have set of shapefiles that represent cadastar plan. Correct order of layers look like this in TOC.

shape file in correct order

I would like to import same structure to existing geodatabase katastar.gdb so I have something like this:

enter image description here

Can this be done with ModelBuilder? Feature class to geodatabase (multiple) does not accept group layer? I probably need to iterate somehow sublayers in group layer and then import one by one. But how to do that?

  • Rather than select the grouplayer can you not select the individual layers then drag 'n' drop them all into the featureclass to geodatabase tool? – Hornbydd Aug 10 '16 at 22:14
  • Of course I can, but then I have to rearrange them inside geodatabase. I would like to automate this process via model builder because I have 100+ layer groups to convert to gdb... – vldmrnnc Aug 11 '16 at 7:10
  • The order you see featureclassses in a geodatabase will be based upon their name. Unless you deliberately use a naming convention that places them in order you'll get what arcmap will give you. Out of curiosity why would the order of tables shown in the geodatabase matter? – Hornbydd Aug 11 '16 at 9:50
  • Maybe order is whorng term. Sorry, english is not my native language. I'm trying to retain hierarchy iniside geodatabase same as in TOC. I need feature dataset to corresponde to layer group, and feature class inside feature dataset to be as in toc. To simplify, I want to transfer from shape to geodatabase and retain group hierarchy. – vldmrnnc Aug 11 '16 at 14:40
  • ok that makes sense. – Hornbydd Aug 11 '16 at 15:02
1

Following on from the comments above:

The issue with trying to simulate the hierarchy in a geodatabase is that to be in a FeatureDataset all FeatureClass must be in the same coordinate system and spatial extent defined by the FeatureDataset.

Layers in a Group Layer can be in completely different coordinate systems and extents. So if you wanted to group all the same layers in your Group Layer into a single FeatureDataset you would need to project them and ensure they are within the same spatial extent. By spatial extent I mean you could be using a European wide coordinate system but if the FeatureDataset extent has been set to Poland then the UK is not in it (brexit pun! :) )

That could be a lot of work. A possible solution is kind of what you have done, the FeatureClass is prefixed with your Group Layer name, e.g.kn_Blato_1000_. Or you could have 1 geodatabase for 1 grouplayer?

I don't think there are any geo-processing tools that can extract out the grouplayer name from a layer in an mxd, you would need to run this in python. Have a look at the help file for layer object in arcpy.mapping module to access the property longName.

  • 1
    Thank you for your thoughts. You are right about projection. All my shapefiles are in same projection so there is no problem with that, but I have to have that always on my mind. I made small python to create FeatureDataset inside existing geodatabase from the list of Group layer names. I think you have a great idea. With combination of longName and listLayers command maybe I could get where I want. I'll give it a try. – vldmrnnc Aug 11 '16 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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