Thanks Andrea for the help. Ben, not sure if we have missed out something or
there's a bug somewhere...
________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Andrea
Aime
Sent: Friday, 11 November 2011 3:44 PM
To: Tan, Florence (CESRE, Kensington)
Cc: [email protected]; [email protected];
Caradoc-Davies, Ben (CESRE, Kensington)
Subject: Re: [Geoserver-users] [ExternalEmail] Re: app-schema WMS
On Fri, Nov 11, 2011 at 5:25 AM, <[email protected]> wrote:
Last thing to add : I noticed the FeatureTypeDetails (as attached) for
gsml:Borehole layer is following the actual Borehole.xsd instead of the mapping
in the app-schema config file. Does it means the following PropertyName should
follow what shown in the FeatureTypeDetail :
<sld:Geometry>
<ogc:PropertyName>collarLocation</ogc:PropertyName>
</sld:Geometry>
Doesn't seems to make it work as well...
Not sure. Here is the code that throws the error you're seeing:
StyleAttributeExtractor sae = new StyleAttributeExtractor();
sae.visit(style);
Set<PropertyName> styleAttributes = sae.getAttributes();
// see if we can collect any attribute out of the provided layer
// Set attributes = new HashSet();
FeatureType type = null;
if (mapLayerInfo.getType() == MapLayerInfo.TYPE_VECTOR
|| mapLayerInfo.getType() == MapLayerInfo.TYPE_REMOTE_VECTOR) {
try {
if (mapLayerInfo.getType() == MapLayerInfo.TYPE_VECTOR)
type = mapLayerInfo.getFeature().getFeatureType();
else
type = mapLayerInfo.getRemoteFeatureSource().getSchema();
} catch (IOException ioe) {
throw new RuntimeException("Error getting FeatureType, this
should never happen!",
ioe);
}
}
// check all attributes required by the style are available
for (PropertyName attName : styleAttributes) {
if ( attName.evaluate(type) == null ) {
throw new ServiceException(
"The requested Style can not be used with this layer.
The style specifies "
+ "an attribute of " + attName + " and the
layer is: "
+ mapLayerInfo.getName());
}
}
So it seems that the FeatureType does not really contain an attribute whose
path is:
gsml:collarLocation/gsml:BoreholeCollar/gsml:location
It may be that the feature type definition in memory does not match what you'd
expect,
not sure.
WMS support for complex features was added late and used very little as far as
I know
(and I don't know much, just helped a bit to get rid of some StreamingRenderer
simple
feature assumptions).... so afaik a rough ride is to be expected.
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users