Unable to perform spatial query (BBOX param) on complex features - Axis 
ordering, transformation of filter failing
------------------------------------------------------------------------------------------------------------------

                 Key: GEOT-3174
                 URL: http://jira.codehaus.org/browse/GEOT-3174
             Project: GeoTools
          Issue Type: Bug
          Components: data app-schema
    Affects Versions: 2.6.5, 2.7-M3, 2.7-RC1
         Environment: Windows XP, JAVA 1.5
            Reporter: Derrick Wong
             Fix For: 2.6.5, 2.7-M3, 2.7-RC1
         Attachments: AxisOrder2.patch, BBoxFitlerTest.patch

Performing spatial query (with BBOX param) on complex features returns 0 
Results.

This is due to the transformation of the filter (which handles the Axis 
ordering) not working for complex features.

In my initial investigation, I have written a test class which extends 
org.geoserver.test.AbstractAppSchemaWfsTestSuport, when trying to obtain a 
org.w3c.dom.Document object by calling the method getAsDom(String path), if I 
specified the param "BBOX" in my WFS request, my Unit Test would fail. This 
only happens on complex features, which led me to the following 2 classes in 
particular.


org.geotools.filter.expression.SimpleFeaturePropertyAccessor line 67-68:


        //if ("".equals(xpath) && target == Geometry.class)
        if ("".equals(xpath))
            return DEFAULT_GEOMETRY_ACCESS;

I had a look into the repository and this change was made in geotools-trunk 
revision 26186. (jdeolive 10/07/2007 10:18:59 AM GEOT-1372, feature model api 
changes in preparation for geoapi feature model implementation)

Comparing this with

org.geotools.filter.expression.FeaturePropertyAccessorFactory line 113-114:

   if ("".equals(xpath) && target == Geometry.class)
       return DEFAULT_GEOMETRY_ACCESS;


The method createPropertyAccessor for both classes are now different. 

an snippet of the reply I had from Jody:

From: Jody Garnett [mailto:jody.garn...@gmail.com] 
Sent: Monday, 3 May 2010 3:36 PM
To: Wong, Derrick (CESRE, Kensington)
Cc: geotools-devel@lists.sourceforge.net
Subject: Re: [Geotools-devel] Geotool query - Differences in 
SimpleFeaturePropertyAccessor and FeaturePropertyAccessorFactory

The check of target == Geometry.class looks very ill advised (should use 
Geometry.class.isAssignableFrom( target ) for one).

I see no trouble removing the target test in the manner you described; the 
process is to submit a JIRA bug report (with a patch + test case if you want it 
acted on promptly). Chances are you know someone in your organisation who can 
apply the patch :-D



Please find attached the patch for this problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to