[Re-sending to the list with Brett's agreement.]

Brett,

in answer to your first question, I suspect that this is an app-schema 
bug. I think that gml:id was envisaged as an opaque handle, and your 
use-case (PropertyIsLike on gml:id) was not anticipated. However, I can 
see nothing in the spec that makes your filter invalid (but I'm not an 
expert).

In answer to your second question, the app-schema module has been 
formally promoted to supported extension status and moved to:
http://svn.osgeo.org/geotools/trunk/modules/extension/app-schema/

Kind regards,
Ben.

On 10/04/12 11:31, Brett Walker wrote:
> Hi Ben,
>
> I think I have found another bug in App Schema. I just want to confirm that 
> it is one. I could be doing something wrong.
>
> I’m trying to apply a OGC filter to the following representative portion of 
> XML data
>
> <wfs:FeatureCollection>
>    <gml:featureMember>
>      <iso19112:SI_LocationType gml:id="featureClass.1">
>        <iso19112:name>Administration</iso19112:name>
>        <iso19112:identification>featureClass.1</iso19112:identification>
>        <iso19112:definition>Administration</iso19112:definition>
>      </iso19112:SI_LocationType>
>    </gml:featureMember>
>    <gml:featureMember>
>      <iso19112:SI_LocationType gml:id="featureType.SND">
>        <iso19112:name>Sound</iso19112:name>
>        <iso19112:identification>featureType.SND</iso19112:identification>
>        <iso19112:definition>Sound</iso19112:definition>
>      </iso19112:SI_LocationType>
>    </gml:featureMember>
>    <gml:featureMember>
>      <iso19112:SI_LocationType gml:id="state.WA">
>        <iso19112:name>Western Australia</iso19112:name>
>        <iso19112:identification>state.WA</iso19112:identification>
>        <iso19112:definition>Western Australia</iso19112:definition>
>      </iso19112:SI_LocationType>
>    </gml:featureMember>
> </wfs:FeatureCollection>
>
> The filter being applied is
>
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc";>
>    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\">
>      <ogc:PropertyName>iso19112:SI_LocationType/@gml:id</ogc:PropertyName>
>      <ogc:Literal>state.%</ogc:Literal>
>    </ogc:PropertyIsLike>
> </ogc:Filter>
>
> I’m trying to return only the feature members that have the gml:id attribute 
> of the iso19112:SI_LocationType element starting with state. But I’m getting 
> a stack trace on the console:
>
> java.lang.IllegalArgumentException: Can't find source expression for: 
> iso19112:SI_LocationType/@gml:id
>          at 
> org.geotools.data.complex.filter.UnmappingFilterVisitor.visit(UnmappingFilterVisitor.java:828)
>          at 
> org.geotools.filter.AttributeExpressionImpl.accept(AttributeExpressionImpl.java:380)
>          at 
> org.geotools.data.complex.filter.UnmappingFilterVisitor.visit(UnmappingFilterVisitor.java:484)
>          at org.geotools.filter.LikeFilterImpl.accept(LikeFilterImpl.java:614)
>          at 
> org.geotools.data.complex.AppSchemaDataAccess.unrollFilter(AppSchemaDataAccess.java:403)
>          at 
> org.geotools.data.complex.AppSchemaDataAccess.unrollQuery(AppSchemaDataAccess.java:310)
>          at 
> org.geotools.data.complex.MappingFeatureIteratorFactory.getInstance(MappingFeatureIteratorFactory.java:49)
>          at 
> org.geotools.data.complex.MappingFeatureCollection.iterator(MappingFeatureCollection.java:235)
>          at org.geotools.xml.Encoder.encode(Encoder.java:1003)
>          at org.geotools.xml.Encoder.encode(Encoder.java:566)
>          at 
> org.geoserver.wfs.xml.GML3OutputFormat.encode(GML3OutputFormat.java:256)
>          at 
> org.geoserver.wfs.xml.GML3OutputFormat.complexFeatureStreamIntercept(GML3OutputFormat.java:274)
>          at 
> org.geoserver.wfs.xml.GML3OutputFormat.write(GML3OutputFormat.java:242)
>          at 
> org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:141)
>          at org.geoserver.ows.Dispatcher.response(Dispatcher.java:751)
>          at 
> org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:238)
>          at 
> org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
>          at 
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
>          at 
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
>          at 
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
>          at 
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
>          at 
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>          …
>
>
> It seems that the 
> UnmappingFilterVisitor.visit(UnmappingFilterVisitor.java:828) cannot handle a 
> filter being applied to attributes of the root element; in this case 
> iso19112:SI_LocationType.
>
> I have looked through the code, 
> UnmappingFilterVisitor.findMappingFor(UnmappingFilterVisitor.java:848) seems 
> to return an empty list of Expressions. Even the last check (870 - 889) seems 
> not to consider the case.
>
> Have I applied the filter incorrectly or is this a bug in App Schema?
>
> An aside, I have noticed that the SVN repository for App Schema at 
> http://svn.osgeo.org/geotools/trunk/modules/unsupported/app-schema/ is 
> missing the app-schema sub-directory. It only includes the webservice 
> directory. Is the future direction of app-schema changing? Where can I get 
> the trunk code for app-schema?
>
> Brett
>
> Brett Walker<[email protected]<mailto:[email protected]>>
> Software Developer / Analyst
> Geometry Pty Ltd
>
> Telephone               03 6223 1999
> Mobile                     0458 498 386
> Fax                          03 6223 1988
> Web                        www.geometryit.com<http://www.geometryit.com/>
> Address                   31 Salamanca Square, Battery Point, TAS 7004, 
> Australia
>
>

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

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to