[Geoserver-users] DescribeFeatureType problem

I have the following response to a WFS DescribeFeatureType request for a WFS
I am trying to get geoserver to use to create a WMS layer.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.imos.org.au"
elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot;
xmlns:imos="http://www.imos.org.au" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd&quot;/&gt;
<xsd:element name="sensor" substitutionGroup="gml:_Feature"
type="imos:sensorType"/>
<xsd:complexType name="sensorType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element name="name" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="location" minOccurs="1" maxOccurs="1"
type="gml:PointPropertyType"/>
<xsd:element name="url" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="channel" minOccurs="1" maxOccurs="unbounded"
type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

However in the FeatureType Configuration interface for geoserver 1.7.4 for a
new feature type I only see the url and the channel properties in the list
at the bottom of the page.

There is no indication as to why this may have occurred in the user
interface and nothing in the log with DEBUG enabled.

I have found that there is very little information relevant seen to solving
this kind of configuration issue available as in the following routine in
the RetypingDataStore class the original IOException is not rethrown.

    void updateMap(FeatureTypeMap map, boolean forceUpdate) throws
IOException {
        try {
            if (map.getFeatureType() == null || forceUpdate) {
                SimpleFeatureType original =
wrapped.getSchema(map.getOriginalName());
                SimpleFeatureType transformed =
transformFeatureType(original);
                map.setFeatureTypes(original, transformed);
            }
        } catch (IOException e) {
            // if the feature type cannot be found in the original data
store,
            // remove it from the map
            backwardsMap.remove(map.getName());
            forwardMap.remove(map.getOriginalName());
        }
    }

--
View this message in context: http://www.nabble.com/DescribeFeatureType-problem-tp23536305p23536305.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

So if I understand the question correctly it is why are you getting the name and location elements as well?

What version of Geoserver are you using? and what is the backend datastore for this layer?

-Justin

Steve Cameron wrote:

I have the following response to a WFS DescribeFeatureType request for a WFS
I am trying to get geoserver to use to create a WMS layer.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.imos.org.au"
elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot;
xmlns:imos="http://www.imos.org.au" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd&quot;/&gt;
<xsd:element name="sensor" substitutionGroup="gml:_Feature"
type="imos:sensorType"/>
<xsd:complexType name="sensorType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element name="name" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="location" minOccurs="1" maxOccurs="1"
type="gml:PointPropertyType"/>
<xsd:element name="url" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="channel" minOccurs="1" maxOccurs="unbounded"
type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

However in the FeatureType Configuration interface for geoserver 1.7.4 for a
new feature type I only see the url and the channel properties in the list
at the bottom of the page.

There is no indication as to why this may have occurred in the user
interface and nothing in the log with DEBUG enabled.

I have found that there is very little information relevant seen to solving
this kind of configuration issue available as in the following routine in
the RetypingDataStore class the original IOException is not rethrown.

    void updateMap(FeatureTypeMap map, boolean forceUpdate) throws
IOException {
        try {
            if (map.getFeatureType() == null || forceUpdate) {
                SimpleFeatureType original =
wrapped.getSchema(map.getOriginalName());
                SimpleFeatureType transformed =
transformFeatureType(original);
                map.setFeatureTypes(original, transformed);
            }
        } catch (IOException e) {
            // if the feature type cannot be found in the original data
store,
            // remove it from the map
            backwardsMap.remove(map.getName());
            forwardMap.remove(map.getOriginalName());
        }
    }

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Steve Cameron ha scritto:

I have the following response to a WFS DescribeFeatureType request for a WFS
I am trying to get geoserver to use to create a WMS layer.

So, you are trying to use the WFS datastore to cascade another WFS
server?
Doing WFS cascading is a hard business, we had to make server
specific subclasses in the datastore to handle different OGC certified
compliant servers, since the standard leaves a lot of liberty to servers
in how they implement their behavior. Trying to add support for a new
server (is yours home grown?) usually requires writing a new
strategy class in the WFS datastore.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.imos.org.au"
elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot;
xmlns:imos="http://www.imos.org.au" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd&quot;/&gt;
<xsd:element name="sensor" substitutionGroup="gml:_Feature"
type="imos:sensorType"/>
<xsd:complexType name="sensorType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element name="name" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="location" minOccurs="1" maxOccurs="1"
type="gml:PointPropertyType"/>
<xsd:element name="url" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="channel" minOccurs="1" maxOccurs="unbounded"
type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

However in the FeatureType Configuration interface for geoserver 1.7.4 for a
new feature type I only see the url and the channel properties in the list
at the bottom of the page.

There is no indication as to why this may have occurred in the user
interface and nothing in the log with DEBUG enabled.

I have found that there is very little information relevant seen to solving
this kind of configuration issue available as in the following routine in
the RetypingDataStore class the original IOException is not rethrown.

    void updateMap(FeatureTypeMap map, boolean forceUpdate) throws
IOException {
        try {
            if (map.getFeatureType() == null || forceUpdate) {
                SimpleFeatureType original =
wrapped.getSchema(map.getOriginalName());
                SimpleFeatureType transformed =
transformFeatureType(original);
                map.setFeatureTypes(original, transformed);
            }
        } catch (IOException e) {
            // if the feature type cannot be found in the original data
store,
            // remove it from the map
            backwardsMap.remove(map.getName());
            forwardMap.remove(map.getOriginalName());
        }
    }

Hum, annoying, I did not really consider inability to parse
the original schema as one of the possible issues, because usually
people do apply name aliasing only after the schema has been
successfully parsed once already.
There is only one case in which the aliasing triggers automatically, and
it's when the original name contains invalid characters in the type name , yet that does not seem to be your case...

Since you're citing the source code of GeoServer I guess you already
managed to debug some of it in an IDE?
If so, why didn't you try to build a version that logs the stack trace?

Assuming you had issues rebuilding the jars, try replacing the
data-1.7.4.jar you have in geoserver/web-inf/lib with the
one attached (make sure you remove the pre-existing one before
adding the one attached). This one will log the exception to
geoserver.log.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

data-1.7.5-SNAPSHOT.jar (68.6 KB)

Hi Stephen,

Sorry for the late reply, this message got thrown into my spam folder. Also for future reference, try to keep replies on the public mailing list. It will a) ensure that you actually get a reply :slight_smile: and b) it is our general policy to keep all mail public unless you are sharing confidential information.

That said, to answer your question yes and no :). On geoserver 1.7.x maxOccurs > 1 is not supported as geoserver only supports simple features, in which multi valued attributes are not allowed.

However, the complex feature support on trunk has come a long way, and is getting close to prime time.

-Justin

Stephen Cameron wrote:

Yes the problem is that I do not see the name and location elements as well.

I have subsequently found that 'name' is probably an illegal feature property name as changing it to 'title' was accepted by Geoserver 1.7.4.

So the remaining issue is that the spatial property 'location' is not accepted ( ie <xsd:element name="location" minOccurs="1" maxOccurs="1" type="gml:PointPropertyType"/> ), with no indication as to why.

The backend datastore is my own code extracting data from another server using a non-standard protocol. I want to present this data as a WFS service, this may be why I am having difficulties with various WMS systems getting acceptance of my GetCapabililities, DescribeFeatureType and GetFeature responses.

One final question, does Geoserver allow maxOccurs="unbounded" on a feature property?

Thanks for any assistance.

Justin Deoliveira wrote:

So if I understand the question correctly it is why are you getting the name and location elements as well?

What version of Geoserver are you using? and what is the backend datastore for this layer?

-Justin

Steve Cameron wrote:

I have the following response to a WFS DescribeFeatureType request for a WFS
I am trying to get geoserver to use to create a WMS layer.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.imos.org.au"
elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot;
xmlns:imos="http://www.imos.org.au" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd&quot;/&gt;
<xsd:element name="sensor" substitutionGroup="gml:_Feature"
type="imos:sensorType"/>
<xsd:complexType name="sensorType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element name="name" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="location" minOccurs="1" maxOccurs="1"
type="gml:PointPropertyType"/>
<xsd:element name="url" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<xsd:element name="channel" minOccurs="1" maxOccurs="unbounded"
type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

However in the FeatureType Configuration interface for geoserver 1.7.4 for a
new feature type I only see the url and the channel properties in the list
at the bottom of the page.

There is no indication as to why this may have occurred in the user
interface and nothing in the log with DEBUG enabled.

I have found that there is very little information relevant seen to solving
this kind of configuration issue available as in the following routine in
the RetypingDataStore class the original IOException is not rethrown.

    void updateMap(FeatureTypeMap map, boolean forceUpdate) throws
IOException {
        try {
            if (map.getFeatureType() == null || forceUpdate) {
                SimpleFeatureType original =
wrapped.getSchema(map.getOriginalName());
                SimpleFeatureType transformed =
transformFeatureType(original);
                map.setFeatureTypes(original, transformed);
            }
        } catch (IOException e) {
            // if the feature type cannot be found in the original data
store,
            // remove it from the map
            backwardsMap.remove(map.getName());
            forwardMap.remove(map.getOriginalName());
        }
    }

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.