[mapguide-users] Maestro: can't find the table containing the
geometry field with SQLServerSpatial
Carl
carlshe at 163.com
Tue Oct 14 12:40:34 EDT 2008
I traced into the code further more, and found the exception occurs while
creating a featuresetcolumn with field type of 'varbinary': (as bold line of
follow code)
public FeatureSourceSchema(XmlNode node, XmlDocument doc,
XmlNamespaceManager mgr)
{
XmlNode root = doc.FirstChild;
if (root.NodeType == XmlNodeType.XmlDeclaration)
root = root.NextSibling;
m_schema = root.Attributes["targetNamespace"] == null ? null :
root.Attributes["targetNamespace"].Value;
if (m_schema != null && m_schema.IndexOf("/") > 0)
m_schema = m_schema.Substring(m_schema.LastIndexOf("/") + 1);
m_name = node.Attributes["name"].Value;
if (m_name.EndsWith("Type"))
m_name = m_name.Substring(0, m_name.Length - "Type".Length);
XmlNodeList lst;
if (node.ChildNodes.Count == 0)
{
m_columns = new FeatureSetColumn[0];
return;
}
else if (node.FirstChild.Name == "xs:sequence")
lst = node.SelectNodes("xs:sequence/xs:element", mgr);
else
lst =
node.SelectNodes("xs:complexContent/xs:extension/xs:sequence/xs:element",
mgr);
m_columns = new FeatureSetColumn[lst.Count];
for(int i = 0;i<lst.Count;i++)
m_columns[i] = new FeatureSetColumn(lst[i]);
}
Carl wrote:
>
> I don't know whether it is the issue of Maestro, or MGOS server, or even
> the FDO provider for SQL server 2008.
>
> I have a SQL server 2008 Database with more than 200 tables. some tables
> has the name with the max length of 64 alpha-beta letters. there is only
> one table, with name length of 35 letters, has a field of type 'geometry'.
> I want to show the distribution map of this geometry with MapGuide OS.
>
> I now created a feature datasource successfully with Maestro, by setting
> the server, database, username,password, and then I tried to create a
> layer referencing the featuredatasource. But Maestro always show a message
> as follows:
>
> Failed to read schema from data source. The operation gave the error
> message: Failed to find appropriate type for: xs:hexBinary.
>
> I traced the project 'Maestro' with VS 2008. and from 'public override
> FeatureSourceDescription DescribeFeatureSource(string resourceID, string
> schema)' of file 'HttpServerConnection.cs' to public
> FeatureSourceDescription(System.IO.Stream stream)' of file
> 'FeatureSourceDescription.cs', and find the XML document, loaded from the
> input stream, only covers the definition about 16 tables, and the spatial
> table isn't among these tables.
>
> I also test the SQL Server Spatial with only one table with a geometry
> field, the feature datasource and the relative layer can be defined and
> can be previewed.
>
> Hope somebody could help me.
>
> Thanks!
>
--
View this message in context: http://www.nabble.com/Maestro%3A-can%27t-find-the-table-containing-the-geometry-field-with-SQLServerSpatial-tp19977173p19977444.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list