Using ModelBuilder to save Network Analyst output as layer file (.lyr)

1112
3
11-06-2019 08:49 AM
SecundinoArellano
New Contributor

Greetings,

First time posting on here; have looked extensively online and have unfortunately found nothing on the topic. 

I'm new to using model builder, but I was able to set up a location allocation model that iterates through the number of facilities to find. The model is working fine and providing all the outputs in the format I need except for one: a layer file (.lyr) for each iterated network analysis layer. While the layer files are saving to the folder I've indicated (and for all iterations) when I drag them into ArcMap only the demand lines sublayer is/can be displayed. The rest of the sublayers (e.g. demand point, facilities, point barriers, etc.) are present and have data in their attribute tables, however I can't get them to display (even when going through their symbology settings). 

overview of the location allocation model

Below is a zoomed-in screen capture of the output handling (right side of first image). In addition to attempting to save to layer file, I am also saving each of the sublayers (facilities, demand lines, and demand points) to separate folders. The collect values is for displaying them to ArcMap. As I mentioned, everything is working except for trying to get the layer files to display. The layer files are not imperative, but it would be nice to get them working because it's so much easier to drag them into ArcMap for quick viewing. Just as a side note, the model is white (i.e. not ready to run) because I've set it up to allow the user to input all relevant data.

zoom-in of output handling

Thanks in advance for any help that may come my way.

Cheers! 

3 Replies
MelindaMorang
Esri Regular Contributor

Your model looks good, like it should work.  The one thing I noticed is that the output bubble from Save To Layer File shows a ".shp" extension instead of ".lyr".

For the output layer files you're currently getting: When you add them to ArcMap, do they function as real Location-Allocation layers?  Can you interact with them using the Network Analyst window and solve them again?

0 Kudos
SecundinoArellano
New Contributor

Thanks for the reply Melinda. Yes, the output layer files (when brought in) are functioning as real location-allocation network analyst layers; they show up in the network analyst window and are re-solvable. I fixed the extension to .lyr rather than .shp, but it unfortunately did nothing. Again, only the demand lines are able to be displayed. 

Since I made the post, I actually ended up removing the Save To Layer File function and instead just manually group all the files brought into the table of contents and save the group as a layer file. Much quicker than going through them individually, but am still very curious as to why the model builder way doesn't work. 

0 Kudos
MelindaMorang
Esri Regular Contributor

If the layer works properly (and it sounds like it does) but the points aren't displaying, it sounds to me like a bug.  If this is disrupting your workflow, the best thing to do is to call Esri Support about it.  But, if your workaround solution is adequate for your needs, I guess there's no need to solve the mystery.