[mapguide-users] Re: FDO Exception when selecting feature.

Dave Wilson dave.wilson at autodesk.com
Fri Aug 6 15:52:03 EDT 2010


I have a connection in Windows 2008 64bit to an Excel 2000 spreadsheet that works. I use a DSN connection. The spreadsheet has a named region set. On my feature source I define a key column and the geometry columns. Here is the config doc associated with the connection:

  <?xml version="1.0" encoding="UTF-8" ?> 
- <fdo:DataStore xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:fds="http://fdo.osgeo.org/schemas/fds">
- <gml:DerivedCRS gml:id="LL84">
  <gml:remarks>WGS84 datum, Latitude-Longitude; Degrees</gml:remarks> 
  <gml:srsName>LL84</gml:srsName> 
- <gml:validArea>
- <gml:boundingBox>
  <gml:pos>-113.500000 -51.799999</gml:pos> 
  <gml:pos>178.300003 74.000000</gml:pos> 
  </gml:boundingBox>
  </gml:validArea>
- <gml:baseCRS>
- <fdo:WKTCRS gml:id="LL84">
  <gml:srsName>LL84</gml:srsName> 
  <fdo:WKT>GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</fdo:WKT> 
  </fdo:WKTCRS>
  </gml:baseCRS>
  <gml:definedByConversion xlink:href="http://fdo.osgeo.org/coord_conversions#identity" /> 
  <gml:derivedCRSType codeSpace="http://fdo.osgeo.org/crs_types">geographic</gml:derivedCRSType> 
  <gml:usesCS xlink:href="http://fdo.osgeo.org/cs#default_cartesian" /> 
  </gml:DerivedCRS>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/Default" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:Default="http://fdo.osgeo.org/schemas/feature/Default" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:element name="Country" type="Default:CountryType" abstract="false" substitutionGroup="gml:_Feature">
- <xs:key name="CountryKey">
  <xs:selector xpath=".//Country" /> 
  <xs:field xpath="COUNTRY_KEY" /> 
  </xs:key>
  </xs:element>
- <xs:complexType name="CountryType" abstract="false" fdo:geometryName="Geometry">
- <xs:complexContent>
- <xs:extension base="gml:AbstractFeatureType">
- <xs:sequence>
- <xs:element name="COUNTRY_KEY">
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
  <xs:maxLength value="" /> 
  </xs:restriction>
  </xs:simpleType>
  </xs:element>
- <xs:element name="COUNTRY_NAME" minOccurs="0">
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
  <xs:maxLength value="" /> 
  </xs:restriction>
  </xs:simpleType>
  </xs:element>
- <xs:element name="AREA" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="CAPITAL" minOccurs="0">
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
  <xs:maxLength value="" /> 
  </xs:restriction>
  </xs:simpleType>
  </xs:element>
- <xs:element name="GDP" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="INFLATION" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="UNEMPLOYMENT" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="EXPORTS" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="IMPORTS" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="POPULATION" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="GROWTH_RATE" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="BIRTH_RATE" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="DEATH_RATE" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="LIFE_MALE" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="LIFE_FEMALE" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="AREA_LAND" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="POPULATION_DEN" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="LITERACY" minOccurs="0">
- <xs:simpleType>
  <xs:restriction base="xs:double" /> 
  </xs:simpleType>
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
- <xs:element name="Geometry" type="gml:AbstractGeometryType" fdo:hasMeasure="false" fdo:hasElevation="false" fdo:srsName="LL84" fdo:geometricTypes="point" fdo:geometryTypes="point multipoint">
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
  </xs:element>
  </xs:sequence>
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="COUNTRY_KEYType" abstract="false" fdo:hasGeometry="false">
- <xs:complexContent>
- <xs:extension base="gml:AbstractFeatureType">
- <xs:sequence>
- <xs:element name="COUNTRY_KEY" minOccurs="0">
- <xs:annotation>
  <xs:documentation /> 
  </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
  <xs:maxLength value="" /> 
  </xs:restriction>
  </xs:simpleType>
  </xs:element>
  </xs:sequence>
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
  </xs:schema>
- <SchemaMapping xmlns:rdb="http://fdordbms.osgeo.org/schemas" xmlns="http://fdoodbc.osgeo.org/schemas" provider="OSGeo.ODBC.3.5" name="Default">
- <complexType name="CountryType">
  <Table name="Country" /> 
- <element name="COUNTRY_KEY">
  <Column name="COUNTRY_KEY" /> 
  </element>
- <element name="COUNTRY_NAME">
  <Column name="COUNTRY_NAME" /> 
  </element>
- <element name="AREA">
  <Column name="AREA" /> 
  </element>
- <element name="CAPITAL">
  <Column name="CAPITAL" /> 
  </element>
- <element name="GDP">
  <Column name="GDP" /> 
  </element>
- <element name="INFLATION">
  <Column name="INFLATION" /> 
  </element>
- <element name="UNEMPLOYMENT">
  <Column name="UNEMPLOYMENT" /> 
  </element>
- <element name="EXPORTS">
  <Column name="EXPORTS" /> 
  </element>
- <element name="IMPORTS">
  <Column name="IMPORTS" /> 
  </element>
- <element name="POPULATION">
  <Column name="POPULATION" /> 
  </element>
- <element name="GROWTH_RATE">
  <Column name="GROWTH_RATE" /> 
  </element>
- <element name="BIRTH_RATE">
  <Column name="BIRTH_RATE" /> 
  </element>
- <element name="DEATH_RATE">
  <Column name="DEATH_RATE" /> 
  </element>
- <element name="LIFE_MALE">
  <Column name="LIFE_MALE" /> 
  </element>
- <element name="LIFE_FEMALE">
  <Column name="LIFE_FEMALE" /> 
  </element>
- <element name="AREA_LAND">
  <Column name="AREA_LAND" /> 
  </element>
- <element name="POPULATION_DEN">
  <Column name="POPULATION_DEN" /> 
  </element>
- <element name="LITERACY">
  <Column name="LITERACY" /> 
  </element>
  <element name="Geometry" xColumnName="LONGITUDE" yColumnName="LATITUDE" /> 
  </complexType>
- <complexType name="COUNTRY_KEYType">
  <Table name="COUNTRY_KEY" /> 
- <element name="COUNTRY_KEY">
  <Column name="COUNTRY_KEY" /> 
  </element>
  </complexType>
  </SchemaMapping>
  </fdo:DataStore>

 

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of DGK
Sent: Friday, August 06, 2010 1:41 PM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Re: FDO Exception when selecting feature.



Jackie Ng wrote:
> 
> Do you know if FDO is properly detecting the identity properties (primary
> keys)?
> 
> If you open that data source with FDO Toolbox, does that show the correct
> properties as identity properties?
> 
> - Jackie
> 

Jackie and other forum members,

Please accept my profuse apologies for this breach of forum etiquette but
desperation has made me post twice on this topic in one day.   Monday
looms...

I made the connection to the Excel sheet with FDO toolbox.  The key field
(SITE-x20-ID) is not an indentity property.  Today I read your blog about
"Using FDO Schema Overrides" and tried to follow your code examples for SQL
and apply them to the Excel file from which I dumped the xml schema mapping. 
I tried editing the file, adding a key element, yet failed as I am woefully
out of my league.

On top of that, I am not sure how to incorporate the configuration file back
into either MGE or the Excel file so it will allow me to select features in
MGE and retrieve their associated data.

I would be deeply in your debt if you could edit the xml file and tell me
how to incorporate it appropriately back in MGE

I have attached the source xcel file and the xml dump from it.  I am trying
to make "SITE-x20-ID" field the indentity properrty.

Many Thanks,
Dan

http://osgeo-org.1803224.n2.nabble.com/file/n5381923/SampleData.xml
SampleData.xml 
http://osgeo-org.1803224.n2.nabble.com/file/n5381923/SampleData.xls
SampleData.xls 

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/FDO-Exception-when-selecting-feature-tp5347905p5381923.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


More information about the mapguide-users mailing list