Rename layers

112 views
Skip to first unread message

ERDAS Communities - Automated Email

unread,
Jan 20, 2010, 12:03:05 PM1/20/10
to erdas-communitie...@googlegroups.com

Rename layers
By Zhuoting in ERDAS Software Forum

I stacked 26 files in ERDAS, and it came out as Layer 1, Layer 2,....Layer 26. I renamed each layer by Layer Info > Edit >Rename Layer, then my *.img file ended up with a very small size and cannot be opened elsewhere such as ENVI or ERMapper. Is there any way to rename the layers without having any damage to the file?

I'll very appreciate your help! Thanks!

Zhuoting

----------------------------------
You were sent this email because you opted to receive email notifications when someone created a new thread, or replied to a topic within this forum, ERDAS Software Forum.

To unsubscribe:

  1. To unsubscribe from this item only, visit the item link and turn off notifications.
  2. To stop all notifications of any updated items from ERDAS Communities, go to Edit Profile, click on the Site Options tab, then under Email Configuration, set Send Notifications to "No".

ERDAS Communities - Automated Email

unread,
Jan 21, 2010, 4:49:55 PM1/21/10
to erdas-communitie...@googlegroups.com

Re: Rename layers
By Donn Rodekohr in ERDAS Software Forum

Zhuoting,

It sounds like there was a flaw of some sort.  I frequently rename layers using Image Info and, while a bit tedious, it has always worked as long as I keep the names short (< 12 characters), no spaces, and no punctuation (. , ; "  etc.) only an occasional "_" for a separator.  So far (v. 9.3 with service packs) I have never destroyed a data file.  But I have never tried it with 26 layers, either. 

There are in essence two ways to do the rename layers:

1.  use the Layer Info - Edit - Layer Name.

2.  Use the layer naming function in Spatial Modeler Language.  This works quite nicely but is NOT an option with the graphic modeling package.  It is an option only when editing and running the script in non graphic mode.  If I can find some sample code I'll send it.  I've used it a couple of times and it works well, it is just somewhat painful to modify since it involves modifying the modeling script.  You have to follow the same naming rules as with Image Info.

 

----------------------------------
You were sent this email because you opted to receive email notifications when someone responded to this thread.

ERDAS Communities - Automated Email

unread,
Jan 21, 2010, 5:05:03 PM1/21/10
to erdas-communitie...@googlegroups.com


By Zhuoting in ERDAS Software Forum

Donn,

Thanks a lot for your reply! It's my first time rename 26 layers, and I was really bummed that I "lost" my file. I kept it pretty short and no space, maybe it was just bad luck. I can recreate the file and try it again.

best,

Zhuoting

ERDAS Communities - Automated Email

unread,
Jan 22, 2010, 9:06:20 AM1/22/10
to erdas-communitie...@googlegroups.com

Re: Rename layers
By Rutger in ERDAS Software Forum

Hi Zhuoting,

If you're worried about losing the layernames again, you can try Donn's second suggestion about using the modeler

Below is a simple SML model which names the layers. In my example the inputfile ($file1) has 2 layers, you specify the layernames at the moment you declare the outputfile ($file2).

SET CELLSIZE MIN;
SET WINDOW INTERSECTION;
SET AOI NONE;

Float RASTER file1 FILE OLD NEAREST NEIGHBOR AOI NONE "d:/without_layernames.tif";
Float RASTER file2 FILE NEW IGNORE 0 ATHEMATIC FLOAT SINGLE "d:/with_layernames.tif(:ThisislayerOne,:ThisislayerTwo)";

file2 = $file1;

QUIT;

Good luck!

Reply all
Reply to author
Forward
0 new messages