Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to store an ESRI object inside a blob field inside a geodatabase? If not, perhaps a serialized XML representation?

I'm thinking about storing IFeatureRenderers inside these fields.

Any tips? Anyone has ever done this?

share|improve this question
up vote 8 down vote accepted

Yes, essentially that is what the Store and retrieve Layers in the GeoDatabase sample does. Haven't seen a .NET port of this though.

In general, as long as the object implements IPersistStream or IPersistVariant, then it can be persisted to a blob in a database.

share|improve this answer
I did not know that sample. I'll take a look into it Kirk. Blobs may be better than XML in my opinion. Thanks for the help. looks fairly easy too! – George Apr 12 '11 at 18:46
Forgot to mention the tip: if putting an abstract class in a blob, put it in a propertyset first. Otherwise the deserialization process needs to know what the progid is. This would apply to IFeatureRenderer as well as ILayer instances. – Kirk Kuykendall Apr 13 '11 at 14:58

Yes, you can safely persist feature renderers to a blob. In fact, I did exactly that in one of my past projects.

Would probably not work easily for XML since there might be objects in the object graph which do not support XML serialization.

share|improve this answer
this is a important comment. I will definetely go the blob route. It's even better because I can save a whole bunch of other information, such as labelling information. – George Apr 12 '11 at 19:03

Many objects that do not implement IXmlSerialize can still be serialized to XML. Those objects will simply contain a Base64-encoded string of the binary serialization. Not really efficient or ideal, but useful if you have a need for some objects to be persisted to a human readable.

share|improve this answer

The IServerContext has a SaveObject and LoadObject method. This lets you save arcObjects as a string and then load it back up when you want it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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