1

I have imported several shapefiles from different sources and have set up an MXD project with groups and subgroups of layer. I want to export the layers to a geodatabase while maintaining the same structure as the TOC, sending each group of layers to a different dataset.

How could I?

  • Welcome to GIS SE! As a new user be sure to take the Tour. To do this you will need to use ArcPy. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. – PolyGeo May 22 '17 at 10:40
  • 1
    File geodatabase doesn't support the concept of a folder, and the closest thing it does support, the feature dataset is not intended for that purpose (and could cause performance issues is misused). I recommend you reconsider your intention. – Vince May 22 '17 at 10:48
1

I want to export the lyrs to a gdb while maintaining the same structure as the TOC, sending each group of layers to a different dataset.

I think you probably misunderstood the relationship between a .mxd map file (or layer file) and datafiles such as .shp and geodatabases. A map/layer file does not store the actual GIS data, and it only stores other things like references and styles of GIS data. Vice versa, in ArcGIS, the GIS data formats like geodatabase cannot store the map/layer file either. There are stored separately.

By analogy, the .mxd/.lyr file is like your HTML file containing links to data such as images on your webpage. You can't store the HTML in an image file or an image file in your HTML file.

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.