Building up SpatialReference XML from scratch?

Discussion created by flyingrat42 on Apr 19, 2011
I'm currently looking at the logistics involved with building up an XML Workspace Document (schema-only) "from scratch", to be applied to a File GDB, and am wondering if anyone has experience with this.  In brief, we have an in-house format (in MySQL) for storing geospatial schemas, and want to be able to generate empty geodatabases on-demand that conform to said schemas.  (The intent is to get our data-modeling objects translated into other Java objects of a series of classes bound to those in the XML Schema for the Geodatabase, via JAXB, and then marshaling the resulting content tree into XML-- but that's not directly relevant to the current question...)

The thing I'm especially concerned about is managing SpatialReference information.  I understand that the SpatialReference element gets "duplicated" at multiple points throughout the Workspace XML (Feature Class, Extent, GeometryDef...etc.) but that shouldn't necessarily be an issue.  What I'm unsure of is:

1. What constitutes a minimally valid SpatialReference element.  Is it possible to populate the WKT alone?  If not, what's the "minimum allowable" SpatialReference definition that will work *anywhere* in the XML Workspace Document that it's required?

2. Being able to define the WKT as-needed.  Is there an easy way to do this apart from reverse-engineering from an existing XML Workspace Document?

Any and all thoughts would be greatly appreciated.  (If this query more properly belongs in another forum, please move it as appropriate.)