1

I was wondering if someone can give an explanation to why the following the scenarios happen ?

or direct me to relevant thread or documentation?

Back story is that I have been working a lot with layer files and group layer files. I wanted to give these to user to use as the way of accessing the data.

Although through testing I have come into a couple of issues and I was interested in knowing why these happen

Scenario 1 ( one single layer from one feature class)

I am working on MXD_1 and take a single feature class streets_new_york and run a definition query to filter it to show only red sections , using the sections field.

I save this out as layer file onto windows calling the layer red_sections.lyr

At a later point I am working on MXD_2 and I drag and drop red_sections.lyr into MXD_2 and save the map.

At a later point I am working on MXD_3 and I edit the streets_new_york to include addition polygons , some of which are red_sections.

When I open MXD_2 it has Automatically updated to show the new data that has been Added to the new feature class.

Scenario 2 Group Layers

I Create a group layer , that contains data from three separate feature class

I call this group layer USA_SECTIONS.lyr , Save to windows and then drag and drop this layer from windows onto my MXD_2.

At point , while working on a different map that contains the USA_SECTIONS.lyr , i add another layer into the group , so it now consists of 4 layers. i save this layer file using the same name USA_SECTIONS.lyr , Overwriting the old file. I open up MXD_2 and it contains the first version.

I think that there is an issue with how the in memory layers work and group layers.

closed as too broad by PolyGeo Jul 14 '15 at 22:29

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Please review the Tour where we say that there should be just one question per question in our focussed Q&A format. – PolyGeo Jul 14 '15 at 22:30
1

All understandable! So for scenario 1 you created a layer file called red_sections.lyr then added that to MXD_2. In windows explorer if you look at the folder with the red_sections.lyr file it is only a few KB in size, so it cannot possibly be the data (all your polygons). A LayerFile which is what you created just holds symbology any definition queries plus a few other things and most importantly it is a pointer to the source data. In ESRI the term FeatureClass is used as the source which could be a shapefile or a geodatabase featureclass. Now you edited that source dataset in MXD_3. So this is why you see the new additions in MXD_2 as all layers in any MXD are just pointers to the source datasets.

In scenario 2 you saved out a grouplayer to a LayerFile called USA_SECTIONS.lyr then added that to MXD_2. In your other MXD you add your fourth layer and overwrite the LayerFile BUT you do not add that LayerFile to your MXD_2. When you add a LayerFile to an MXD think of it as copying the contents of a LayerFile into an MXD, you are not creating a pointer to the LayerFile which in your case contains 4 layers in a grouplayer and those layers point to the source data.

So what you have described is all expected behavior.

  • thanks ,that makes a lot of sense , i have another question relating to this , but i post it again . I am trying to use the layers as a way users can access data and if possible it will act reactively as the data is changed. Is it correct that this is only possible for single layer files. For group layers would the only way for them to updated would be to create a script that searches for and MXD and then updates GROUP_LAYER_1 with GROUP_LAYER_1_NEW – Jack Walker Jul 14 '15 at 21:39
  • How can you put a question on hold that been asnwered? – Jack Walker Jul 14 '15 at 22:58
  • @JackWalker The question is on hold to prevent additional answers being provided, and to try and prevent it being used by someone later to say "Why was that question left open and answered when mine with not even that many questions in it was placed on hold?" For advice on how to structure questions I recommend meta.gis.stackexchange.com/a/3353 – PolyGeo Jul 14 '15 at 23:12
  • i am sory i but i do agree , i have been on this forum long enough to have an idea of what is constructive and what is not. the main question , is not broad i give two very specifuc situation and ask why these happen. I have also been given an answer ,i beleive in this case there is no need to close the question. if anything is prety destructive. censoring knowledge – Jack Walker Jul 15 '15 at 5:48
  • @JackWalker To get this question re-opened I think what is needed is for it to be edited so that there is only one scenario being asked about. That way it will not be too broad. However, there is also no harm, and there may possibly be an advantage to leaving it closed, so that the "two answers in one to the two questions in one" are preserved. The reason I think it should be closed in its current state is that it does not ask a single clear question (as per the Tour), and thus should not serve as a precedent for other similarly broad questions to be posted. – PolyGeo Jul 15 '15 at 6:39

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