How To: Change features or attributes in an existing LIBRARIAN layer
How do I add additional features to an existing library layer? For example, I want to add line features to WELL map sections in my STATE_WELLS points only layer. I do not want to change the layer name or the name of the layer map sections. My library is named STATELIB.
To add features to an existing library layer follow these steps:
1) Backup the map library DATABASE directory and at least all the WELL map sections in the tile directories. The LIBRARIAN VISIT is a powerful command. If your AML processes data incorrectly, the mistake will occur once in each active tile directory. Be safe, backup the library data.
2) Write an AML to add the feature to the WELL map section. Assume the AML will always be run from a tile directory. Call the AML MODIFY_WELL.AML. The AML may use the ARC RESELECT, INTERSECT and COPYFEATURES command, or some other methodology for getting the new features into each map section. If you are dropping features, the AML would use the arc DROPFEATURES command.
3) Use the LIBRARIAN VISIT, DROPLAYER and ADDLAYER commands to change the STATE_WELLS layer. Make sure no one else is querying or editing the library layer at that moment.
Librarian: library statelib
Librarian: visit arc \&run /path_to/modify_well.aml
Librarian: droplayer state_wells
Usage: addlayer < layer > < cover > < format_cover >
Librarian: addlayer state_wells well /path_to_a_tile_directory/well
Do not use the DELETE option with the LIBRARIAN DROPLAYER command. If you do, you will delete the modified layer map sections.
This approach will work when you wish to change the attributes of a feature in an existing layer. Uses the ARC DROPITEM and ADDITEM commands in your AML for that purpose.
The following are two good suggestions regarding the AML used to modify the layer features or attributes.
- Use the ARC COPY command to make a backup copy of each map section at the beinning of the AML. After the layer has been correctly changed, use the LIBRARIAN VISIT command to do an ARC KILL command to remove the backup copies of the coverages.
- Use the the AML [EXISTS -COVER] function with an &DO loop to avoid attempting to process non-existent tile coverages.
For more information, see the ArcDoc sections: Master Contents, Database Management, > Using map libraries > Modifying a map library framework > changes through visit, and Master Contents, Database Management, > Using
map librariesModifying a map library framework > Layer maintenance, Changing a layer item definition.