Ok, I was unclear, it is impossible to save features to a layer file. Graphics are a different thing. I was also unaware you are using engine in which you do things a little differently. Ultimately you must advise your client what is best for them, I don't know the details of their application but you asked the forum for an opinion and I will give you mine."store them in xml and save them into IElementProperties.CustomProperty for that particular IElement" You can do that but the question is why? You would be effectively building your own custom database model. You wouldn't be able to leverage all the esri built in tools to take advantage of it. The only advantage I could see in using a graphic layer is the possibility of storing different geometry types in the same layer. You can actually use an annotation feature class for that, since you can store an IElement in an annotation and still have it in a geodatabase with the attribute table etc. Using the standard esri storage, you open up the possibility of using esri built in editing functions, display, identify, etc. as well as the ability to share data with other esri applications. There are also built in exporters to other formats to use in other software. There is a little more overhead in setting up the geodatabase and editing it according to esri procedures but I think they are worth it. There are even data recovery and cleaning tools for geodatabase that you wouldn't have for your custom graphics layer.
ok when posting question you should provide more information. First what product your using, arcgis desktop, server, engine and which version? Secondly within that product what are you using? In desktop it could be ArcMap, ArcCatalog, Globe, Scene.. In Engine, which control? In server which API? Then which development environment (.net, java, python) and the type of customization (add-ins, extensions. etc.)I am going to take a leap and assume it is desktop customization of ArcMap 10.x with .net and add-ins or extension code. The ArcMap graphics layer is stored in the map document (mxd.) It is unique to this document and cannot be shared and used much. It can contain multiple geometry types (line, point, polygon, text, etc.) but no attribute information. As such it is not GIS data because it contains no attributes. GIS data is stored in a database of some sort, even if the database is a flat file. It is a geometry with geographical coordinates and a series of attributes that describe it in some what. In ArcGIS, GIS data is stored in a geodatabase or shapefile (usually.) In the esri world, a feature class is a set of geographic features that share the same type (line, point, polygon, etc.), the same coordinate system (geographic, lambert, etc.) and the same attributes and are stored together in the same file (usually a set of related files) or data table (usually a set of related tables.) A layer in the map is a reference to a data source, the feature class and symbology, sub -queries and other information on how to draw the feature class on the map. A layer files (.lyr) is the layer in the map serialized to a file, it does not contain any features, only information on where the feature class is located and how to draw it.I can't tell you what to do because I don't know your requirements, that is up to you to figure out. Saving geometries in graphic layers is not very useful. Saving them in .lyr files is impossible. You should look into saving them into feature classes in a geodatabase.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.