Hi Again,

Right now I guess you will need to cast when making a Query (it probably 
should not of been let out of the door in this
state I admit). Perhaps leave of working with the GeoAPI interfaces 
until GeoTools 2.4.

Either that or we can make Query accept a GeoAPI filter as well ... (ie 
let GeoTools do the casting rather then you).
Jody
> Jody,
>
> I am a little bit confused here:
>
> In 2.2.x,  I use following code to create a Query with Filter and then
> apply on some feature source, in which FilterFactory is from
> "org.geotools.filter.FilterFactory"
>
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>  
>
>
> FilterFactory filterFactory = FilterFactoryFinder.createFilterFactory();
> CompareFilter filter =
> filterFactoryImpl.createCompareFilter(CompareFilter.COMPARE_EQUALS);
>             
> filter.addLeftValue(filterFactoryImpl.createAttributeExpression("state_name"));
>  
>
>             
> filter.addRightValue(filterFactoryImpl.createLiteralExpression("California"));
>  
>
>
> query = new DefaultQuery(dataStore.getTypeNames()[i], filter);
>
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>  
>
>
> Accroding to the document you pointed me to, I use the code below in
> 2.3.x to do the same thing, in which FilterFactory and Filter are from
> GeoAPI. The Quesion is when I create a query, should I cast the
> "GeoAPI Filter" into some "GeoTools Filter" subinterface? Right now I
> cast it into IsEqualsToImpl, did I do the right thing?
>
> Thanks a lot,
> Yingqi
>
> ####################################################################
>
> FilterFactory filterFactory = FilterFactoryFinder.createFilterFactory();
>             Filter compareFilter =
> filterFactory.equals(filterFactory.literal("state_name"),
> filterFactory.literal("California"));
>
> query = new DefaultQuery(dataStore.getTypeNames()[i],
> (IsEqualsToImpl)compareFilter);
>
> ####################################################################
>
>
> On 1/19/07, Jody Garnett <[EMAIL PROTECTED]> wrote:
>> The migration docs have some examples ...
>>
>> http://docs.codehaus.org/display/GEOTOOLS/Upgrade+to+2.4#Upgradeto2.4-filter 
>>
>>
>> It shows 2.2, 2.3 and 2.4 code examples (that get easier and easier
>> showing we are improving).
>> Jody
>> > Hi All,
>> >
>> > I am using geotools 2.3.0 now, and the tutorial and example I found at
>> > the website about using Filter (CompareFilter) is kind of outof date
>> > because I saw many of the classes or interfaces are deprecated in
>> > 2.3.0.
>> >
>> > Can any one provide an example of using compareFilter on a
>> > featureSource, which is kind of a standard way to do in 2.3.0?
>> >
>> > Thanks,
>> >
>> > 
>> ------------------------------------------------------------------------- 
>>
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to 
>> share your
>> > opinions on IT & business topics through brief surveys - and earn cash
>> > 
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>
>> > _______________________________________________
>> > Geotools-gt2-users mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>> >
>>
>>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to