Thanks Ben,

That makes a lot of sense. I was starting to think that something like
that was the case.

Regards,
Dale McIntosh
(619-302-7637)


-----Original Message-----
From: Ben Caradoc-Davies [mailto:[email protected]] 
Sent: Thursday, August 12, 2010 11:42 PM
To: Dale F. McIntosh
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] GeoTools and A feature name attribute

The implementation of simple features in GeoTools is crippled by not
being fully namespace aware. It assumes that all properties of a simple
feature are in the same namespace as the feature type, and in some
places it just doesn't care about namespaces at all.  You can see this
in, for example, SimpleFeatureImpl (one a many examples):

public Property getProperty(Name name) {
     return getProperty( name.getLocalPart() ); }

I suspect that this might be causing your problem. As a consequence of
this defect, the "name" of your feature type collides with the (gml:)
"name" of gml:AbstractFeatureType.

Kind regards,
Ben.

On 13/08/10 13:36, Dale F. McIntosh wrote:
> I have the following Feature in GeoServer:
>
> <?xml version="1.0" encoding="UTF-8" ?> 
>
-<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Descr
ibeFeatureType&typeName=c2rpc:PlatformRollup>  <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:c2rpc="http://www.mycompany.com/c2rpc";
xmlns:gml="http://www.opengis.net/gml"; elementFormDefault="qualified"
targetNamespace="http://www.forwardslope.com/c2rpc";>
>    <xsd:import namespace="http://www.opengis.net/gml";
schemaLocation="http://dmpc:8080/geoserver/schemas/gml/2.1.2/feature.xsd
" />
>    <xsd:complexType name="PlatformRollupType"> 
> -<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Des
> cribeFeatureType&typeName=c2rpc:PlatformRollup>  <xsd:complexContent> 
>
-<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Descr
ibeFeatureType&typeName=c2rpc:PlatformRollup>  <xsd:extension
base="gml:AbstractFeatureType">
-<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Descr
ibeFeatureType&typeName=c2rpc:PlatformRollup>  <xsd:sequence>
>    <xsd:element maxOccurs="1" minOccurs="0" name="name"
nillable="true" type="xsd:string" />
>    <xsd:element maxOccurs="1" minOccurs="0" name="blueForceGuid"
nillable="true" type="xsd:string" />
>    <
>    </xsd:sequence>
>    </xsd:extension>
>    </xsd:complexContent>
>    </xsd:complexType>
>    <xsd:element name="PlatformRollup" substitutionGroup="gml:_Feature"
type="c2rpc:PlatformRollupType" />
>    </xsd:schema>
>
> Here is the resultant XML
> <?xml version="1.0" encoding="UTF-8" ?> 
> -<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Get
> Feature&typeName=c2rpc:PlatformRollup&maxfeatures=1>  
> <wfs:FeatureCollection xmlns="http://www.opengis.net/wfs"; 
> xmlns:wfs="http://www.opengis.net/wfs"; 
> xmlns:c2rpc="http://www.forwardslope.com/c2rpc"; 
> xmlns:gml="http://www.opengis.net/gml"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://www.forwardslope.com/c2rpc 
> http://dmpc:8080/geoserver/wfs?service=WFS&version=1.0.0&request=Descr
> ibeFeatureType&typeName=c2rpc%3APlatformRollup 
> http://www.opengis.net/wfs 
> http://dmpc:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd";>
>
-<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=GetFe
ature&typeName=c2rpc:PlatformRollup&maxfeatures=1>  <gml:boundedBy>
>    <gml:null>unknown</gml:null>
>    </gml:boundedBy>
> -<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=Get
> Feature&typeName=c2rpc:PlatformRollup&maxfeatures=1>
<gml:featureMember>
-<http://dmpc:8080/geoserver/ows?service=wfs&version=1.0.0&request=GetFe
ature&typeName=c2rpc:PlatformRollup&maxfeatures=1>
<c2rpc:PlatformRollup fid="PlatformRollup.10000">
>    <c2rpc:name>myName</c2rpc:name>
>    <c2rpc:blueForceGuid>somevalue</c2rpc:blueForceGuid>
>    <  </c2rpc:PlatformRollup>
>    </gml:featureMember>
>    </wfs:FeatureCollection>
>
>
> When I parse it into a Feature using a WFSDataStore (GeoTools 2.7-M2),
the name attribute disappears and cannot be found in the resultant
Feature.
>
> Is name is special case field that cannot be used to store Feature
Data?
>
>
>
>
>
> Thanks,
> Dale McIntosh
>
>


--
Ben Caradoc-Davies <[email protected]> Software Engineering
Team Leader CSIRO Earth Science and Resource Engineering Australian
Resources Research Centre

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to